An autonomous mobile robotics engineering repository for Multi-Robot 2D Graph SLAM, Occupancy Grid Map Merging, Namespaced Nav2 Autonomous Fleet Navigation, and Decentralized Task Allocation on the Gizmo 2WD Differential Drive Robot using ROS 2 Lyrical and CycloneDDS.
Build all workspace packages using Pixi:
pixi run colcon build --symlink-installNote: CycloneDDS (
rmw_cyclonedds_cpp) is configured viadds_config/cyclonedds.xmlto isolate discovery domains and eliminate multicast discovery storms across multi-robot namespaces.
Launch the complete simulation, namespaced SLAM Toolbox instances, and dynamic map merge node:
ros2 launch gizmo_bringup multi_robot_mapping.launch.py- When RViz opens, each robot publishes its local occupancy grid (
/{NAME}/map). - The
map_merge_nodedynamically transforms and fuses all local submaps into a unified global occupancy grid on/map. - Drive individual robots using the teleoperation interface launched automatically with mapping (or run standalone via
ros2 launch gizmo_teleop teleop.launch.py) usingW/A/S/Dto drive andQ/Eor the Topic selector to switch between active robots in the fleet. - (Optional) To save the merged global map or individual submaps once the arena is fully mapped:
# Save the unified global map (used by Nav2) ros2 run nav2_map_server map_saver_cli -f src/gizmo_mapping/maps/simple_bigger_world_map --ros-args -p map_topic:=/map # Save an individual robot's local map ros2 run nav2_map_server map_saver_cli -f src/gizmo_mapping/maps/robot1_map --ros-args -p map_topic:=/robot1/map
Figure 1: Live Multi-Robot SLAM and Map Merging. Left: Gazebo Sim multi-robot physical arena. Right: RViz2 live mapping telemetry with multiple autonomous agents exploring in parallel while the global map merging node dynamically transforms and stitches namespaced occupancy grids into a unified /map representation.
Launch multi-robot Nav2 autonomous navigation with the centralized Fleet Goal Allocator:
ros2 launch gizmo_bringup multi_robot_navigation.launch.py- When RViz opens, select the 2D Goal Pose tool on the top toolbar and click anywhere on the global map.
- The Fleet Goal Allocator intercepts the target pose, computes feasible Nav2 global paths across all available idle robots, and dispatches the task to the optimal agent with the shortest path.
- Incoming goals placed while all robots are busy are automatically held in an asynchronous FIFO queue and dispatched as robots finish their tasks.
Figure 2: Multi-Robot Nav2 Autonomous Fleet Navigation. Left: Gazebo Sim 3D physical world and obstacle layout. Right: RViz2 fleet telemetry demonstrating asynchronous goal queuing, intelligent task dispatching via the Fleet Goal Allocator, dynamic costmap-based obstacle avoidance, and decentralized Regulated Pure Pursuit (RPP) path tracking across a shared global map.
The multi-robot architecture provides namespaced decentralization for high-rate perception, state estimation, and path tracking, combined with centralized fleet orchestration for global map merging and goal dispatching:
[Fleet Operator / RViz2 Dashboard]
│
┌────────────────────────┴────────────────────────┐
│ (/goal_pose) │ (Display streams)
▼ ▼
[fleet_goal_allocator] [rviz2_dashboard]
(Dynamic FIFO Queue & (Namespaced TF,
Shortest Path Dispatch) Paths, & Costmaps)
│
┌───────────────┼───────────────┐ (Action Dispatch: /{NAME}/navigate_to_pose)
▼ ▼
[robot1 Namespace] [robot2 Namespace] [robotN Namespace]
┌─────────────────────────┐ ┌─────────────────────────┐ ┌─────────────────────────┐
│ • bt_navigator │ │ • bt_navigator │ │ • bt_navigator │
│ • planner_server (NavFn)│ │ • planner_server (NavFn)│ │ • planner_server (NavFn)│
│ • controller_server(RPP)│ │ • controller_server(RPP)│ │ • controller_server(RPP)│
│ • behavior_server │ │ • behavior_server │ │ • behavior_server │
│ • slam_toolbox / amcl │ │ • slam_toolbox / amcl │ │ • slam_toolbox / amcl │
└────────────┬────────────┘ └────────────┬────────────┘ └────────────┬────────────┘
│ /{NAME}/map │ /{NAME}/map │ /{NAME}/map
└──────────────────────┬───────┴──────────────────────────────┘
▼
[map_merge_node]
(Rigid 2D Planar Alignment)
│
▼
Unified Global Map (/map)
Each robot evaluates a dedicated Behavior Tree coordinating path planning, tracking, and recovery:
- Concurrent Planning and Control (
PipelineSequence): Continuously evaluates global route replanning at 2.0 Hz while the controller tracks the active path segment at 20.0 Hz. - Deterministic Fallback Recovery (
RecoveryNode): When deadlocks or dynamic obstacles occur, the Behavior Server steps through clear-costmap, in-place spin (to broaden LiDAR perception), 5-second wait (yielding right-of-way to crossing fleet agents), and linear backup maneuvers.
The repository is organized into 7 modular ROS 2 packages inside src/:
| Package | Build Type | Primary Responsibility |
|---|---|---|
gizmo_description |
ament_cmake |
Robot kinematics URDF/Xacro, visual and collision geometry, inertial parameters, and sensor frame definitions. |
gizmo_gazebo |
ament_cmake |
Gazebo simulation worlds (simpleBiggerWorld.sdf), fleet configuration (robots_fleet.yaml), and multi-robot entity spawners. |
gizmo_teleop |
ament_cmake |
Teleoperation node with dynamic multi-robot topic switching, safety clamping, and proportional joystick controls. |
gizmo_mapping |
ament_cmake |
Namespaced SLAM Toolbox configurations, 2D occupancy grid maps, and real-time rigid map merge node (map_merge_node.py). |
gizmo_navigation |
ament_cmake |
Namespaced Nav2 parameter files (nav2_namespaced.yaml), custom Behavior Trees (gizmo_nav_to_pose.xml), and multi-robot RViz dashboards. |
gizmo_bringup |
ament_cmake |
Top-level system orchestrators coordinating simulation, namespaced mapping, and multi-robot autonomous navigation. |
gizmo_scripts |
ament_python |
Centralized Fleet Goal Allocator (fleet_goal_allocator.py) supporting asynchronous goal queuing, path length optimization, and footprint clearance checks. |
The workspace provides launch pipelines structured across 3 architectural layers:
[Layer 3: Master Bringup & Fleet Orchestration]
├── multi_robot_mapping.launch.py (Full simulation + Namespaced SLAM + Map Merge + Teleop + RViz2)
├── multi_robot_navigation.launch.py (Full simulation + Namespaced Nav2 + Fleet Goal Allocator + RViz2)
├── single_robot_mapping.launch.py (Single-agent SLAM baseline)
└── single_robot_navigation.launch.py(Single-agent Nav2 baseline)
[Layer 2: Core Subsystems]
├── multi_robot_slam.launch.py (Dynamic loop spawning isolated slam_toolbox instances per robot)
├── map_merge.launch.py (Dynamic rigid 2D alignment fusing /{NAME}/map into /map)
└── navigation.launch.py (Namespaced 4-server Nav2 stack + lifecycle managers)
[Layer 1: Simulation & Kinematics]
├── gazebo_multi_robot_spawn.launch.py (Gazebo simulator + fleet entity spawners + clock/sensor bridges)
├── gazebo.launch.py (Single-robot base simulator spawner)
├── display.launch.py (URDF kinematic transform tree verification in RViz)
└── teleop.launch.py (Interactive velocity command publisher)
- Purpose: Coordinates full multi-robot SLAM simulation. Launches Gazebo, spawns fleet robots with sensor bridges, executes namespaced SLAM Toolbox nodes, starts map merging, and brings up the visualization dashboard.
- Mechanism:
- Spawns Gazebo and fleet entities via
gazebo_multi_robot_spawn.launch.pybased onrobots_fleet.yaml. - Applies a
TimerAction(period=gazebo_delay)(default 7.0s) allowing Gazebo physics, sensor topics, and EKF transforms to stabilize. - Launches namespaced
slam_toolboxinstances for all active agents viamulti_robot_slam.launch.py. - Launches
map_merge_node.pyto aggregate submaps into/map. - Spawns RViz2 configured with multi-robot occupancy displays and the multi-topic teleoperation interface.
- Spawns Gazebo and fleet entities via
- Key Commands:
# Launch mapping for all robots in the fleet ros2 launch gizmo_bringup multi_robot_mapping.launch.py # Launch mapping for a subset of robots ros2 launch gizmo_bringup multi_robot_mapping.launch.py robot_names:="robot1,robot2" # Headless mode (no Gazebo GUI, reduces CPU/GPU overhead) ros2 launch gizmo_bringup multi_robot_mapping.launch.py headless:=true
- Purpose: Coordinates multi-robot autonomous navigation across a shared pre-built map.
- Mechanism:
- Launches Gazebo physics and spawns fleet robots at predefined initial coordinates.
- Waits for Gazebo initialization (
gazebo_delay:=7.0), then initializes namespaced Nav2 stacks (planner_server,controller_server,behavior_server,bt_navigator) for each robot. - Launches the Fleet Goal Allocator after Nav2 servers transition to active (
allocator_delay:=3.0). - Launches RViz2 with multi-robot costmaps, local plans, and goal injection tools.
- Key Commands:
# Launch multi-robot navigation for the entire fleet ros2 launch gizmo_bringup multi_robot_navigation.launch.py # Launch navigation with a custom pre-built map ros2 launch gizmo_bringup multi_robot_navigation.launch.py map:=/path/to/my_map.yaml # Launch navigation for specific robots only ros2 launch gizmo_bringup multi_robot_navigation.launch.py robot_names:="robot1,robot2"
- Purpose: Spawns isolated, namespaced SLAM Toolbox instances for each designated robot.
- Mechanism: Parses
robots_fleet.yaml, generates a temporary parameter file for each robot replacing{NAME}tokens, and remaps localmapandmap_metadatatopics to prevent cross-namespace collision.
- Purpose: Aggregates distributed submaps into a coherent global occupancy grid.
- Mechanism: Subscribes to
/{NAME}/mapupdates, projects submap occupancy data onto the global/mapframe using rigid planar spawn transformations, and resolves conflicting cell states via probabilistic occupancy fusion.
- Purpose: High-level decentralized goal dispatcher and priority queue manager.
- Mechanism:
- Subscribes to global
/goal_poseinputs. - Rejects candidate goals placed within robot collision clearance zones.
- Queries actual Nav2 plan lengths (
getPath()) from idle candidates rather than naive Euclidean distance. - Dispatches target goals to the optimal candidate and buffers excess requests in a thread-safe FIFO queue.
- Subscribes to global
- Purpose: Base physics simulation engine and fleet entity spawning pipeline.
- Mechanism: Starts Gazebo Sim, loads the designated world (
simpleBiggerWorld.sdf), initializes bidirectional/clockand sensor bridges (/scan,/imu/data), publishes robot URDF models viarobot_state_publisher, and executes namespaced EKF nodes (robot_localization).
- Purpose: Standalone velocity command teleoperation interface with dynamic topic switching.
- Mechanism: Spawns the joystick teleoperation interface for manual velocity command injection with safety limits (
max_linear: 0.73m/s,max_angular: 3.14rad/s), keyboard driving (W/A/S/D), and fleet robot switching (Q/Eor Topic spinbox). - Command:
# Launch teleoperation interface for manual driving ros2 launch gizmo_teleop teleop.launch.py
Each Gizmo robot operates under differential-drive nonholonomic kinematic constraints with pure rolling and zero lateral slip:
Spatial coordinate frames strictly conform to REP-105:
map: Earth-fixed global world frame shared across the fleet.{NAME}/odom: Continuous, locally smooth odometry frame estimated by Extended Kalman Filter (robot_localization) fusing wheel kinematics and IMU sensor streams.{NAME}/base_footprint: 2D ground projection of the mobile robot center of rotation.{NAME}/base_link: Rigidly attached 3D origin of the vehicle chassis.
map ──(discrete SLAM/AMCL update)──> {NAME}/odom ──(continuous EKF)──> {NAME}/base_footprint ──> {NAME}/base_link
To prevent control instability in narrow corridors and tight passages, local trajectory tracking is governed by the Regulated Pure Pursuit (RPP) controller:
Target Path Curvature:
The controller continuously extracts a lookahead point on the global path at distance
where
Adaptive Curvature Regulation: Linear velocity is regulated dynamically as an inverse function of instantaneous curvature:
This guarantees bounded lateral acceleration on tight corners, prevents path overshoot, and stabilizes multi-agent intersection clearance.
Pose-Graph SLAM:
Each robot runs asynchronous 2D LiDAR SLAM via slam_toolbox, constructing a dynamic pose graph where nodes denote 2D vehicle poses
Loop closures and constraint graphs are optimized using Ceres non-linear least squares.
Deterministic Map Alignment:
Because fleet initial spawn coordinates are known from robots_fleet.yaml, local submaps are projected onto the global frame through rigid 2D planar transformations without requiring computationally prohibitive cross-fleet scan matching:
├── bash_scripts/ # Environment activation and build helpers
├── dds_config/ # CycloneDDS configuration (cyclonedds.xml)
├── media/ # High-fidelity demonstration recordings and GIFs
├── notes/ # System architecture diagrams (.excalidraw.svg)
├── src/
│ ├── gizmo_bringup/ # Master launch files for fleet mapping and navigation
│ ├── gizmo_description/ # Differential-drive URDF/Xacro models and sensor frames
│ ├── gizmo_gazebo/ # Simulation worlds, fleet spawn configs, and bridges
│ ├── gizmo_mapping/ # Namespaced SLAM configs and rigid map merge node
│ ├── gizmo_navigation/ # Nav2 parameters, custom Behavior Trees, and RViz configs
│ ├── gizmo_scripts/ # Centralized Fleet Goal Allocator and task dispatchers
│ └── gizmo_teleop/ # Multi-robot teleoperation GUI node
├── pixi.toml # Pixi environment and dependency specification
└── README.md