Localisation Switching in runtime ROS2
02:19 24 Dec 2025

Implementation considerations

  1. High-Level Architecture
    Run both localizers in the system:
    amcl → coarse/global localization
    slam_localizer (e.g. slam_toolbox) → fine/docking localization

  2. TF / Pose Switching
    Ensure only one source effectively drives map → odom at a time.

  3. Switching Trigger
    Switching would be based region (geofence): robot enters a predefined docking zone (polygon/radius in map frame).

  4. Pose Initialization
    When switching AMCL → SLAM:
    Use the current AMCL pose as the initial pose for SLAM localization.
    Wait until SLAM is stable before exposing its TF/pose to the rest of the system.

  5. Nav2 Integration
    Nav2 always sees a single, consistent global frame (e.g. map).
    After a switch:
    Trigger a replan or clear costmaps if needed to handle small pose jumps.
    Keep controller paused until a valid pose from the new localizer is available.

Have anyone done this before or working on it? I want help to implement this on my turtlebot3 simulation. Give me suggestions and thank you in advance.

navigation ros ubuntu-22.04 ros2