-
Notifications
You must be signed in to change notification settings - Fork 12
Description
I tried to use "robot_assembler/gazebo/robot_assembler_gazebo_world.launch" to run 2 robots in the gazebo world. But it kept failing. I found the reason is about the "gazebo_ros_control" plugin which is described in the "robot_model.urdf" (I mean the robot model urdf file which is generated by using robot_assembler) .
The "gazebo_ros_control" plugin keeps searching for the [robot_description] parameter on the ROS server under the namespace of "/" regardless of the namespace you set in the launch files. I mean even though you set the namespace to "robot1", it will still try to find [robot_description] under the namespace of "/" but not "robot1".
This problem can be solve by changing the xxx.urdf file (your urdf file generated using robot_assembler). You can find the following lines in you file:
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</gazebo>
Here, the tag set the namespace of the gazebo_ros_control plugin to "/", which means you can't change it in other ways. So the way to solve it is just remove that line. Change the above lines to :
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</gazebo>
In this way, the “robotNamespace” will change if you set the namespace in launch files.
I don't know whether it is a bug or not. But if you want to fix this, you can just remove the 581th line of /robot_assembler/euslisp/robot-assembler.l:
(format strm " <!--robotNamespace>/</robotNamespace-->~%")