0
$\begingroup$

Rosanswers logo

I was publishing a frame using launch file.

I was getting below errors. tf2.waitForTransform(src_fram, des_frame, rospy.get_rostime(), rospy.Duration(10.0)); Exception: Lookup would require extrapolation into the future. Requested time 1468340743.794792891 but the latest data is at time 2117.120000000, when looking up transform from frame [bed_frame] to frame [wide_stereo_optical_frame]. canTransform returned after 10.0004 timeout was 10.

I have used all time combinations such as rspy.Time(), rospy.get_rostime(), and rospy.Time.now(). but no luck. i also used sleep function for 10 seconds before waitForTransform, this is also not worked

here is my code

def getTransformedPoint(faceCoordinate, src_fram, des_frame):
point = PointStamped()
point.point.x = faceCoordinate[0];
point.point.y = faceCoordinate[1];
point.point.z = faceCoordinate[2];
point.header.frame_id = src_fram;
point.header.stamp = rospy.Time();
print "rospy.Time(): ",point.header.stamp;
print "rospy.get_rostime(): ",rospy.get_rostime();
print "rospy.Time.now(): ", rospy.Time.now();

tf2.waitForTransform(src_fram, des_frame, rospy.Time(), rospy.Duration(10.0));

desired_frame = tf2.transformPoint(des_frame, point)
print desired_frame

Originally posted by anilmullapudi on ROS Answers with karma: 75 on 2016-07-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The above code is working after setting simulation time to true in the launch file.


Originally posted by anilmullapudi with karma: 75 on 2016-07-12

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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