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

pcl_ros / tf : how to use latest transform instead of waiting ?

asked 2016-11-27 05:09:52 -0600

vincent78 gravatar image

updated 2016-11-27 13:25:06 -0600

When calling "pcl_ros::transformPointCloud" I get the error:

[ERROR] [1480244411.676958769, 1224.030000000]: Lookup would require extrapolation into the future.  Requested time 1224.022000000 but the latest data is at time 1224.021000000, when looking up transform from frame [base_laser_link] to frame [odom]

I know this could be solved by calling "waitForTransform", but in this specific case speed is more important than precision. So I would like to use the latest available transform, even if a little off, rather than wait for the more suitable one. I.e. in the example above it would use the tf at 1225.021.

Any way to do this ?

edit retag flag offensive close merge delete


May I suggest a title fix? Your question is really about how to transform a PointCloud using the latest transform available. That uses TF, but is specific to pcl_ros. Would be good to mention that in the question itself.

gvdhoorn gravatar image gvdhoorn  ( 2016-11-27 07:00:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-11-27 06:57:02 -0600

gvdhoorn gravatar image

updated 2016-11-27 06:59:10 -0600

Use ros::Time(0) instead of the actual timestamp. In pcl_ros, that is probably possible with the pcl_ros::transformPointCloud(.., const ros::Time &target_time, ..) overload.

See also the Learning about tf and time (C++)) tutorial and the TF docs for lookupTransform() (here in tf2_ros::BufferInterface fi).

edit flag offensive delete link more



This is the answer to your question. However I would suggest that you review your assumption that waiting the approximately 1 millisecond for the correct data to come in is worse than using incorrect data. And to do approximation correctly there are a lot more corner cases that need to be handled.

tfoote gravatar image tfoote  ( 2016-11-27 12:22:12 -0600 )edit

Question Tools

1 follower


Asked: 2016-11-27 05:09:52 -0600

Seen: 1,299 times

Last updated: Nov 27 '16