Why do we need TF2
All robot data in ROS 2 — location, sensors, maps — is meaningless without knowing where it comes from. "Robot is at (1.5, 2.0)" compared to what? Compared to the map? Compared to when the robot started up? Compared to the robot body itself?
TF2 (Transform Framework, version 2) is the ROS 2 infrastructure used to answer that question in a unified way: every position is associated with a named frame, and TF2 knows how to convert between frames.
After this module you will
- Distinguish between frame and transform
- Be able to read a TF tree and know why it is always a tree, not an arbitrary graph
- Explain why ROS separates frames
mapandodominstead of combining them into one - Can use
view_frames,tf2_echoto debug TF — set of commands will be used daily from Module 4 onwards
Preparation
This module assumes you have completed Module 0 and Module 1 — especially lesson Topic, Publisher/Subscriber, because TF is just a utility layer built on pub/sub, not a new mechanism.
cd ~/atlas_sim
colcon build --packages-select ros2_basics
source install/setup.bash
Module overview
Frame & TransformA coordinate system, and the offset between two coordinate systems
TF treeCombine multiple transforms into 1 tree
REP-103 / REP-105Unit conventions, axes, and standard frame sequences
Debug toolsview_frames, tf2_echo, static_transform_publisher