ROS2 lookupTransform() - cannot get transform at time now()
I am having issues acquiring transformation at the required time using lookupTransform()
It works as expected when I use tf2::TimePointZero
(i.e. the last transform) but is failing when I use this->get_clock()->now()
(i.e. transformation at "now").
Code snippet:
transformStamped = tf_buffer_->lookupTransform(
toFrameRel, fromFrameRel,
this->get_clock()->now(),
50ms);
The exception I handle is as follows:
Lookup would require extrapolation into the future. Requested time 1629833266.557150 but the latest data is at time 0.000000, when looking up transform from frame [turtle1] to frame [turtle2]
I actually spawn the turtle2 and definitely it needs some time to broadcast its transform, but the error is always there. Full code is available here: https://github.com/kurshakuz/geometry...
It also seems strange to me that the the latest data is at time 0.000000
is never changing.
Please let me know if you have any ideas.