Troubleshooting · SLAM and localization
Map and odometry frames are inconsistent
Exactly one node should publish map→odom, and odom→base_link must be continuous. Check publishers before parameters.
1. Symptoms
- The robot jumps in RViz.
- Two map frames appear or the transform flickers.
- The planner replans constantly.
2. Possible causes
- Two nodes publish map→odom (for example AMCL and a SLAM node).
- A fused filter publishes odom with jumps because absolute sensors are fused into it.
- Time stamps or use_sim_time mismatch.
- Wrong frame names between packages.
3. Measurements to collect
- Publishers on /tf for each pair.
- Largest step in odom→base_link.
- tf2_monitor output.
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 info /tf --verbose
ros2 run tf2_ros tf2_monitor
ros2 run tf2_tools view_frames5. Step-by-step investigation
- Print the tree and find duplicate parents.
- Find the publishers for map→odom and keep one.
- Check odom continuity (REP 105).
- Check time settings.
- Check frame names in each package’s configuration.
6. Corrective actions
- Run exactly one localiser publishing map→odom.
- Keep absolute sensors out of the odom filter, or run a second filter for the map frame.
- Fix time and frame names.
7. Validation after the fix
- view_frames shows one chain map→odom→base_link; odom has no jumps in a long run.
References
- REP 105, Coordinate Frames for Mobile Platforms: rep-0105.rst, read 2026-11-05.
- See the tf2 guide.