Ask Your Question
0

What is the difference between a tf2 static broadcast and tf2 broadcast?

asked 2019-06-06 02:54:50 -0500

harrykarwasra gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-06-06 03:01:28 -0500

gvdhoorn gravatar image

updated 2019-06-06 03:04:33 -0500

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.

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

Stats

Asked: 2019-06-06 02:54:50 -0500

Seen: 97 times

Last updated: Jun 06