YARP
Yet Another Robot Platform
Example for group (group_basic)

Instantiates group device implemented by DeviceGroup.

+ Collaboration diagram for Example for group (group_basic):

Instantiates group device implemented by DeviceGroup.

# Make a motor and camera device.
# Put the motor device on the network.

device group

[part mymotor]
device fakeMotionControl
GENERAL (Joints 10)

[part mycam]
device fakeFrameGrabber

[part broadcast]
device controlboardwrapper2
subdevice mymotor
name /mymotor

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

yarpdev --file group_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("group_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
parta list of section names, with each section containing a device
mymotor
mymotor.device
mymotor.wrapped
mymotor.GENERAL
mymotor.GENERAL.JointsNumber of degrees of freedom1
mymotor.GENERAL.AxisMap
mymotor.GENERAL.AxisName
mymotor.GENERAL.AxisType
mymotor.GENERAL.ampsToSensor
mymotor.GENERAL.fullscalePWM
mymotor.GENERAL.Encoder
mycam
mycam.device
mycam.wrapped
mycam.fakeFrameGrabber_rpc_portrpc port for the fakeFrameGrabber/fakeFrameGrabber/rpc
mycam.widthdesired width of test image320
mycam.heightdesired height of test image240
mycam.horizontalFovdesired horizontal fov of test image1.0
mycam.verticalFovdesired vertical fov of test image2.0
mycam.mirrormirroring disabled by default0
mycam.syncrosyncronize producer and consumer, so that all images are used once and only once0
mycam.topIsLowexplicitly set the topIsLow field in the images1
mycam.physFocalLengthPhysical focal length of the fakeFrameGrabber3.0
mycam.focalLengthXHorizontal component of the focal length of the fakeFrameGrabber4.0
mycam.focalLengthYVertical component of the focal length of the fakeFrameGrabber5.0
mycam.principalPointXX coordinate of the principal point of the fakeFrameGrabber6.0
mycam.principalPointYY coordinate of the principal point of the fakeFrameGrabber7.0
mycam.rectificationMatrixMatrix that describes the lens' distortion(fake)1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
mycam.distortionModelReference to group of parameters describing the distortion model of the cameraFishEye
mycam.k1Radial distortion coefficient of the lens(fake)8.0
mycam.k2Radial distortion coefficient of the lens(fake)9.0
mycam.k3Radial distortion coefficient of the lens(fake)10.0
mycam.t1Tangential distortion of the lens(fake)11.0
mycam.t2Tangential distortion of the lens(fake)12.0
mycam.freqrate of test images in Hz
mycam.periodperiod of test images in seconds
mycam.modebouncy [ball], scrolly [line], grid [grid], grid multisize [size], random [rand], none [none], time test[time]line
mycam.src
mycam.timestampshould write the timestamp in the first bytes of the image
mycam.noiseShould add noise to the image (uses snr)
mycam.snrSignal noise ratio ([0.0-1.0] default 0.5)0.5
mycam.bayershould emit bayer test image?
mycam.monoshould emit a monochrome image?
broadcast
broadcast.device
broadcast.wrapped
broadcast.rootName
broadcast.name
subdevice
broadcast.ROS
rootNamestarting '/' if needed./
nameprefix for port namescontrolboard
See also
DeviceGroup