tf extrapolation exception using ros::Time(0)
I'm trying to get the latest transform between two frames. What's wrong with this code?
listener.waitForTransform(target_frame, source_frame, ros::Time(0),ros::Duration(.1));
tf::StampedTransform st;
listener.lookupTransform(target_frame, source_frame, ros::Time(0), st);
terminate called after throwing an instance of 'tf::ExtrapolationException'
what(): Lookup would require extrapolation into the future. Requested time 1341794988.800442521 but the latest data is at time 1341794988.782343800, when looking up transform from frame [/openni_rgb_optical_frame] to frame [/base_footprint]
EDIT: I got this error while playing back a bag file. When I set the parameter use_sim_time true, the error disappeared. I'm still mystified, though.