FixTheRobot Explore Robotics / Systems Engineering / Troubleshooting

Troubleshooting · SLAM and localization

SLAM drifts

Measure drift as a percentage of distance, then change one thing at a time.

  • Related modules: 09
  • ROS 2 Jazzy

1. Symptoms

  • Maps are bent or corridors do not close.
  • The estimated position slides while the robot is still or turning.
  • The loop-closure gap grows with route length.

2. Possible causes

  • Wheel slip or a poor odometry model.
  • Time offset between sensors, wrong extrinsics.
  • Too few features (visual) or too little structure (LiDAR).
  • Thresholds that skip scans.
  • Loop closure disabled or mis-tuned.
  • Dynamic objects.

3. Measurements to collect

  • Loop-closure gap ÷ path length.
  • Where along the route the error grows.
  • Odometry versus IMU consistency while turning.
  • Per-scan processing time and dropped scans.

4. Diagnostic commands

Commands are not executed by the site’s automated tests (they need a ROS 2 Jazzy installation or the robot).

ros2 topic hz /scan
ros2 run tf2_ros tf2_echo map odom
ros2 bag record /scan /odom /imu/data /tf /tf_static

5. Step-by-step investigation

  1. Fix a route and measure the loop gap.
  2. Check odometry on a straight run and a turn.
  3. Check time and calibration (see the timing and calibration guides).
  4. Check features or structure in the drifting section.
  5. Check thresholds and dropped scans.
  6. Check loop closure settings.

6. Corrective actions

  • Fuse IMU with odometry; correct the odometry model.
  • Calibrate time and extrinsics.
  • Add a second modality or constraint.
  • Tune travel thresholds and loop closure.

7. Validation after the fix

  • Drift on the reference route is below the requirement on three repeated runs.

References