ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

tf Lookup extrapolation into the past and future

asked 2019-12-20 17:32:25 -0500

Chao Chen gravatar image

updated 2019-12-21 12:41:31 -0500

jayess gravatar image

Code

listener = tf.TransformListener()
        listener.waitForTransform(self.robot_link, target_link, rospy.Time(), rospy.Duration(0.2)) 
        (trans, rot) = self.listener.lookupTransform(\
               self.robot_link, target_link, rospy.Time(0))

I added the listener . However, the error still exists.

listener = tf.TransformListener()
        # listener.waitForTransform(self.robot_link, target_link, rospy.Time(), rospy.Duration(0.2)) 
        # (trans, rot) = self.listener.lookupTransform(\
        #         self.robot_link, target_link, rospy.Time(0))

[ERROR] [1576884188.584635]: Error processing request: Lookup would require extrapolation into the past.  Requested time 1576884160.863920689 but the earliest data is at time 1576884184.773631096, when looking up transform from frame [tool/flashlight_pickup_link] to frame [base_link]

If I change my code to

now = rospy.Time.now()
listener.waitForTransform(self.robot_link, target_link, now, rospy.Duration(4.0))
(trans,rot) = listener.lookupTransform(self.robot_link, target_link, now)

The error will be

Lookup would require extrapolation into the future.  Requested time 1576884523.732362032 but the latest data is at time 1576884500.023826838
edit retag flag offensive close merge delete

Comments

Try rospy.Duration(1). Also in first case in waitfortransform you gave self.robot_link, but in lookuptranform you used;\self.robot_link. change both to be same

Abhishekpg gravatar image Abhishekpg  ( 2019-12-21 00:07:54 -0500 )edit

\self.robot_link is to swap the line..

Chao Chen gravatar image Chao Chen  ( 2019-12-21 13:02:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-01-09 15:34:34 -0500

Chao Chen gravatar image

Problem solved. You need to synchronize the time on your laptop with the platform you are using.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-12-20 17:32:25 -0500

Seen: 494 times

Last updated: Jan 09 '20