ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can use the <robotNamespace>
tag for the ros_control plugin in the .xacro (also have a look at the Gazebo Tutorial). The UR description loads the plugin in the common.gazebo.xacro file.
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/MYROBOT</robotNamespace>
</plugin>
</gazebo>
Your controllers also need to account for the namespace afterwards. If found that using namespaces in the launch files using ns=
is a simple way to add the namespace. For the UR you will probably have to change it in the controller_utils.launch of the ur_gazebo package:
<rosparam file="$(find ur_gazebo)/controller/joint_state_controller.yaml" command="load" ns="/MYROBOT" />
<node name="joint_state_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn joint_state_controller" respawn="false" output="screen" ns="/MYROBOT"/>
For multiple robots I'd suggest using arg
instead of the hardcoded /MYROBOT
.