0
$\begingroup$

Rosanswers logo

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.


Originally posted by bolu on ROS Answers with karma: 11 on 2021-07-06

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.