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

amcl does not publish transforms to "future"

asked 2016-09-07 12:19:10 -0500

zkytony gravatar image

I am using rosbag to playback a bag file with messages from /tf, /scan, and /initialpose. I am trying to use amcl to localize the robot within that bag. I have set use_sim_time to be true.

The problem now is that the localization is not working properly: Even though tf messages indicate that the robot should be moving around, the localization from amcl is almost fixed around initial pose. I ran rqt_tf_tree (see below) and see that the timestamp of tf transforms from /map to /odom is less than the one from /odom to /base_footprint. I've tested several times, and it's always like this. According to amcl documentation, amcl publishes future dated transforms. So I believe if I fix the timestamp issue, amcl will work properly.

image description

Does anyone have any idea why amcl is not publishing future dated transforms? How to force it to do so?

Additionally, here is an image with RVIZ showing the TF transforms. The problem is that, /odom is not fixed, but /base_footprint seems to be fixed. image description

I appreciate your help.

edit retag flag offensive close merge delete

Comments

What if you take amcl out of the picture (just for debugging purposes) ? Try playing back the bagfile and, in RViz, set the Fixed Frame to odom. Does the base_link move now? Do the LaserScan messages make sense?

spmaniato gravatar image spmaniato  ( 2016-09-07 13:28:42 -0500 )edit
1

Yes. It moves. As expected, odom frame drifts over time, so the path taken by the robot is not aligned with the map. LaserScan messages make sense as well.

zkytony gravatar image zkytony  ( 2016-09-07 13:43:46 -0500 )edit

Are you publishing clock? rosbag play <file.bag> --clock ?

spmaniato gravatar image spmaniato  ( 2016-09-07 14:06:29 -0500 )edit
1

Well, I published to /clock in the bag file. I didn't run rosbag play with --clock argument. I just tried, but it didn't work either. Particles were just being recomputed again and again at the initial pose.

zkytony gravatar image zkytony  ( 2016-09-07 14:09:32 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-09-07 14:49:34 -0500

zkytony gravatar image

This is my solution to this situation but not this problem. I switched to gmapping to obtain the robot's poses, and it works like a charm.

edit flag offensive delete link more

Comments

I still would like to use AMCL because I need to reuse the map that I generated for other simulations.

zkytony gravatar image zkytony  ( 2016-09-29 10:45:02 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-09-07 12:19:10 -0500

Seen: 767 times

Last updated: Sep 07 '16