tf buffer find nearest in time

asked 2021-11-05 09:46:26 -0500

goksankobe gravatar image

Hi,

Either in tf1 or tf2, I'm looking for a functionality which can return the nearest in time transform information, given a target time point. I am aware that lookupTransform can return either the latest transform available or a transform that is exactly at a given timestamp, but in my setup I do not have a perfect time syncronization between the sensor data and odometry data, but still I would like to be able to get the best possible match between these 2.

Thanks!

edit retag flag offensive close merge delete

Comments

I am aware that lookupTransform can return either the latest transform available or a transform that is exactly at a given timestamp

you missed one option there: TF interpolates. So if there is no transform at the exact time you specify, you will get the interpolated version between the two nearest transforms.

I'm not sure what you want to do would be necessary.

gvdhoorn gravatar image gvdhoorn  ( 2021-11-05 10:35:26 -0500 )edit

Is this the default behavior? Or needs to be enabled explicitly? What I'm currently observing is that, tf_listener.waitForTransform never returns for the odometry timestamp that I request, within my sensor callback function.

goksankobe gravatar image goksankobe  ( 2021-11-05 10:51:45 -0500 )edit