Ask Your Question
1

Difference between two transform broadcasters

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

Hemu gravatar image

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

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
3

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

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

Comments

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 imageHemu ( 2014-12-02 06:44:22 -0500 )edit
1

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

dornhege gravatar imagedornhege ( 2014-12-02 10:18:48 -0500 )edit

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

Hemu gravatar imageHemu ( 2014-12-02 12:17:32 -0500 )edit
0

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

l0g1x gravatar image

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

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 /

EDIT 1:

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

Comments

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 imageHemu ( 2014-12-02 12:17:17 -0500 )edit
1

Then, just use /map for the map frames.

dornhege gravatar imagedornhege ( 2014-12-03 04:25:52 -0500 )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 imageHemu ( 2014-12-03 05:07:43 -0500 )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

1 follower

Stats

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

Seen: 200 times

Last updated: Dec 02 '14