A camera on the robot's head sees a ball. Where is the ball on the map? It takes a chain of frames to answer.
Key idea
Each transform says how one frame sits in another: a rotation and a shift. To move a point from the camera frame to the map, apply camera β base, then base β map, working outward. In ROS 2 the tf2 library keeps this chain up to date over time.
Why it works
The order matters because rotating and shifting do not commute: rotate then shift is a different move from shift then rotate. Working outward from the frame where the point was measured always gives the right order.
Worked example: Base to map
Robot at (2, 3), heading 90Β°. Point $(1, 0)$ in the base frame.
- Rotate by 90Β°: $(0, 1)$.
- Shift: $(2, 4)$.
Answer: (2, 4) on the map.
Common mistake
Applying the transforms in the wrong order.