Troubleshooting · Calibration and synchronization
Incorrect TF transforms
Print the tree, compare one transform with a hand measurement, then check names, direction and time in that order.
1. Symptoms
- A lookup fails (“frame does not exist”, “extrapolation into the future”).
- Sensor data appears shifted, rotated, mirrored or in the wrong place in RViz.
- A frame flickers between two positions.
2. Possible causes
- Name typo or a missing publisher.
- Two publishers (for example URDF and a static publisher) for one child frame.
- Parent and child swapped, so the transform is inverted.
- Wrong units (degrees as radians) or Euler-angle order.
- Clock or use_sim_time mismatch.
- The optical-frame permutation forgotten for a camera.
3. Measurements to collect
- The tree from
view_frames. - One transform from
tf2_echocompared with a tape-measure value. - Update rate and delay from
tf2_monitor. - The publishers on
/tf_staticand/tf.
4. Diagnostic commands
Commands are not executed by the site’s automated tests (they need a ROS 2 Jazzy installation or the robot).
ros2 run tf2_tools view_frames
ros2 run tf2_ros tf2_echo base_link lidar
ros2 run tf2_ros tf2_monitor
ros2 topic info /tf_static --verbose5. Step-by-step investigation
- Print the tree and check for one root and one parent per frame.
- Compare one transform with a measurement: sign and magnitude of the translation.
- Check the direction: swap parent and child if the sign is opposite.
- Check for duplicate publishers and remove one.
- Check time: use_sim_time, stamps and the clock source.
- Check the camera optical frame permutation.
6. Corrective actions
- Define each fixed link once (URDF or static publisher).
- Correct names and direction; use quaternions or documented Euler order.
- Make time settings consistent.
- Add a tree check to your launch tests (see the tf2 guide).
7. Validation after the fix
- view_frames shows a single tree.
- tf2_echo values match measurements within tolerance for every sensor.
- Data from every sensor overlaps in RViz.
References
- ROS 2 Jazzy tf2 tutorial, debugging tf2 problems: docs.ros.org, read 2026-11-06.
- See the tf2 guide.