TF error: transform require extrapolation
I know this is a common question. I look into several questions with this kind of error but I couldn't solve it.
I have a static publisher, let's say rosrun tf static_transform_publisher 0 0 0 0 0 0 map odom 100
. I did this one by hand because I'm simulating and I want to process the data as in the real robot.
So, as it is expected, the command rosrun tf tf_monitor map odom
gives me the following:
RESULTS: for map to odom
Chain is: map -> odom
Net delay avg = -0.0230723: max = 0.000498073
Frames:
All Broadcasters:
Node: unknown_publisher 110.102 Hz, Average Delay: 0.00254529 Max Delay: 0.0273563
Then the description of the important part of the tf tree.
The important part of the code is the following:
try{
tf_l.waitForTransform(map.header.frame_id, pt.header.frame_id, ros::Time(0), ros::Duration(1));
tf_l.transformPose(map.header.frame_id, pt, new_pt);
}
catch (tf::TransformException ex){
ROS_ERROR("%s",ex.what());
}
And the error is:
Lookup would require extrapolation at time 1456532769.590685931, but only time 1456532769.972357224 is in the buffer, when looking up transform from frame [odom] to frame [map]
For the code, I've used ros::Time(0)
, ros::Time::now()
and map.header.stamp
. None of the options is working. I would like to understand why.
I've been hours trying to solve it. I don't know, so I send you all the information that I have about the transformations. Any Ideas? Thanks!
UPDATE
I solved it with:
map.header.stamp = pt.header.stamp = ros::Time(0);
Nonetheless, it's far from being a correct way to do it. Can somebody explain? Thanks