-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document attach/detach levels used for different kind of devices #377
Comments
Hi @traversaro, this is pretty useful. Is there any documentation that explains the meaning of the levels and why such specific levels are required? |
I am afraid not. What I think they do (looking into the code) is that they specify the order at which the attach operations are done (the lower the level, the earlier the operation is done). So imagining that the devices are nodes and the "is attached to" or "is detached from" is a ordered arcs, for the attach operations you want to do them in the order of the most closer to the roots of the tree is attached before, and "leafs" are attached later, while for the detach you want to do the contrary. The relevant code is: https://github.com/robotology/yarp/blob/e4762b0b4a7946bf9379b183379bd32353d54a26/src/libYARP_robotinterface/src/yarp/robotinterface/Robot.cpp#L667-L686 . |
I can see two different layers of documentation missing here, describing:
/remind May 06 |
⏰ Reminder |
Levels are just numbers to specify a sequence. These numbers do not have any specific meaning. There are some gaps in the sequence to allow the insertion of new stuff without reordering all the sequence. The sequence is dependent on the specific device dependencies in the same way you launch modules through yarpmanager. For example first you start a device driver, then you start the network wrapper, finally you do the attach. During closure, the order is obviously inverted. If you stop the device driver and the wrapper is still running, you'll probaby get a call to a nullptr, resulting in a segfault. I can provide an official documentaion on this topic. |
For people writing new yarprobotinterface files, it would be convenient to document the leves used for
attach
/detach
phases for different types of devices. By inspecting the configuration files, it seems that these leves are:startup
attach
startup
attach
startup
attach
shutdown
detach
shutdown
detach
shutdown
detach
The text was updated successfully, but these errors were encountered: