Lookup would require extrapolation into the past but rqt shows required time is in range.
ubuntu16.04
tf usage
error message:
Lookup would require extrapolation into the past. Requested time 1572576373.995487268 but the earliest data is at time 1572576374.014772881, when looking up transform from frame [base_footprint] to frame [odom]
rqt show:
code is here:
void getTF(const string parent_frame,
const string child_frame,
const ros::Time time_stamp,
tf::StampedTransform& transform){
static tf::TransformListener tf_listener;
try{
tf_listener.waitForTransform(parent_frame, child_frame, time_stamp, ros::Duration(1.0));
tf_listener.lookupTransform(parent_frame, child_frame, time_stamp, transform);
}catch(tf::TransformException ex){
ROS_ERROR("%s",ex.what());
//ros::Duration(1.0).sleep();
}
}
Question:
rqt shows transformation time snapshot between odom and base_footprint is [1572576373.99, 1572576379.38], the required time 1572576373.995487268 should be valid; besides, error message shows the earliest data is at time 1572576374.014772881, why not 1572576373.99 ?
Asked by pan on 2019-11-06 22:59:29 UTC
Answers
I had similar error, and solved it by changing the rates of tf's.
You have 2 transforms at 10000 and one at 50hz. I would try changing those.
Best, Can
Asked by wintermute on 2019-11-07 02:31:37 UTC
Comments
base_footprint --> laser_front
is tf_static publishded by robot_state_publisher
. map --> odom
depends on matching result. what confused me mostly is that the earliest data is at time 1572576374.014772881 instead of 1572576373.99.
Asked by pan on 2019-11-07 21:05:16 UTC
it could be also me a mismatch of clocks of sensors. Are your messages provided from sensors have their timestamps, or are you stamping them on arrival? I am having similar errors from time to time, which are eliminated with a reset of boards.
Asked by wintermute on 2019-11-08 02:15:04 UTC
yes, messages have their timestamps from their ros wrapper package respectively. I just recorded a rosbag and played it.
Asked by pan on 2019-11-11 02:11:40 UTC
Comments
Please do not post screenshots of code. There is no need: it's all text. Copy-paste it into your question and format it properly using the Preformatted Text button (the one with
101010
on it).Please also review the support guidelines, specifically the sections about not posting screenshots.
Asked by gvdhoorn on 2019-11-07 03:12:36 UTC