map stamp error

asked 2019-05-20 19:56:26 -0500

crank gravatar image

updated 2019-05-20 21:50:46 -0500

jayess gravatar image

When I use gmapping for save my map , I can alway see the error in tf, so I check my tf tree, it's right, but when I run rosrun tf tf_echo /map /base_link,there show

Failure at 1558399180.795866256
Exception thrown:Lookup would require extrapolation into the past. Requested time 40.363000000 but the earliest data is at time 1558399175.095931223, when looking up transform from frame [base_link] to frame [map]

so I echo map and base_link and find that map's stamp is:

seq: 0
secs: 1558398434
nsecs: 917620709
frame_id: "map"

But my odom and base_link and other link are all transfome to secs, just as follow:

seq: 1865
secs: 37
nsecs: 657000000
frame_id: "odom"
child_frame_id: "base_link"

So how can I do , can you give me some advice? Thank you for your help!

edit retag flag offensive close merge delete


Are you using Gazebo, or some other simulator?

gvdhoorn gravatar image gvdhoorn  ( 2019-05-21 03:05:54 -0500 )edit

Yes,I use gazebo, but my simu time is true,I just use rosbag to record my robot, then play bag and show in rviz, and if I launch my robot simu and gmaping all, I won't see the error in rviz and tf, can you tell me how to aviod this error? Thank you!

crank gravatar image crank  ( 2019-05-21 20:20:57 -0500 )edit

Some of your nodes are not using simulation time. That is the problem here. I can't tell you which ones are the problem. Which one is publishing the map transform?

gvdhoorn gravatar image gvdhoorn  ( 2019-05-22 01:36:46 -0500 )edit

I load my model in gazebo and set parms for it, also it can calculated the odom, when I use rosbag, it record the odom->baselink msg, also laser msg, Then I play the bag and gmapping node, that's all what I do.

crank gravatar image crank  ( 2019-05-22 01:59:37 -0500 )edit