Atlas Robotics
LocalizationIntermediate

The TF tree: debugging coordinate frames when Nav2 reports transform errors

Atlasbot · 17/8/2026 · 11 min read

The TF tree: debugging coordinate frames when Nav2 reports transform errors
view_frames generate entire TF tree maps to PDFs

The article Transform explains the TF tree theoretically the — series of concatenated transformations map → odom → base_link → lidar_link. This unit is a practical section: when a node reports an error "could not transform", this is the procedure for determining exactly which fragments in the sequence are missing or wrong.

Key concepts

Two main TF debugging tools, each answering a different question:

  • view_frames— captures the entire TF tree at a time, answering "is the overall structure correct"
  • tf2_echo— tracks a specific pair of frames in real time, answering "what is the specific value between these two frames right now"

How it works

ros2 run tf2_tools view_frames

This command listens to the TF for a few seconds, then outputs to the file frames.pdf — tree diagrams complete with all existing frames and their parent - child relationships, accompanied by frequency publication and latency of each transform. This is the first step to take when there is a suspicion of a problem with the overall TF — before going into the details of each frame pair.

Read the diagram, find "orphan" frames or unusual frequencies:

An orphan frame (not connected to the main tree) → missing static_transform_publisher
                                                  or the node publishing that frame is not running

Publishing frequency too low (for example, map→odom at only 1Hz instead of the expected 10Hz)
    → the source node (usually ekf_global or amcl) is slow/overloaded

Large delay between data creation and publication
    → may cause extrapolation errors when another node needs a transform at
      a time for which data is unavailable
ros2 run tf2_ros tf2_echo map base_link

Other than view_frames (single capture), tf2_echo printing continuous translation + rotation between 2 frames in real time — is useful to confirm whether a particular transform is updating correctly, or to quickly retrieve the current position of the robot in the map system without writing code.

In summary: Always start with view_frames to localize, then use tf2_echo to dig into the correct pair of questionable frames.

Technical details

Formulas

The TF buffer will only hold data for a limited time (default typically 10 seconds) — a "Lookup would require extrapolation" error occurs when the query is outside this window:

A query is valid when: current_time - buffer_duration ≤ query_time ≤ current_time

If a subscriber takes longer than buffer_duration before requesting
its data's timestamp -> "extrapolation into the past" error

If a node requests a transform at a time THAT HAS NOT OCCURRED (a future timestamp,
usually due to clock differences between computers) -> "extrapolation into the future" error

Parameters

ToolsUsed to
ros2 run tf2_tools view_framesCaptures the TF tree, exports the PDF
ros2 run tf2_ros tf2_echo A BTracking a frame pair in real time
RViz2 Display TF3D Visual View (article RViz2)
ros2 topic hz /tfChecks the overall frequency publication

Practical applications

The "Lookup would require extrapolation into the past/future" error is the most common TF error running Nav2 on multiple machine architectures (such as PC + Jetson in Atlas A2 project, or MCU + SBC in general as learned in AMR Architecture) — common causes include asynchronous system clock between machines (mentioned in DDS Configuration) causing the timestamps to deviate, or a node publish TF much later than other nodes. Checking clock synchronization is the first step that should be taken with this error, before suspecting the logic code — uses chrony/ntpdate to synchronize the time between machines participating in the same ROS2 system.

Practical example

# Full debugging when Nav2 reports "could not transform"

# Step 1: Panorama
ros2 run tf2_tools view_frames
# -> open frames.pdf, find orphan frames or unusual frequencies

# Step 2: dig into the pair of questionable frames (e.g. map - > odom)
ros2 run tf2_ros tf2_echo map odom
# - > if no output is available, the source node (ekfglobal) is not published correctly

# Step 3: check the synchronization of clocks between the machines (if multi-machines)
timedatectl status   # on each machine, compare system hours

# Step 4: if it's misaligned, synchronize
sudo apt install chrony
sudo systemctl restart chrony
Practical scenario: Nav2 on a Jetson repeatedly reports extrapolation errors,
while the motor driver node runs on a separate computer over LAN

Cause identified with the procedure above: the system clocks on the Jetson
and driver computer differ by ~2 seconds because they are not synchronized to the same NTP source
-> timestamps in TF messages from the driver computer are treated as being in the past
   when the Jetson receives them and compares them against its own TF buffer
-> resynchronizing the clocks with chrony resolves the errors

Common mistakes

  • Declaring logic code prior to clock synchronization testing in a multiple-machine system— as the above example, the most common cause of extrapolation errors in a multi-machine architecture is clock misalignment, not algorithmic errors.
  • Only using tf2_echo which ignores view_frames to view the overall before— easily misses the problem at a TF segment other than the frame pair being directly debuged.
  • Do not check the frequency publish TF before concluding "TF is defective"— the frequency is too low than expected (overloaded source node) which is quite different from the completely non-public TF, it is necessary to distinguish these two situations through ros2 topic hz /tf.
  • Bypassing the "orphan" frame check in the scheme view_frames— an un-executed static_transform_publisher or node publish frame that failed to generate the unconnected frame into the main tree, easily missed without first looking at the totality.

Conclusion

The effective TF tree debug always follows the correct sequence: view_frames to localize the overall structure, tf2_echo to dig deep into the questionable frame pair, and check clock synchronization if running multiple machine architecture. This is the final article of the Localization — column from AMCL, EKF, RF2O, odometry fusion, to TF tree debugging, a 5-item series that has gone from localization theory to complete implementation practice in Nav2. The Nav2 column next goes into the rest of the framework — Planner, Controller, Costmap, Behavior Tree.

Get new articles and lessons by email

When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.

Unsubscribe any time with the link in each email. See our Privacy policy.

The TF tree: debugging coordinate frames when Nav2 reports transform errors — Atlas Robotics