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

Revision history [back]

click to hide/show revision 1
initial version

Hi, the two examples are indeed very similar: In the first the node subscribes to to a topic and dynamically updates the published tf according to the read pose, while the second periodically publishes the same transformation using a timer.

The second example could actually be a bit misleading, if you want to publish a fixed transformation that never changes, you should use a static transform broadcaster:

https://docs.ros.org/en/humble/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.html

This will publish on the "latched" /tf_static topic instead of /tf, meaning that new subscribers will get the last published message without the need of continuously publishing it.