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

Where to set transform tolerance of base_link -> map transform

asked 2018-11-20 02:22:42 -0500

sberg gravatar image

updated 2018-11-20 03:13:18 -0500


We are working with ROS doing SLAM navigation and most of the time it works great. However on about 30% of the startups we will get the error

[ WARN] [1542701239.688534922]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: Lookup would require extrapolation into the past.  Requested time 1542701227.313686000 but the earliest data is at time 1542701229.716825290, when looking up transform from frame [base_link] to frame [map]. canTransform returned after 0.1008 timeout was 0.1.

Since this is so close to the actual time window we just want to ignore this by changing the tolerance of this specific transform however we can't find where it is defined. (The exact missmatch in the transform will vary slightly between messages but always in the same neighborhood.)

Where in the configuration files can we change this? This is driving us insane since it means we need to stop out work and restart both the robot and the laptop in order to fix it.

Thanks in advance

Edit 1: added our costmap config This is running Gmapping together with navigation stack.

obstacle_range: 6.0 
raytrace_range: 8.5
footprint: [[0.3, -0.3],[-0.2, -0.3],[-0.2 ,0.3],[0.3,0.3],[0.4, 0]]
map_topic: map
subscribe_to_updates: true
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser_frame, data_type: LaserScan, topic: scan, marking: true, clearing: true}
global_frame: map
robot_base_frame: base_link
transform_tolerance: 1.0
always_send_full_costmap: true

This does not seem to affect the transform tolerance that we want to change, the rest of the parameters are read correctly.

edit retag flag offensive close merge delete


It would probably help if you could tell us which packages you are using. "SLAM" is a generic term.

Also: most of these things are run periodically, so a single WARN should not mean you'd have to restart everything.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-20 02:35:48 -0500 )edit

When it works its will throw these periodically, when it doesn't work it will throw these WARN constantly and never read any data.

sberg gravatar image sberg  ( 2018-11-20 03:13:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-11-20 02:37:59 -0500

pavel92 gravatar image

updated 2018-11-20 06:21:13 -0500

If you are using the navigation stack you can use "transform_tolerance" in costmap_common_params.yaml file. For example:

global_frame: map
robot_base_frame: base_link

transform_tolerance: 1.0

You can always check the husky_navigation for reference.

Also I noticed in the warning:

Requested time 1542701227.313686000 but the earliest data is at time 1542701229.716825290

looks like there is a difference of 2 seconds. Try setting the transform_tolerance to 3 seconds and see if there is any change

edit flag offensive delete link more


Thanks Im gonna go ahead and close this. However im still clueless as to why this problem will only occur sometimes (even after a restart of the robot) but i think that is better asked in a separate question.

sberg gravatar image sberg  ( 2018-11-20 07:16:01 -0500 )edit

Question Tools

1 follower


Asked: 2018-11-20 02:22:42 -0500

Seen: 1,088 times

Last updated: Nov 20 '18