tf2::Buffer forgetting transforms? [closed]

asked 2015-08-14 08:38:00 -0500

peci1 gravatar image

I have a tf2::Buffer with cache time set to 60 seconds. I launch my node, wait for 2 seconds after connecting TransformListener to the buffer (to allow it to gather all transforms).

Then I call buffer->canTransform("base_link", "laser", scan_time, ros::Duration(0.1)), and sometimes it ends with Extrapolation exception:

Requested time 1439458371.795563147 but the earliest data is at time 1439458372.276928710

However, I'm pretty sure the transforms are published, I checked it with tf_monitor and it shows a publishing frequency of 1500 Hz between base_link and laser.

What's more, the "earliest time" for this transform grows from time to time after a few seconds (I'd expect it to only grow after 60 seconds, which is the buffer size).

The data come from a bag file played with the --clock option, and /use_sim_time is true.

How could I debug what's going on here?

edit retag flag offensive reopen merge delete

Closed for the following reason Question does not follow our guidelines for questions. Please see: for more details. by peci1
close date 2015-08-18 03:16:31.558382


Ok, I found the cause of this behavior. We subtract a small amount of time of the laser scan time, so that the first scan's time is always earlier than the first TF received at the same moment. And the waiting had no effect, because the old scans got buffered in message queue.

peci1 gravatar image peci1  ( 2015-08-18 03:15:56 -0500 )edit