Error: Lookup would require extrapolation into the past.
Hi,
I seem to be getting the error:
Lookup would require extrapolation into the past. Requested time 1424871421.389785282 but the earliest data is at time 1424871421.599770804, when looking up transform from frame [base_link] to frame [camera_depth_optical_frame] Aborted (core dumped)
Here is my code:
void callback(const sensor_msgs::PointCloud2::ConstPtr& msg)
{
tf::Transform cameraTransform;
cameraTransform.setOrigin( tf::Vector3(0.0, 0.0, 0.0) );
tf::Quaternion q;
q.setRPY(0, 0, 0);
cameraTransform.setRotation(q);
br.sendTransform(tf::StampedTransform(cameraTransform, msg->header.stamp, "xtion_link", "camera_link"));
tf::StampedTransform transform;
if (waitOnTransform == false) {
listener.waitForTransform("camera_depth_optical_frame", "base_link", ros::Time(0), ros::Duration(10.0) );
waitOnTransform = true;
}
listener.lookupTransform("camera_depth_optical_frame", "base_link", ros::Time(0), transform);
pcl_ros::transformPointCloud(*base_link, transform, *msg, *msgOut);
Where camera_depth is the subframe of camera_link and xtion_link the subframe of base_link. So I'm creating the link first between camera_link and xtion_link and then try to get the transform. The problem should be solved by lookUpTransform, but it seems that waitForTransform is not working for some reason.
And when I remove the waitForTransform, I still get the error that Requested time 1424871421.389785282, while it should be 10 seconds later.