Can anyone confirm that the following returns the interpolated transformation from the tf2_ros_buffer_ at the query_stamp?
auto t = tf2_ros_buffer_.lookupTransform(frame_a, frame_b, query_stamp);
And more specifically, is this Cartesian interpolation?
Yes and not exactly, the way that
lookupTransformworks (as part of tf2) is that it performs spherical linear interpolation (SLERP) between the transform right before and the transform right after the query time (see the original TF paper). This is a trick taken from the computer graphics world that facilitates a constant angular speed model.The equation for slerp is below where
q_aandq_bare the quaternions representing the frames,qis the output quaternion,tis the ratio of times, andthetais half of the shortest path angle betweenq_aandq_bGenerally the results are used in Cartesian form though.
You can checkout the source code here (look
lookupTransform,transformTF2ToMsg, and the core TF2 interpolation code here).