Ask Your Question

How to simultaneously load 2 completely different urdf in robot_description param

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

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

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

bolu gravatar image

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

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



It would be cleaner and more ros-like if you create a namespace for each robot using a grouptag. See

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 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



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

Seen: 34 times

Last updated: Nov 03