map stamp error
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:
header:
seq: 0
stamp:
secs: 1558398434
nsecs: 917620709
frame_id: "map"
But my odom and base_link and other link are all transfome to secs, just as follow:
header:
seq: 1865
stamp:
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!
Are you using Gazebo, or some other simulator?
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!
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?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.