FixTheRobot Explore Robotics / Systems Engineering / Troubleshooting

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.

  • Related modules: 06
  • ROS 2 Jazzy

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_echo compared with a tape-measure value.
  • Update rate and delay from tf2_monitor.
  • The publishers on /tf_static and /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 --verbose

5. Step-by-step investigation

  1. Print the tree and check for one root and one parent per frame.
  2. Compare one transform with a measurement: sign and magnitude of the translation.
  3. Check the direction: swap parent and child if the sign is opposite.
  4. Check for duplicate publishers and remove one.
  5. Check time: use_sim_time, stamps and the clock source.
  6. 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