gazebo-yarp-plugins icon indicating copy to clipboard operation
gazebo-yarp-plugins copied to clipboard

External wrench missing port prefix

Open lrapetti opened this issue 5 years ago • 1 comments

When the gazebo_icub_robotname.ini is commented out, as described in order to use multiple robots (https://github.com/robotology/icub-gazebo-wholebody/blob/devel/worlds/two_icubs_standup_world/README.md), the applyExternalWrench/rpc:i port is open without the prefix:

  • with gazebo_icub_robotname.ini:
    /icubSim/applyExternalWrench/rpc:i
    
  • with gazebo_icub_robotname.ini commented:
    //applyExternalWrench/rpc:i
    
    while I would expect it to be:
    /iCub/applyExternalWrench/rpc:i
    

This is a problem for the following reasons:

  • when spawning multiple robots, the port can be opened only by the first one because the other would use the same port.
  • it is inconsistent with the prefix usage of the other ports

This problem seems to be due to the fact that the robot name is empty when not specified in the .ini because it is read from the gazeboYarpPluginsRobotName variable: https://github.com/robotology/gazebo-yarp-plugins/blob/06255f1a1b30580b74e237449ba2be79836d2a62/plugins/externalwrench/src/ApplyExternalWrench.cc#L40

However, in the controlBoard ports we don't have this problem since the name is derived from the parent model name: https://github.com/robotology/gazebo-yarp-plugins/blob/d748428fcb8b1f75a9981af2263dad0be2171833/plugins/controlboard/src/ControlBoard.cc#L76 So the external wrench plugin should be changed to work as the control-board.

see also https://github.com/robotology/gazebo-yarp-plugins/issues/436

lrapetti avatar Jul 30 '19 08:07 lrapetti

However, in the controlBoard ports we don't have this problem since the name is derived from the parent model name:

Don't get confused by the ambiguous used of "robotName", in controlBoard that variable is not used as the prefix for the wrapper. This is not a problem in the controlboard due to the use of a the loadConfigModelPlugin function, that in turns calls GazeboYarpPlugins::addGazeboEnviromentalVariablesModel that defines gazeboYarpPluginsRobotName even if it not explicitly set in the .ini conf file, see https://github.com/robotology/gazebo-yarp-plugins/blob/06255f1a1b30580b74e237449ba2be79836d2a62/libraries/singleton/include/GazeboYarpPlugins/ConfHelpers.hh#L57 for more info. Instead of loading the ini file directly, the externalwrench plugin should load it via the loadConfigModelPlugin helper function.

traversaro avatar Jul 30 '19 10:07 traversaro