ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Problem with static transform publisher

asked 2020-07-13 09:06:05 -0600

MarkusHHN gravatar image

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

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2020-07-13 09:54:13 -0600

robustify gravatar image

updated 2020-07-13 10:25:47 -0600

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_transfo...

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_tr...

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.

edit flag offensive delete link more

Comments

Is tf2 a ROS2 package, or/and what are the benefits of using it with ROS1?

Dragonslayer gravatar image Dragonslayer  ( 2020-07-13 10:04:18 -0600 )edit

thank you it works!

MarkusHHN gravatar image MarkusHHN  ( 2020-07-13 10:11:20 -0600 )edit
1

tf2 is a major improvement and feature enhancement to tf that has been around since ROS Hydro. The tf2migration 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.

robustify gravatar image robustify  ( 2020-07-13 10:24:39 -0600 )edit
0

answered 2020-07-13 10:00:47 -0600

Dragonslayer gravatar image

Hi, the error discribes the problem, so its about timing.

From the little data you posted it seems base_link --> kinect is the static transform publisher, it only publishes at 10 hz wich is very slow, and much slower as the other relevant ones. Example:

<launch> <node pkg="tf" type="static_transform_publisher" name="kinect_base_link5" args="0 0 0 0 1.57 0 /frame1 /frame2 100"/>
</launch>

The last value "100" is the publish frequency. At 100hz you should be able to get rid of the error.

edit flag offensive delete link more

Comments

I already use 100 Hz on my static_transform_publisher. I use the answer above and it works! Also thank you for your answer and time:

MarkusHHN gravatar image MarkusHHN  ( 2020-07-13 10:13:25 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-07-13 09:06:05 -0600

Seen: 3,178 times

Last updated: Jul 13 '20