0
$\begingroup$

Rosanswers logo

I was reading the ROS Best Practices page for the REP 105 regarding the coordinate frames in order to start building a multi-robot ready tf tree.

I would like to be able to launch two robots within the same roscore environment. This would imply some modifications to the standard tf tree proposed, for the need to distinguish between the frames of one robot from the other.

For what I have seen, one of the common ways to build the robot tf tree is through the URDF files. In there all robot frames are named. From here it comes my first question. As my two robots have exactly the same configuration I wanted to use the same urdf file, but that would duplicate the frame names. Do I have to create a different urdf file for each robot?

Assuming two robots, r1 and r2, then the final tf tree would look something like this:

                  map
                 /       <br>      odom_r1    odom_r2
              |             |
base_link_r1    base_link_r2
              |             |
  sensors_r1    sensors_r2

I do not specially like this solution, but as the frame names must be unique I can not see a better one.

As I read in several anwsers the odometry node is supposed to send the transforms from odom to base_link, while a localization node would send the transforms from map to odom to correct the odometry drifting over time. In this "new" tf scheme this solution is still valid, the nodes would just require a parameter remapping to work with "odom_r1" instead of just "odom".

I just wanted to be sure my assumptions are coherent with the ROS directions before starting the whole implementation.


Originally posted by joan on ROS Answers with karma: 245 on 2011-07-29

Post score: 5


Original comments

Comment by hsu on 2011-08-24:
there is a multi_robot_test.launch file I played around with and mentioned in http://answers.ros.org/question/1826/how-to-import-two-pr2-on-gazebo-at-the-same-time

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The tf_prefix is the recommended way of using multiple robots. This will allow you to use the same URDFs (or at least it should), since the prefix will turn things into r1/odom and r2/odom automatically depending on which robot you are on.

See Coordinate Frame Conventions: Naming, the TF FAQ and the mailing list archive for more info on tf_prefix. I've never used it personally, but it should help you split up things across robots without manually changing all of the frame names.


Originally posted by Eric Perko with karma: 8406 on 2011-07-29

This answer was ACCEPTED on the original site

Post score: 9


Original comments

Comment by joan on 2011-08-24:
Thanks for your answer it was really useful. Please look at my answer below for additional doubts

$\endgroup$

Your Answer

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