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

Waiting on transform from /base_link to /map?

asked 2011-07-29 02:43:54 -0600

sam gravatar image

updated 2011-07-29 02:49:43 -0600


says "map --> odom --> base_link"

and "Although intuition would say that both map and odom should be attached to base_link, this is not allowed because each frame can only have one parent."

In tf src,I have built two connections

    tf::Transform(tf::Quaternion(0,0,0, 1), tf::Vector3(0, 0, 0)),
    ros::Time::now(),"base_link", "base_laser")

    tf::Transform(tf::Quaternion(0,0,0, 1), tf::Vector3(20, 0, 0)),
    ros::Time::now(),"base_link", "odom")

If I write map->odom,it will says contain a loop.I don't know why.

    tf::Transform(tf::Quaternion(0,0,0, 1), tf::Vector3(0, 0, 0)),
    ros::Time::now(),"odom", "map")

My robot.launch says

  [ WARN] [1311950065.207360272]: Waiting on transform from /base_link to /map to become available before running costmap, tf error: Could not find a connection between '/map' and '/base_link' because they are not part of the same tree.Tf has two or more unconnected trees.
  1. What happened to base_link with two parents?
  2. Why map->odom will contain a loop?
  3. How to fix all the problems? Thank you~
edit retag flag offensive close merge delete


The output of `rosrun tf view_frames` can be very helpful for debugging this type of problem. I suggest you run it while everything is running and attach the PDF here.
Eric Perko gravatar image Eric Perko  ( 2011-07-29 03:20:14 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-07-29 09:44:01 -0600

dornhege gravatar image

You are broadcasting those code-sniplets (for testing!), right?

You have to build a tree, or in this case a line as: map -> odom -> base_link -> base_laser

If you look at the code sniplets you have posted, you can see, that you interchanged parent and child a bid.

You also have to continuously publish all transforms and later on obviously with real data. If that doesn't help follow the comment by Eric Perko.

edit flag offensive delete link more


Yeah,it's only for testing. And I am not really understand that what's the difference between "map->odom" and "odom->map"?
sam gravatar image sam  ( 2011-07-30 01:54:10 -0600 )edit

answered 2011-07-31 05:31:25 -0600

The difference between "map->odom" and "odom->map" is who is the parent and who the child in the tf tree.

In the example code that you posted you're publishing base_link as parent of base_laser and odom, and then map as parent of odom. Map and base_link cannot both be parents of odom. The error that you reported usually happens when two parents of the same node are being published, resulting is an unconnected tree. I suggest you to visualize your tf tree using "rosrun tf view_frames" as Eric says.

It could be helpful to know which nodes are you running, because other nodes could be broadcasting tf transforms.

edit flag offensive delete link more


Sorry for the unclear question before. My question is if my program only have one transform between map and odom, the difference between "map->odom" and "odom->map" is the only value difference of positive sign or negative sign,right?
sam gravatar image sam  ( 2011-07-31 15:42:00 -0600 )edit
No, since TF is not only about vectors but also about rotations. It's essentially the inverse transformation. The tree on a robot is defined by the links on the robot and you cannot interchange child and parent nodes randomly. Did you have a look at the tf tutorial videos on
Lorenz gravatar image Lorenz  ( 2011-07-31 23:15:49 -0600 )edit
Yes,what I think is if "map -> odom -> base_link -> base_laser" is correct,can I change it to "base_laser -> base_link -> odom -> map" by the inversion you said and get the totally same result?
sam gravatar image sam  ( 2011-08-01 00:59:31 -0600 )edit
For such a degenerated tree it should work, but breaks the conventions. As soon as you have a robot with more than one sensor it will not work so easily anymore because you need a proper tree then where /map or some other fixed frame is the root.
Lorenz gravatar image Lorenz  ( 2011-08-01 01:03:30 -0600 )edit

Question Tools


Asked: 2011-07-29 02:43:54 -0600

Seen: 6,040 times

Last updated: Jul 31 '11