Ask Your Question
0

Does tf.lookupTransform (python) take time to fire up?

asked 2015-04-22 00:49:13 -0500

Stephane Caron gravatar image

Hi there,

I have an issue I don't understand with tf in Python. Consider this code:

import rospy, tf
rospy.init_node('test')
l = tf.TransformListener()
# rospy.sleep(0.5)
# l.waitForTransform('BODY', 'manipulation_marker', rospy.Time(0), rospy.Time(10))
print l.lookupTransform('BODY', 'manipulation_marker', rospy.Time(0))

When I run it, I get a LookupException:

LookupException: "BODY" passed to lookupTransform argument target_frame does not exist.

But if I uncomment the sleep() before the lookupTransform, it works fine.

So, I was thinking I could use the waitForTransform() function to replace this sleep() and get the transform as soon as it is available. (Next commented line.) But it doesn't work either and I get a generic Exception() with no error message!

To give you more information about my TF, here is the output from tf_monitor:

RESULTS: for BODY to manipulation_marker
Chain is: * -> * -> * -> BODY
Net delay     avg = 0.0424558: max = 0.0998758

All Broadcasters:
Node: unknown_publisher 111.186 Hz, Average Delay: -0.221831 Max Delay: 0.0471964

What should I do here to get the transform as soon as it is available?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-04-22 02:05:06 -0500

tfoote gravatar image

Using waitForTransform is the right approach. There's an open ticket at the moment I think you're encountering. https://github.com/ros/geometry_exper...

edit flag offensive delete link more

Comments

Thanks, I will follow this.

Stephane Caron gravatar image Stephane Caron  ( 2015-04-24 18:08:06 -0500 )edit

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: 2015-04-22 00:49:13 -0500

Seen: 419 times

Last updated: Apr 22 '15