tf Lookup extrapolation into the past and future
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
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
\self.robot_link is to swap the line..