0
$\begingroup$

Rosanswers logo

I am trying to transform a point from a base_link frame to camera frame. When run the below code getting error message "Exception: Lookup would require extrapolation into the future. canTransform returned after 4.003 timeout was 4.Requested time 1466110388.818536997 but the latest data is at time 3101.240000000, when looking up transform from frame [base_link] to frame [wide_stereo_optical_frame]. target = "wide_stereo_optical_frame";
point = PointStamped()
point.point.x =2;
point.point.y = 1;
point.point.z = 1;
point.header.frame_id = "base_link";
point.header.stamp = rospy.Time.now();
tl_ = tf.TransformListener();
tl_.waitForTransform(target, point.header.frame_id, rospy.Time.now(), rospy.Duration(5.0));
camera_target = tf.transformPoint(target, point)

botf base_link and wide_stereo_optical_frame frames are available in tf database. I verified the in the terminal like this
rosrun tf tf_echo /base_link /wide_stereo_optical_frame


Originally posted by anilmullapudi on ROS Answers with karma: 75 on 2016-06-16

Post score: 0


Original comments

Comment by tfoote on 2016-06-16:
Is this still a problem after you resolved: http://answers.ros.org/question/237248/why-rospy-time-always-prining-zero/

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The problem is solved after referring to this link. The workaround is, I used a sleep function after tfObject creation.

tl_ = tf.TransformListener();
rospy.sleep(10.)
# The above sleep function gives the sufficient time to load frames from /tf topic


Originally posted by anilmullapudi with karma: 75 on 2016-06-17

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Pablo Iñigo Blasco on 2016-06-20:
Did you have to wait 10 second to catch your tf transform? That is weird in most of the applications, but ok..

Comment by anilmullapudi on 2016-06-29:
I tried running my node in a faster computer. It's working fine now without sleep()

Comment by db on 2017-11-23:
I'm having the exact same problem, but this did not work :/

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.