amcl does not publish transforms to "future"
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.
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.
I appreciate your help.
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 toodom
. Does thebase_link
move now? Do theLaserScan
messages make sense?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.Are you publishing clock?
rosbag play <file.bag> --clock
?Well, I published to
/clock
in the bag file. I didn't runrosbag 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.