Skip to content
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

Move gazebo_yarp_controlboard coupling logic to dynamically loaded plugins #470

Closed
traversaro opened this issue Mar 6, 2020 · 1 comment · Fixed by #671
Closed

Move gazebo_yarp_controlboard coupling logic to dynamically loaded plugins #470

traversaro opened this issue Mar 6, 2020 · 1 comment · Fixed by #671

Comments

@traversaro
Copy link
Member

Until now, the coupling logic for the iCub and R1 has been hardcoded in the gazebo_yarp_controlboard plugin, in particular as child classes of the BaseCouplingHandler in the file https://github.com/robotology/gazebo-yarp-plugins/blob/3fa2c45a4b8a63ef15c524462124b505f29b3ed9/plugins/controlboard/include/yarp/dev/ControlBoardDriverCoupling.h . As the gazebo-yarp-plugins is meant to be robot-indipendent, this is clearly not ideal, as any new coupled mechanism needs to manually modify the source code of gazebo-yarp-plugins to simulate in Gazebo, see for example #469 .
I think that the best solution is to add support in gazebo_yarp_controlboard to load coupling logic from classes loaded dynamically. In particular, as the rest of the infrastructure already uses a lot of YARP logic, I think the easiest option is to install the header that contains the BaseCouplingHandler, and then permit to downstream users to define YARP device drivers that inherit from BaseCouplingHandler, and then specify the name of the YARP device driver to load in the .ini configuration file of the gazebo_yarp_controlboard plugin.

In particular, I think we should still use the coupling configuration format (see https://github.com/robotology/icub-gazebo/blob/ab22fdc34c0a9faa6f72428c2abdb6afc3145872/icub/conf/gazebo_icub_left_hand_index.ini#L17):

[COUPLING]
index_control (0 1 2) (l_index_proximal l_index_distal reserved)

But the first string of the line, instead of being an hardcoded string checked in

if (coupling_bottle->get(0).asString()=="eyes_vergence_control")
, should be the name of a yarp device that must inherit from the BaseCouplingHandler interface.

cc @fiorisi @randaz81 @ale-git @xEnVrE

@traversaro traversaro changed the title Move coupling logic to dynamically loaded plugins Move gazebo_yarp_controlboard coupling logic to dynamically loaded plugins Mar 6, 2020
@traversaro
Copy link
Member Author

This will be finally solved in #671 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant