Ask Your Question

tf_static frames not available in lookup_transform

asked 2021-09-10 21:16:41 -0500 gravatar image

updated 2021-09-10 22:08:02 -0500

Running ROS2 Foxy + Ubuntu 20.04

I am using TF2 with Python, rclpy

I created a few /tf_static transforms in my launch file, and I have dynamic frames in /tf. The corresponding kinemaitc chain looks correct when calling

$ ros2 run tf2_tools

$ evince frames.pdf

However, when I call the transform_lookup method (Python) and I pass in the frame names, I get a frame not found exception when I pass the name of a static frame as listed in /tf_static

Are tf_static frames available for access and correct transforming when calling transform_lookup?


This is working intermittantlly. I am running the same code / launch file, and sometimes I get the expected result, where all frames are available, and other times they are not available...

Any thoughts??

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-09-12 02:12:52 -0500

tfoote gravatar image

The lookup shouldn't care about whether the frame is static or not for detecting it. The best way to think of "frame not found" is that the buffer hasn't heard about that frame yet.

Without seeing anything more specific my first guess is that you are not giving your buffer enough time to initialize and connect on all the topics and for the static transform publisher to publish the static frame information. This will cause a race condition which will give you intermittent behavior.

The most common fix for this is to catch the exception and try again on the next cycle, or explicitly give time to initialize the transform buffer. But making your algorithm robust to the occasional transform data failure is strongly recommended if possible. This is a common race condition on startup of a distributed system.

edit flag offensive delete link more

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


Asked: 2021-09-10 21:16:41 -0500

Seen: 109 times

Last updated: Sep 12 '21