Misleading fixed frame broadcaster code in tf2 Adding a Frame (C++) tutorial
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
- Domain
- documentation, robotics
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ros2/ros2_documentation
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ros2/ros2_documentation#7185 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ros2/ros2_documentation#7097 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
ros2/ros2_documentation#6567 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ros2/ros2_documentation#6513 ·
-
ros2/ros2_documentation#7188 · 1 assignee ·
All issues in ros2/ros2_documentation
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100