TF can't look up transform
Hello, all
I wrote a tf
listener,and I need the transform between /map
and /goal_in_picture
. I'm also wrote a node broadcasting transform from /base_link
to /goal_in_picture
. The rest of tf
provided by navigation stack. The TF tree like this:
`map` ----->`odom` ----->`base_link`------>`base_laser`
|------>`goal_in_picture`
Here is code aiming to look up transform from /map
to /goal_in_picture
:
listener.waitForTransform("/goal_in_picture","/map",rospy.Time.now(),rospy.Duration(5.0))
...(wihle loop)
try:
now = rospy.Time.now()
listener.waitForTransform("/goal_in_picture","/map",now,rospy.Duration(1.0))
trans,rot = listener.lookupTransform("/goal_in_picture","/map",now)
except (tf.LookupException, tf.ConnectivityException,tf.Exception):
rospy.loginfo("tf tree error!")
but when preforming the first line , it throw a exception :
tf.Exception: Lookup would require extrapolation into past....
Also I ran tf command in terminal:
rosrun tf tf_echo /map /goal_in_picture
It show me these message:
Failure at 1399971930.470803359
Exception thrown:Lookup would require extrapolation into the past. Requested time 1399971930.383213043 but the earliest data is at time 1399971934.658835312, when looking up transform from frame [goal_in_picture] to frame [map]
The current list of frames is:
Frame base_link exists with parent odom.
Frame odom exists with parent map.
Frame base_laser exists with parent base_link.
Frame goal_in_picture exists with parent base_link.
...
At time 1399971934.778
- Translation: [0.803, -1.122, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.424, 0.906]
in RPY [0.000, 0.000, -0.876]
Any idea ? Thanks in advance .
Is the node that's publishing the transform on the same computer as the node listening for the transform? If you requested the transform at rospy.Time.now() but the earliest data is 4 seconds later, then it could indicate a clock synchronization issue.
Hi,@Tom Moore ,It ran on a same computer through ssh , I don't think it matters .