So here is the thing robot_description
is just a normal variable on the parameter server, we can even use red_banana
to define another robot_description file on the parameter server. The thing is we need to remap it to robot_description
in the particular node we use it in because most of the nodes use robot_description
as a parameter to get a current robot state. Below is an example of the same.
<node pkg="robot_state_publisher" type="robot_state_publisher" name="banana_state_publisher" >
<remap from="robot_description" to="banana_robot_description" />
<remap from="joint_states" to="curdbot_joint_states" />
</node>
<node pkg="robot_state_publisher" type="robot_state_publisher" name="mango_state_publisher" >
<remap from="robot_description" to="mango_robot_description" />
<remap from="joint_states" to="catbot_joint_states" />
</node>
<node name="mango_joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" respawn="false" output="screen">
<remap from="robot_description" to="/mango_robot_description" />
<remap from="joint_states" to="mango_joint_states" />
</node>
<node name="banana_joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" respawn="false" output="screen">
<remap from="robot_description" to="/banana_robot_description" />
<remap from="joint_states" to="banana_joint_states" />
</node>
Originally posted by bolu with karma: 11 on 2021-08-01
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Mike Scheutzow on 2021-08-01:
It would be cleaner and more ros-like if you create a namespace
for each robot using a group
tag. See http://wiki.ros.org/roslaunch/XML#Tag_Reference.
Independent of my first comment, don't forget you'll also need to avoid collisions between the Transform Frame names.
Comment by Sid05 on 2022-06-23:
Hi,
So I had the same problem , the answer from @bolu works.
Just as a note to someone facing the same issue , make sure the param name that you use while loading the URDF into ROS parameter server matches the name to which you remap to in both joint_state_publisher and robot_state_publisher package