YARP
Yet Another Robot Platform
Example for fakeFrameGrabber (fakeFrameGrabber_basic)

Instantiates fakeFrameGrabber device implemented by FakeFrameGrabber. More...

+ Collaboration diagram for Example for fakeFrameGrabber (fakeFrameGrabber_basic):

Instantiates fakeFrameGrabber device implemented by FakeFrameGrabber.

# start up a fake image source of size 640x480, with 4 images per second
device fakeFrameGrabber
width 640
height 480
period 0.25

If this text is saved in a file called fakeFrameGrabber_basic.ini then the device can be created by doing:

yarpdev --file fakeFrameGrabber_basic.ini

Of course, the configuration could be passed just as command line options, or as a yarp::os::Property object in a program:

Property p;
p.fromConfigFile("fakeFrameGrabber_basic.ini");
// of course you could construct the Property object on-the-fly
PolyDriver dev;
dev.open(p);
if (dev.isValid()) { /* use the device via view method */ }

Here is a list of properties checked when starting up a device based on this configuration file. Note that which properties are checked can depend on whether other properties are present. In some cases properties can also vary between operating systems. So this is just an example

PROPERTYDESCRIPTIONDEFAULT
device
widthdesired width of test image320
heightdesired height of test image240
horizontalFovdesired horizontal fov of test image1.0
verticalFovdesired vertical fov of test image2.0
mirrormirroring disabled by default0
physFocalLengthPhysical focal length of the fakeFrameGrabber3.0
focalLengthXHorizontal component of the focal length of the fakeFrameGrabber4.0
focalLengthYVertical component of the focal length of the fakeFrameGrabber5.0
principalPointXX coordinate of the principal point of the fakeFrameGrabber6.0
principalPointYY coordinate of the principal point of the fakeFrameGrabber7.0
retificationMatrixMatrix that describes the lens' distortion(fake)1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
distortionModelReference to group of parameters describing the distortion model of the cameraFishEye
k1Radial distortion coefficient of the lens(fake)8.0
k2Radial distortion coefficient of the lens(fake)9.0
k3Radial distortion coefficient of the lens(fake)10.0
t1Tangential distortion of the lens(fake)11.0
t2Tangential distortion of the lens(fake)12.0
freqrate of test images in Hz
periodperiod of test images in seconds
modebouncy [ball], scrolly [line], grid [grid], grid multisize [size], random [rand], none [none], time test[time]line
src
bayershould emit bayer test image?
monoshould emit a monochrome image?
See also
FakeFrameGrabber