0
$\begingroup$

Rosanswers logo

I have been following the tutorials of tf2 on ROS here. There are two tutorials on writing a tf2 static broadcast and a tf2 broadcast. I implemented and understood most part of it. But I am having a hard time distinguishing between the two in terms of logic. I want to know how are the two different and where to use which one?

Thanks.


Originally posted by harrykarwasra on ROS Answers with karma: 23 on 2019-06-06

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Static transforms are transforms that are assumed not to change -- or very infrequently.

Because of that, they don't need to be periodically broadcasted. At the implementation level, this means static transform broadcasters can make use of topic latching, greatly reducing required message traffic on the TF topics.

For transforms that do change, this is not suitable, so that's where a regular TF broadcaster comes in.

If you look at the two tutorials you mention, you'll see that the static broadcaster essentially calls sendTransform(..) once and then the programs hangs in the ros::spin().

The non-static broadcaster calls sendTransform(..) at the end of the poseCallback(..), which is called for every incoming turtlesim::Pose message. This essentially means that sendTransform(..) will be called at a specific rate, which would make sense as the transform needs to be updated for every new pose.

Finally: regular broadcasters publish to /tf, while static broadcasters publish to /tf_static.


Originally posted by gvdhoorn with karma: 86574 on 2019-06-06

This answer was ACCEPTED on the original site

Post score: 8

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.