robotology/icub-models-generator

Migrate models to use new gazebo_yarp_robotinteface plugin

traversaro opened this issue ยท 6 comments

Migrate models to use new gazebo_yarp_robotinteface plugin

After completing robotology/gazebo-yarp-plugins#615 and robotology/gazebo-yarp-plugins#616, I started looking into this. However, I just realized that we would need now to hardcode icubSim in all the wrapper configuration files, basically preventing any use case in which we have two different iCub models (with different port prefix) in the same simulation, see for example https://icub-tech-iit.github.io/documentation/icub_setup_multiple_robots/two_robots_simulation/ .

This is quite problematic as the two iCub use case is quite widespread in some subgroups of AMI (fyi @lrapetti).

@Nicogene @ste93 @randaz81 do you have any idea on how we can replicate a similar behavior with the new structure? Basically we would need that the port prefix used by the model (i.e. icubSim) can be optionally be specified programmatically, so that we can spawn multiple icub models without any port conflict.

We discussed with @randaz81 and we agreed that I will implement the possibility in YARP of using the ${portprefix} variable in the yarprobotinterface .xml file to refer to the portprefix=<> attribute of the robot element, that is already required and unused (see robotology/yarp#2492). This (associated with the appropriate option in gazebo_yarp_robotinterface to override the portprefix from SDF) will permit to have two iCubs simulated in the same Gazebo world without any YARP port name conflict.

We discussed with @randaz81 and we agreed that I will implement the possibility in YARP of using the ${portprefix} variable in the yarprobotinterface .xml file to refer to the portprefix=<> attribute of the robot element, that is already required and unused (see robotology/yarp#2492).

This is nice @traversaro! Thanks for taking care of it, and let me know if you need any support, or help for testing it!

Fix for iCub 3 in #222 .

The last problems with this were fixed with the mentioned PRs.