0
$\begingroup$

Rosanswers logo

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 http://s11.postimage.org/s392awkgz/frames.png


Originally posted by Aslund on ROS Answers with karma: 289 on 2012-08-09

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by dornhege with karma: 31395 on 2012-08-09

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by Aslund on 2012-08-09:
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..

Comment by Aslund on 2012-08-09:
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 :)

Comment by dornhege on 2012-08-10:
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.

Comment by user1928 on 2022-06-30:
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!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.