Waiting for transform map -> base_footprint: Lookup would require extrapolation into the past. Requested time 0.200000 but the earliest data is at time 166.333000, when looking up transform from frame [base_footprint] to frame [map]
ubuntu:20.04
ros: foxy
error code:
[INFO] [1652683218.003811295] [tf2_echo]: Waiting for transform map -> base_footprint: Lookup would require extrapolation into the past. Requested time 0.200000 but the earliest data is at time 166.333000, when looking up transform from frame [base_footprint] to frame [map]
my tf tree looks looks complete:
This issue resulted in the following error:
[rviz2-6] [INFO] [1652684161.403593755] [rviz2]: Message Filter dropping message: frame 'laser' at time 4.761 for reason 'Unknown'
[octomap_server_node-1] [INFO] [1652684178.619022477] [octomap_server]: Message Filter dropping message: frame 'laser' at time 7.607 for reason 'Unknown'
notes:
I use the slam_toolbox to publish map to odom .
I had used joint_state_publisher and robot_state_publisher in gazebo simulate.
I had used the use_sim_time param of true.
The literal version of the tf tree is as follows:
[INFO] [1652684241.019594565] [view_frames]: Result:tf2_msgs.srv.FrameGraph_Response(frame_yaml="base_footprint: \n parent: 'odom'\n broadcaster: 'default_authority'\n rate: 30.588\n most_recent_transform: 18.302000\n oldest_transform: 17.452000\n buffer_length: 0.850\nodom: \n parent: 'map'\n broadcaster: 'default_authority'\n rate: 1800000.000\n most_recent_transform: 0.200000\n oldest_transform: 0.200000\n buffer_length: 0.000\ncamera: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\nbase_link: \n parent: 'base_footprint'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\ndepth_camera_link: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\nimu_link: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\nlaser: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\nsupport: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\ncamera_depth: \n parent: 'depth_camera_link'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\nf_l_wheel: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 12.579\n most_recent_transform: 18.207000\n oldest_transform: 17.730000\n buffer_length: 0.477\nb_l_wheel: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 12.579\n most_recent_transform: 18.207000\n oldest_transform: 17.730000\n buffer_length: 0.477\nf_r_wheel: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 12.579\n most_recent_transform: 18.207000\n oldest_transform: 17.730000\n buffer_length: 0.477\nb_r_wheel: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 12.579\n most_recent_transform: 18.207000\n oldest_transform: 17.730000\n buffer_length: 0.477\n")
Did you call
waitForTransform()
beforelookupTransform()
? EDIT. Sorry, it was for ROS1 and a deprecatedtf
. Intf2
you should usecanTransform()
with a timeout http://docs.ros.org/en/latest/api/tf2... and https://docs.ros.org/en/foxy/Tutorial...sorry ,I am using the slam_toolbox package and the octomap_server package directly. In gazebo, the official plugin is used directly. Did not write the tf publishing program myself. Can you tell me what to do in this situation? thank you very much
Maybe it is a similar problem like in this issue? https://github.com/cartographer-proje... You didn't add your tf tree to check, I upvoted your question - you can add it now I think
yes,they are similar。So how should I go about adding a tf tree check? By the way,If I now manually issue the command of
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 laser map
for the static coordinate transformation, then the map is detectedCan you add the params files you used? Maybe there is something to fix (especially the local_costmap global frame param or others connected with tf2 transformations). You can see there is a lag on your tree too, between
map
(oldest transform: 0.2),odom
(oldest transform: 17.452) andbase_footprint
(oldest transform 0.0). It's a racing condition. This looks as though some of your nodes are using gazebo sim time while some other are using machine time given the difference between them is so large. Even withuse_sim_time
set to True you should have this code like here after your node handlerok.all files are here.link text and I had used the use_sim_time param.
It sounds like a
use_sim_time
issue. Isrobot_state_publisher
using sim time?yes,robot_state_publisher is using sim_time.