Atlas Robotics
Lesson 3/6 · about 30 min

TF tree: which node indicates the robot's location

TF is a tree of coordinate systems (frame). Each edge tells where the child frame is relative to the parent frame, and each frame has exactly one parent, transmitted by exactly one node. Knowing this tree is knowing why M01 must run bringup with wheel_odom_tf:=false.

When running navigation, main thread from top:

  1. maproot of tree
  2. odomlocalizer_node, ~80 Hz
  3. bodylio_node, 10 Hz
  4. base_footprintfastlio2_body_to_base, static (−0.1 m)
  5. base_link …robot_state_publisher: LiDAR, camera, IMU, wheel

Each tag is a frame; The letter on the right is the node that broadcasts the edge from the parent frame to that frame.

Four main frames

Frame
mapMap origin: where the robot stands when SLAM is turned on when scanning. Does not drift over time
odomOrigin of FAST-LIO2 in current run. The position in this frame is smooth (no jumps) but drifts gradually
bodyIMU center on the robot, 0.1 m above the floor. FAST-LIO2 calculates the position of this frame
base_footprintPoint on the floor just below the robot's center of rotation. Nav2 controls this frame

Next to map → odom is the error correction part: PGO (when scanning) or localizer (when running on old maps) calculates where frame odom must be placed on the map for the scan to match. M09, M10 go into detail.

Which side is published by whom?

EdgeNodeMeasuredMode
map → odompgo_node9.8 HzScan
map → odomlocalizer_node82 Hzrelocalization, navigation
odom → bodylio_node9.8 HzScanning, navigation
body → base_footprintfastlio2_body_to_basestaticScanning, navigation
odom → base_footprintdiff_drive_controller49 HzOnly bringup (driver, no SLAM)
base_footprint → base_link → …robot_state_publisherstatic; wheel and caster 20 HzAlways available

Frequency measured by listening to /tf for 6 s. Localizer transmits faster than PGO because it stamps 0.5 s early for Nav2 without having to wait (M10).

View trees on your computer

ros2 run tf2_tools view_frames
[view_frames]: Listening to tf data for 5.0 seconds...
[view_frames]: Generating graph in frames.pdf file...

Output file frames_<date>.pdf in current directory: frame tree with frequencies. Column broadcaster always says default_authority: ROS 2 Humble does not indicate which node the TF message comes from. If you want to know, read the source/launch code (table above) or turn off each node to see which edge disappears.

Look up an edge, including compound edges, through multiple steps:

ros2 run tf2_ros tf2_echo map base_footprint

Why must wheel TF be turned off when running SLAM?

Bringup defaults to diff_drive_controller play odom → base_footprint from wheel odometry: enough to drive and view in RViz at M00. SLAM plays odom → body → base_footprint again. If you don't turn off the first one, base_footprint has two parents.

True measurement: forgot wheel_odom_tf:=false

Run default bringup + fastlio2.launch.py, then drive the robot onto the ramp platform. Select "Error" in the scene above to review:

  • view_frames records the parent of base_footprint as odom (of wheel). The static edge body → base_footprint is still transmitted but is encroached.
  • Robot gets on the 0.6 m high platform, FAST-LIO2 measures correctly (body at z 0.71 m), but TF odom → base_footprint remains z = 0.00 all the way: wheel odometry only calculates on the plane.
  • tf2_echo body base_footprint yields z = −0.711 m instead of −0.1 m.

Terminal bringup and SLAM print no warning about TF. As a result, everything attached to base_footprint (LiDAR, camera, robot model, Nav2 footprint) is plotted and calculated in the wrong place. In the simulation, the wheel almost does not slip, so x and y still match; On a real robot, the two sources gradually deviate from each other and the robot "jumps" in RViz.

Rule: each edge of the TF tree indicates one source. When adding a TF transmitter node, check that no one is transmitting at that edge.

The TF tree: which node tells you where the robot is · Module 2: The big picture — Atlas Robotics