Ask Your Question
0

tf2::ExtrapolationException, transforming point clouds from the past using a new transform

asked 2016-05-09 13:21:18 -0500

MWrock gravatar image

I want to put two pointclouds in a single frame that are taken from two different locations. The pointclouds are taken in the /base_link frame (which moves between scans), the position of the marker is determined, and a transform from /base_link to /marker is published. I then want to transform the pointcloud from /base_link to /marker, but the call:

listener->waitForTransform("/marker", (*cloud_msg).header.frame_id, (*cloud_msg).header.stamp , ros::Duration(5.0)); 
listener->transformPointCloud ("/marker", saved_cloud1, localized_cloud1);

throws:

[ INFO] [1462816855.501940141, 1462394890.300726653]: transformingPointCloud
terminate called after throwing an instance of 'tf2::ExtrapolationException'
  what():  Lookup would require extrapolation at time 1462394885.150079987, but only time 1462394885.320931978 is in the buffer, when looking up transform from frame [base_link] to frame [marker]

How do I tell ROS to use a transform published after the pointcloud was assembled?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-05-10 12:11:56 -0500

tbh gravatar image

You can lookup the newest possible transform between two frames with ros::Time(0) instead of (*cloud_msg).header.stamp, as you have above. However, that may not accurately reflect the position of the point cloud if your base has moved.

It looks like you're getting a point cloud from before the first tf is available. This may just be a startup condition that will go away after tfs are published and your node receives them. If that might be the case, you should consider waiting to process the point cloud or catching this exception and doing nothing until you receive some tfs.

edit flag offensive delete link more

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-05-09 13:21:18 -0500

Seen: 175 times

Last updated: May 10 '16