# tf interpolation

Hello, I have a question about tf interpolation. if I understand it correctly, tf will interpolate when it is asked for a transform between two published transform values. So If I published tf1 for time 5 and tf2 for time 10 and then ask for transform for time 7, I am going to be returned a transform that is somewhere in between tf2 and tf3.

Question: can I ask tf not to interpolate if the requested timestamp is too far away from a known transform? For example in my example above, can I ask tf to interpolate only if I am within 1s from a given transform. So for example above if I ask for transform at time 7 I don't get anything but if I ask for a transform at time 5.5 or 4.5 I do get it?

Or is there a way to find out what two transforms (along with their timestamps) the interpolation was made?

Originally posted by chukcha2 on ROS Answers with karma: 89 on 2017-05-18

Post score: 3

Comment by lucasw on 2017-05-22:
There could be any number of transforms that bracket an interpolation for a tf tree- you would have to traverse the entire tf path between the two frames and get the before and after tf times for each link- only if there was only a single link between two frames then there would be just one set.

Comment by chukcha2 on 2017-05-22:
Let's assume we only have a single link. I ask tf for a transform for time t and it returns it to me. Is there a way to know that the transform was interpolated? Is there a way to know between which times it was interpolated?

For any given query it can be expected that data is interpolated. The odds of a specific query being exactly at the same timestamp of all the frames in the system is very unlikely in an asynchronous system with ns precision.

The interpolation logic does not have support for limiting the range of interpolation, nor does it have a way to tell you what the neighboring points used are.

Those are features that could be added. However in general the trasforms are expected to be provided in a continuous manner that is fast enough to approximate the natural bandwidth of the system.

Note that there's an implicit limit with the maximum cache size of 10s by default. It cannot interpolate outside of the cache history. Though you run the risk of incurring extrapolation limits based on your system.

Originally posted by tfoote with karma: 58457 on 2017-05-22

This answer was ACCEPTED on the original site

Post score: 2