Ask Your Question
0

tf Lookup extrapolation into the past and future

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

Chao Chen gravatar image

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

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 imageAbhishekpg ( 2019-12-21 00:07:54 -0600 )edit

\self.robot_link is to swap the line..

Chao Chen gravatar imageChao Chen ( 2019-12-21 13:02:35 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 24 times

Last updated: Jan 09