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

Revision history [back]

As a first debugging step, I'd recommend wrapping your call to lookupTransform in a try-except block. Just like they do in lines 23-26 of the Python tf listener tutorial. After the creation of the listener, it usually takes a few seconds to negotiate all of the connections, and to get the listener to start filling its buffers. I'm guessing that you are seeing your error because you are asking for a transform too soon after the creation of the listener.

Another thing you could do is wait for the transform to become available before requesting a lookup.

As a final note, be aware that even if all of your tf code is functioning properly, just do to the asynchronous nature of ROS, your call to lookupTransform is likely to fail occasionally. This is usually because of timing issues. I always wrap calls to lookupTransform in a try and except block of some sort.

As a first debugging step, I'd recommend wrapping your call to lookupTransform in a try-except block. Just like they do in lines 23-26 of the Python tf listener tutorial. After the creation of the listener, it usually takes a few seconds to negotiate all of the connections, and to get the listener to start filling its buffers. I'm guessing that you are seeing your error because you are asking for a transform too soon after the creation of the listener.

Another thing you could do is wait for the transform to become available before requesting a lookup.

As a final note, be aware that even if all of your tf code is functioning properly, just do due to the asynchronous nature of ROS, your call to lookupTransform is likely to fail occasionally. This is usually because of timing issues. I always wrap calls to lookupTransform in a try and except block of some sort.