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

Difference between two transform broadcasters

asked 2014-12-02 01:07:22 -0600

Hemu gravatar image

updated 2014-12-02 01:08:24 -0600

What is the difference between the following transform broadcasters in a multi-robot simulation:

1. br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "/map", "odom"));

2. br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "map", "odom"));

I have included the transform broadcaster in two namespaces: robot_1 (tf_prefix="robot_1") and robot_2(tf_prefix="robot_2"). I want to use a common map frame. Which of the above two command should I use to get transform of both robots w.r.t. global /map frame?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-12-02 05:58:41 -0600

dornhege gravatar image

I am not sure about this, but I believe they are identical. You should insert the tf_prefix yourself, i.e. retrieve the param and prefix the odom frames.

It is easy to test though: Just subscribe raw /tf and check what frames are send in the messages.

edit flag offensive delete link more


The first broadcaster provides me the desired common /map frame. The tf_prefix does not affect the name of map frame when declared as /map.

Hemu gravatar image Hemu  ( 2014-12-02 06:44:22 -0600 )edit

And I believe the same happens, when you use "map" unless you add the tf_prefix manually. Just try it out.

dornhege gravatar image dornhege  ( 2014-12-02 10:18:48 -0600 )edit

yes. that's true. Setting tf_prefix manually converts the frames to /tf_prefix/frame_name.

Hemu gravatar image Hemu  ( 2014-12-02 12:17:32 -0600 )edit

answered 2014-12-02 09:29:07 -0600

l0g1x gravatar image

updated 2014-12-02 13:09:06 -0600

I do believe that by convention, you should just enter in the name of the frame, without the /. Heres a link to the tf tutorials where they also do not include the /


Answering your comment:

In the multi-robot case you would do it like this:

  • Robot1 : "robot1/odom" or "robot1/map"
  • Robot2 : "robot2/odom" or "robot2/map"

However, dont confuse frame ID's (like the ones above) with topic names which would be denoted with a / infront like this: /robot1/odom <--- Thats the format of the topic name

Hopefully this answers your question

edit flag offensive delete link more


But as stated in the question,I am working on a multi-robot simulation with a common map while the simulated robots have their seperate odom and base_link frames.So, using a namespace and tf_pref allows me to distinguish between the frames of two robots.Hence,using /map allows me to use tf_prefix.

Hemu gravatar image Hemu  ( 2014-12-02 12:17:17 -0600 )edit

Then, just use /map for the map frames.

dornhege gravatar image dornhege  ( 2014-12-03 04:25:52 -0600 )edit

That's what I did and it worked even when I set a different tf_prefix for each robot. However, using "map" with tf_prefix created two distinct frames /robot_1/map and /robot_2/map for each robot.

Hemu gravatar image Hemu  ( 2014-12-03 05:07:43 -0600 )edit

Question Tools

1 follower


Asked: 2014-12-02 01:07:22 -0600

Seen: 534 times

Last updated: Dec 02 '14