ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

similar to the previous answers, here is probably a very round-about example for you. First off, in gazebo controller manager plugin implementation, each controller plugin starts a rosnode with a custom robot namespace, i.e.:

this->rosnode_ = new ros::NodeHandle(this->robotNamespace);

So each robot has its own plugin with a uniquely namespaced rosnode.

To assign namespaces, I left the option to assign robot namespace as a model XML parameter to be parsed by the plugin, or optionally insert the parameter at time of spawning the robot (e.g. spawn_model -namespace xxx .... This should be done along with starting all the non-simulation controller nodes in grouped namespace as mentioned in other answers. As an overall example, please see this launch file.

Any suggestions to make this process cleaner and more scalable are welcome. Thanks!