Ask Your Question
0

Waiting on transform from /base_link to /map?

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

sam gravatar image

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

In http://www.ros.org/reps/rep-0105.html

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

Comments

1
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 imageEric Perko ( 2011-07-29 03:20:14 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
3

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

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

Comments

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 imagesam ( 2011-07-30 01:54:10 -0500 )edit
2

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

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

Comments

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 imagesam ( 2011-07-31 15:42:00 -0500 )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 ros.org/wiki/tf?
Lorenz gravatar imageLorenz ( 2011-07-31 23:15:49 -0500 )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 imagesam ( 2011-08-01 00:59:31 -0500 )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 imageLorenz ( 2011-08-01 01:03:30 -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

Stats

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

Seen: 4,035 times

Last updated: Jul 31 '11