In YARP, a Device is a software abstraction of a hardware or logical component, which provides a standardized interface to access specific functionalities within the middleware. More...
Modules | |
Device Creation/Configuration | |
Basic classes and methods related to creating and configuring devices, and network communication to and from devices. | |
Device Implementations | |
Concrete device drivers that implement sets of interfaces. | |
Tutorials and Examples about Devices | |
Tutorials and Examples about Devices. | |
In YARP, a Device is a software abstraction of a hardware or logical component, which provides a standardized interface to access specific functionalities within the middleware.
Devices can abstract everything: motor controllers, sensors, cameras, simulated components and even algorithms.
A device ideally should use the minimal set of interfaces needed to implement a particular task.
In Yarp, devices are implemented as plugins , meaning that they are not a stand-alone executables: they require an external wrapper to be executed. More in particular, they can be started from the commandline, via yarprobotinterface or from a programming language (c++, python, etc.).
Devices that can be created and configured from the command-line tool yarpdev by specifying a --device
option followed by their name, for example:
yarpdev --device fakeFrameGrabber
This creates a fakeFrameGrabber
device with default options. Additional configuration options can be added as optional parameters:
yarpdev --device fakeFrameGrabber --width 640 --height 480
The special parameter "--help" will show all the available parameters for that specific device.
You can check the documentation of that device (list of all devices Device Implementations here). Or When you try to run "yarpdev --device yourdevice" and add the "--help" flag, it will tell you what options it is checking, and any documentation present for those options.
yarpdev --device fakeFrameGrabber --help
You can also write the parameters in a .ini file a load it from command line. For example, you create a grabber_test.ini
file with the following text:
device frameGrabber_nws_yarp subdevice fakeFrameGrabber name /test width 640 height 480
and launch the device with:
yarpdev --file grabber_test.ini
The commandline executable yarprobotinterface provides a more advanced way to open one or more devices simultaneously (or in a specific order), and to attach them each other so that they can exchange data. Additional information is provided in yarprobotinterface documentation page.
A user application can easily open a device in c++ by instantiating a yarp::dev::PolyDriver
object and passing to it the required parameters via a yarp::os::Property
.
Other programming languages (e.g. python) are available through yarp bindings.