YARP
Yet Another Robot Platform
Example for fakeMotor (fakeMotor_basic)

Instantiates fakeMotor device implemented by FakeMotor. More...

+ Collaboration diagram for Example for fakeMotor (fakeMotor_basic):

Instantiates fakeMotor device implemented by FakeMotor.

# set up a fake motor control device with 8 joints
device fakeMotor
axes 8
name /motor

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

yarpdev --file fakeMotor_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("fakeMotor_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
axesnumber of axes to pretend to have4
delaydelay in each call for debugging purpose, in ms0
See also
FakeMotor