Ask Your Question
0

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
0

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>


<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 -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

2 followers

Stats

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

Seen: 34 times

Last updated: Nov 03