tf2::ExtrapolationException, transforming point clouds from the past using a new transform
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?