0
$\begingroup$

Rosanswers logo

Hello,

i have a Microsoft Kinect sensor and i am using the freenect driver to use it, Then I transform my pointcloud to a laserscan and show it on my base_link frame. I get the following error:

Transform failure: Lookup would require extrapolation into the past. Requested time 1594648338.669846591 but the earliest data is at time 1594648338.900337345, when looking up transform from frame [kinect_depth_optical_frame] to frame [base_link]

image description

On the Image you can see the current Transformation tree. When you need some information than please tell me.

Regards, markus


Originally posted by MarkusHHN on ROS Answers with karma: 54 on 2020-07-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Looking at your rqt_tf_tree, I assume the /base2kinect node that is publishing the transform is a static_transform_publisher from the tf library:

http://wiki.ros.org/tf#static_transform_publisher

This uses the tf1 library, which requires you to put a publishing period and uses the /tf topic. Instead, use the tf2 version of the static transform publisher:

http://wiki.ros.org/tf2_ros#static_transform_publisher

This works the same as the tf1 version, but doesn't take a publishing period as the final argument, as it uses the new /tf_static topic which is used for fixed frame transformations. Replacing your tf1 static publisher with this tf2 static publisher should solve your time extrapolation error.

EDIT:

Alternatively, you could add the transform from base_link to kinect_link as a fixed joint in your URDF file.


Originally posted by robustify with karma: 956 on 2020-07-13

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by Dragonslayer on 2020-07-13:
Is tf2 a ROS2 package, or/and what are the benefits of using it with ROS1?

Comment by MarkusHHN on 2020-07-13:
thank you it works!

Comment by robustify on 2020-07-13:
tf2 is a major improvement and feature enhancement to tf that has been around since ROS Hydro. The tf2 migration guide has the details: http://wiki.ros.org/tf2/Migration. The /tf_static topic is one of the new features, which avoids these timing issues with fixed transforms. In the rqt_tf_tree, when you see a publish rate of 10000 Hz, this means it is a static transform published on /tf_static.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.