Ask Your Question
0

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

Comments

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 imagegvdhoorn ( 2016-11-27 07:00:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

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

Comments

1

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 imagetfoote ( 2016-11-27 12:22:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 646 times

Last updated: Nov 27 '16