Misleading fixed frame broadcaster code in tf2 Adding a Frame (C++) tutorial

Open Beginner friendly
#6,792 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Half a day
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cpp

Research direction

Open the affected Jazzy tutorial page, Tutorials/Intermediate/Tf2/Adding-A-Frame-Cpp.html, and inspect its fixed-frame broadcaster example. Replace that example with the static broadcaster approach described in the issue, remove the redundant timer, and preserve the dynamic broadcaster example; the tutorial is done when it clearly distinguishes one-time static publication from periodic dynamic publication.

Written by the indexing model from the issue text.

Description

Issue Type
  • 🐛 Bug / Problem
  • ✏️ Typo / Grammar
  • 📖 Outdated Content
  • 🚀 Enhancement
Generated by Generative AI

No

Distribution

Jazzy

Description

In the official ROS2 intermediate tutorial tf2 Adding a frame (C++), the fixed frame demonstration uses tf2_ros::TransformBroadcaster (dynamic TF broadcaster) plus a 100ms wall timer to repeatedly publish unchanged static coordinate transformation.
This implementation is non-standard and confusing for beginners:

1.Fixed frames with constant relative pose do not require periodic repeated publishing.
2.Using dynamic TF broadcaster to send static transform wastes CPU resources and violates ROS2 TF design rules.
3.Beginners cannot correctly distinguish the usage difference between static TF and dynamic TF after learning this example.

Affected Pages/Sections

https://docs.ros.org/en/jazzy/Tutorials/Intermediate/Tf2/Adding-A-Frame-Cpp.html

Screenshots or Examples (if applicable)

No response

Suggested Fix

Rewrite fixed frame broadcaster code to use standard tf2_ros::StaticTransformBroadcaster.
Delete redundant timer and callback function, send static transform only once in node constructor.
Add clear text distinction in tutorial:

Static fixed frame: use StaticTransformBroadcaster, publish once
Dynamic moving frame: use TransformBroadcaster, publish periodically (100ms is reasonable)

Keep the original dynamic frame broadcaster code, it is fully correct.

Additional Context

The original tutorial uses dynamic TF code for fixed frame only for unified code style, which leads to wrong usage cognition.
StaticTransformBroadcaster can automatically maintain static transformation in TF tree without manual loop sending.
Periodic publishing (100ms) is only applicable to dynamically changing coordinate frames.

Dominant language
Python
Stars
1k
Forks
1.3k
Avg merge
23h 42m
Merged PRs (30d)
78

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ros2/ros2_documentation

All issues in ros2/ros2_documentation

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.