robotology / gazebo-yarp-plugins

Plugins to interface Gazebo with YARP.
33 stars 48 forks source link

External wrench missing port prefix #438

Open lrapetti opened 5 years ago

lrapetti commented 5 years ago

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:

This is a problem for the following reasons:

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

traversaro commented 5 years ago

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.