Removed yarpdev --subdevice option in various device wrappers #3078
randaz81
started this conversation in
Policies and Conventions
Replies: 1 comment
-
cc @robotology/everyone |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear all,
in order to continuously improve Yarp, in terms of efficiency and long-term maintainability, we are going to deprecate
yarpdev --subdevice
option, starting from the next transition from yarp 3.9 to yarp 3.10. This may affect some xml scripts and user applications. An alternate solution is provided below.The motivation:
The
subdevice
parameter was implemented by wrapper devices to automatically start the wrapper from a single command line and attach it to a device implementing the interface requested by the device. A clear example is constituted by a video grabber which streams data over a yarp port and a specific camera driver managing the hardware. Over the years, this pattern was copied and pasted on several wrappers but it never became an official standard. Some wrappers were not implementing it, other devices were implementing it in different ways, including validity checks or not, depending and the specific device.In order to provide an official way to perform this operation, avoiding duplication of code, which is obviously prone to errors, this mechanism is now implemented at a different software level, i.e. by a specific new device called
deviceBundler
.What is affected:
All new wrapper devices/nws do not implement the --subdevice parameter: this strategy was already chosen to prepare to this transition. In Yarp 3.9 its use is limited to the few devices listed below:
If yarpdev detects the usage of the --device and --subdevice parameters, an error message will be displayed, showing also the correct command line to use, as described below.
What is not affected:
This parameter is mostly used by yarpdev command line.
Scripts involving yarpinterface should not be affected by this change, since YRI already implements its own attachment mechanism, which is even more powerful because it allows attaching a device to multiple wrappers.
C++ code is also unaffected by this change, unless the user has not explicitly asked for this mechanism by passing the --subdevice parameter to the Polydriver class, a very uncommon case (which was not detected by searching through the organization repos)
The alternatives:
Generally speaking, the following command line:
is now replaced by:
which explicitly shows how the system works, without hidden layers:
deviceBundler
opens the two devicesdevicename
andsubdevicename.
Please note that optional parameters are passed to all involved devices (this was true also with the previous syntax.deviceBundler
performs the attach.See the
deviceBundler
documentation for additional infos.Additional raccomandations:
yarpdev executable has two major limitations:
And a single advantage:
Considering this latter use case, which is mostly relevant on embedded systems, we recommended to prefer the usage of
yarprobotinterface
executable overyarpdev
in all standard use cases.Relevant PRs:
Beta Was this translation helpful? Give feedback.
All reactions