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

How to simultaneously load 2 completely different urdf in robot_description param

asked 2021-07-06 02:32:49 -0500

bolu gravatar image

I want to spawn 2 different robots. one is a DRONE and another is a MOBILE ROVER. Both have no joint mutual in between. I need to control them via ROS simultaneously. The major problem is I cannot use robot_description to load both urdf sequentially because later overwrites initial. Is there any way to spawn them together? Or please tell me if I should approach it differently.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-08-01 08:05:36 -0500

bolu gravatar image

updated 2021-11-03 21:28:58 -0500

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>
edit flag offensive delete link more

Comments

2

It would be cleaner and more ros-like if you create a namespace for each robot using a grouptag. See http://wiki.ros.org/roslaunch/XML#Tag....

Independent of my first comment, don't forget you'll also need to avoid collisions between the Transform Frame names.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-08-01 08:52:25 -0500 )edit

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

Sid05 gravatar image Sid05  ( 2022-06-23 11:10:24 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-07-06 02:32:49 -0500

Seen: 221 times

Last updated: Nov 03 '21