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

Problems with TF using the navigation stack

asked 2012-08-09 06:26:17 -0500

Aslund gravatar image

updated 2012-08-09 08:00:13 -0500

Lorenz gravatar image

Hey everyone

To better understand my question I will provide some background information. I am running a mobile robot in Stage (simulation). The "problem" with this approach is that my odometry information is ideal and I want some error introduced to evaluate the navigation stack. I have therefore created a node which sends out a frame called "odom_error" which represents the erroneous odometry.
Basically the "odom_error" frame only contains the deviation and have "odom" as parent, the ideal odometry.

broadcaster.sendTransform(

    tf::StampedTransform(  

    tf::Transform(
        tf::createQuaternionFromRPY(0.0, 0.0, phi), tf::Vector3(x, y, 0.0) 
    ), ros::Time::now(), "odom", "odom_error"
    )
);

Here x, y and phi is my deviation.

There is thereby a link between the frames "odom_error" and "odom", but somehow the navigation stack is unable to detect this shown in the image below. I tell the AMCL node to use odom_error as source for odometry information, but when doing so the costmaps are unable to detect the connection between /map and /base_link. I get the following error:
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
But when I execute "rosrun tf tf_echo /odom /odom_error" I am able to detect a connection. Does anyone have any idea on how to fix this problem? It is pretty critical as my deadline is quite close. If there is something that does not make sense just ask and I will try to provide more information.

Comparision

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
4

answered 2012-08-09 06:42:59 -0500

dornhege gravatar image

I guess you have it the wrong way around.

Odometry provides the transform /odom -> /base_link. As I understand your post, you produce /odom -> /odom_error, which gives two different tree branches.

You might want to do /odom_error -> /odom and then set /odom_error as the odom frame in the localization. I don't know if the algorithms require the actual Odometry message, though.

edit flag offensive delete link more

Comments

Hey dornhege. I might misinterpret how TF works. Your solution works but I do not exactly understand why, but I think I get it some how. I defined the /odom frame according to /odom_error. Stage then defines /odom according to the environment it works in. So in the end /odom still will represent..

Aslund gravatar image Aslund  ( 2012-08-09 11:00:20 -0500 )edit

the grouth truth position and /odom_error represents the disparity/error in the odometry. Everything is the same in the end, just a different angle to the problem than what I thought of. Thanks for the help, saved me a long night without sleep :)

Aslund gravatar image Aslund  ( 2012-08-09 11:01:57 -0500 )edit

The /map -> /odom -> /base_link chain is not that intuitive, because it needs to be a china. This REP: http://www.ros.org/reps/rep-0105.html explains the details.

dornhege gravatar image dornhege  ( 2012-08-10 02:49:26 -0500 )edit

Hello @dornhege, I know it has been really long but would really help if you answer this question: Which part of the REP-105 did you refer to? This part suggests using /map -> /odom -> /base_link chain itself.

Thanks for your time!

user1928 gravatar image user1928  ( 2022-06-30 02:36:17 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2012-08-09 06:26:17 -0500

Seen: 1,648 times

Last updated: Aug 09 '12