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

TF can't look up transform

asked 2014-05-13 03:00:35 -0500

zsbhaha gravatar image

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 .

edit retag flag offensive close merge delete

Comments

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.

Tom Moore gravatar image Tom Moore  ( 2014-05-13 03:23:55 -0500 )edit

Hi,@Tom Moore ,It ran on a same computer through ssh , I don't think it matters .

zsbhaha gravatar image zsbhaha  ( 2014-05-13 03:30:13 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-05-13 03:04:11 -0500

dornhege gravatar image

Your transform data is just too old. TF needs to remember all transforms over time. The standard buffer size is 10 seconds. You seems to be 4 seconds off.

What is the best solution depends on your application. If the time delay is gonna be similar, you could just increase the buffer size. It seems that your are transforming to /map, which is probably a fixed frame. In that case it might be a good idea to transform to /map as soon as you get the data and store its pose in the /map frame instead.

edit flag offensive delete link more

Comments

1

Hi,@dornhege ,I need to periodically transform to /map .That code is just a piece . How can I change the buffer size ?

zsbhaha gravatar image zsbhaha  ( 2014-05-13 03:23:05 -0500 )edit

Hi, I got the same problem, how can I modify the buffer size? @dornhege@zsbhaha Thanks!

est_CEAR gravatar image est_CEAR  ( 2016-04-04 08:09:27 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-13 03:00:35 -0500

Seen: 2,429 times

Last updated: May 13 '14