A complete simulated differential-drive mobile robot stack developed for ROS 2 Humble and Gazebo Fortress (Ignition 6.18.0), featuring ros2_control, precision odometry, 360° 2D LiDAR integration, online asynchronous 2D SLAM (slam_toolbox), and full Nav2 autonomous navigation with AMCL localization, global/local costmaps, DWB trajectory controller, Navfn global planner, and behavior tree navigation.
| Component | Parameter | Value | Notes |
|---|---|---|---|
| Chassis | Dimensions ( |
Centered at base_link
|
|
| Mass | Total Weight | Chassis: |
|
| Wheel Radius ( |
left/right_wheel_link |
|
Cylinder length: |
| Wheel Separation ( |
Track Width |
|
Symmetrical offsets: |
| Caster Ball | Passive Omnidirectional Support | Radius |
Mounted at |
| LiDAR Sensor | laser_link |
Mounted on chassis | Offset base_link ( |
For a differential drive robot with wheel radius
Given left wheel angular velocity
Given commanded linear velocity
flowchart TD
map["map (Global Fixed SLAM Frame)"]
odom["odom (Odometry World Frame)"]
bf["base_footprint (Ground Projection Frame, z=0)"]
bl["base_link (Chassis Frame, z=0.05m)"]
lw["left_wheel_link"]
rw["right_wheel_link"]
cw["caster_wheel_link"]
ll["laser_link (2D LiDAR Frame)"]
map -->|/tf dynamic (slam_toolbox)| odom
odom -->|/tf dynamic (diff_drive_controller)| bf
bf -->|/tf_static (robot_state_publisher)| bl
bl -->|/tf dynamic (robot_state_publisher)| lw
bl -->|/tf dynamic (robot_state_publisher)| rw
bl -->|/tf_static (robot_state_publisher)| cw
bl -->|/tf_static (robot_state_publisher)| ll
-
Sensor Type: Gazebo Fortress
gpu_lidarplugin -
Mount Position:
$x = +0.10,\text{m}, y = 0.0,\text{m}, z = +0.125,\text{m}$ relative tobase_link($0.175,\text{m}$ above ground) -
Field of View (FOV):
$360.0^\circ$ ($[-\pi, +\pi]$ rad) -
Beam Samples:
$720$ samples ($0.5^\circ$ angular resolution) -
Update Frequency:
$10,\text{Hz}$ -
Detection Range:
$0.10,\text{m}$ to$10.0,\text{m}$ -
ROS 2 Topic:
/scan(sensor_msgs/msg/LaserScan) -
Frame ID:
laser_link -
Bridge:
ros_gz_bridge parameter_bridge(/scan@sensor_msgs/msg/LaserScan[ignition.msgs.LaserScan)
-
SLAM Mode: Online Asynchronous Mapping (
async_slam_toolbox_node) -
Solver Plugin:
solver_plugins::CeresSolver(Ceres Nonlinear Least Squares optimization) - Scan Matcher: Real-time correlation scan-matching + scan barycenter
-
Map Resolution:
$0.05,\text{m}$ /pixel ($5,\text{cm}$ grid) -
Update Rate:
$2.0,\text{s}$ periodic map publishing and graph optimization -
Dynamic Transform: Publishes
map -> odomtransform at$50,\text{Hz}$ (transform_publish_period: 0.02) -
Map Output:
nav_msgs/msg/OccupancyGridon/map(trinary format:$-1$ unknown,$0$ free,$>0$ occupied)
The navigation stack integrates the complete ROS 2 Navigation2 (Nav2) architecture with managed lifecycles:
-
Map Server (
nav2_map_server): Loads and serves the static 2D occupancy grid map (maps/test_world_map.yaml) at$0.05,\text{m/pixel}$ . -
AMCL Localization (
nav2_amcl): Adaptive Monte Carlo Localization with differential motion model (nav2_amcl::DifferentialMotionModel) and likelihood field laser model, publishing the dynamic correction transformmap -> odom. -
Costmap 2D (
nav2_costmap_2d):-
Global Costmap: Static obstacle map layer + real-time laser obstacle clearing/marking layer + inflation layer (
$r_{robot} = 0.22,\text{m}$ ,$r_{inflation} = 0.45,\text{m}$ , scaling factor$3.0$ ). -
Local Costmap: Dynamic rolling window (
$3.0 \times 3.0,\text{m}$ ) tracking local sensor obstacles and safety inflation buffers.
-
Global Costmap: Static obstacle map layer + real-time laser obstacle clearing/marking layer + inflation layer (
-
Global Path Planner (
nav2_planner): Navfn Dijkstra / wavefront planner (nav2_navfn_planner/NavfnPlanner) computing optimal, collision-free global path waypoints in themapframe. -
Local Controller Server (
nav2_controller): DWB Local Planner (dwb_core::DWBLocalPlanner) with trajectory rollout evaluation (RotateToGoal,Oscillation,BaseObstacle,GoalAlign,PathAlign,PathDist,GoalDist), velocity limits ($v_{max} = 0.4,\text{m/s}, \omega_{max} = 1.0,\text{rad/s}$ ), and active stopping. -
Behavior Server (
nav2_behaviors): Recovery behaviors for obstacle deadlocks (Spin,BackUp,Wait). -
BT Navigator (
nav2_bt_navigator): Behavior tree execution engine dispatching navigation goals with automatic replanning and recovery strategies. -
Lifecycle Manager (
nav2_lifecycle_manager): Managed state machine transitions for all navigation servers (map_server,amcl,controller_server,planner_server,behavior_server,bt_navigator).
Phase 8 elevates the robot from pre-mapped navigation to fully autonomous frontier-based exploration, enabling the robot to explore an unknown environment from scratch without human intervention or pre-existing maps:
flowchart LR
LIDAR["GPU LiDAR (/scan)"] --> SLAM["SLAM Toolbox (Online Async)"]
SLAM -->|"/map & map->odom TF"| EXP["Frontier Exploration Node"]
SLAM -->|"/map"| GCOST["Nav2 Global Costmap"]
EXP -->|"Ranked Safe Goals"| NAV2["Nav2 NavigateToPose Action"]
NAV2 -->|"Path Following (/cmd_vel)"| CTRL["ros2_control Diff Drive"]
CTRL -->|"Odometry (/odom & odom->base_footprint)"| SLAM
EXP -->|"Markers (/exploration/*)"| RVIZ["RViz2 Visualization"]
-
SLAM-Nav2 Decoupled Authority (No AMCL / No static Map Server):
- In exploration mode,
slam_toolboxacts as the sole authority for both the occupancy map (/map) and the global localization transform (map -> odom). -
map_serverandamclare completely excluded to eliminate competing TF publishers and map topic collisions. -
nav2_lifecycle_managermanages strictly the four motion-execution nodes:controller_server,planner_server,behavior_server, andbt_navigator. -
global_costmapdynamic update layer subscribes directly to/mapwith transient local durability.allow_unknown: falsein Navfn planner enforces that paths only traverse verified free space.
- In exploration mode,
-
Algorithmic Frontier Detection Engine (
frontier_detector.py):-
Frontier Cell Extraction: Fast vectorized 8-connectivity filtering identifying free cells (
$0 \le \text{occupancy} \le 25$ ) that touch unknown cells ($-1$ ). -
Obstacle Clearance & Distance Transform: Euclidean Distance Transform (EDT) computes clearance from all occupied obstacles. Frontier cells closer than safety buffer (
$0.28,\text{m}$ ) are pruned. -
Connected-Component Clustering: 8-connected BFS groups adjacent frontier cells into clusters, filtering out noise with cluster size
$< 5$ cells. - Safe Goal Projection: Computes cluster centroid; if inside an obstacle inflation or unknown zone, projects to the highest-clearance free cell within the cluster.
-
Multi-Objective Cost Ranking:
$$J(\text{goal}) = w_{\text{dist}} \cdot d(\text{robot}, \text{goal}) - w_{\text{size}} \cdot (\text{size} \cdot \text{res}) - w_{\text{clear}} \cdot d_{\text{obs}}$$ Balances travel efficiency, information gain, and safe clearance. -
Temporal Spatial Blacklisting: Failed or unreachable goals are blacklisted within radius
$0.6,\text{m}$ for$60,\text{s}$ , preventing livelock and oscillation.
-
Frontier Cell Extraction: Fast vectorized 8-connectivity filtering identifying free cells (
-
Explorer State Machine (
explorer_node.py):-
INIT$\rightarrow$ IDLE$\rightarrow$ PLANNING$\rightarrow$ NAVIGATING$\rightarrow$ WAITING_RETRY$\rightarrow$ COMPLETED - Commands motion strictly via Nav2
NavigateToPoseactions—never publishes directly to/cmd_vel, guaranteeing continuous dynamic obstacle avoidance. - Publishes rich RViz visualization markers (
MarkerArrayon/exploration/frontiers,Markeron/exploration/current_goal). - Exposes standard ROS 2 services:
/exploration/pause,/exploration/resume,/exploration/stop.
-
source /opt/ros/humble/setup.bash
source /media/bumble/DATA_DISK/robotics/opt/ros_extra/setup.bash
source install/setup.bashcolcon build --symlink-install# Launch Gazebo GUI + robot controllers + LiDAR bridge
ros2 launch diff_drive_description gazebo.launch.py headless:=false rviz:=true# Launches Gazebo Fortress + ros2_control + SLAM Toolbox + RViz2 (fixed frame: map)
ros2 launch diff_drive_description slam.launch.py headless:=false rviz:=true# Launches Gazebo Fortress + ros2_control + Map Server + AMCL + Costmaps + Planner + Controller + BT Navigator + RViz2
ros2 launch diff_drive_description navigation.launch.py headless:=false rviz:=true# Launches Gazebo Fortress + ros2_control + SLAM Toolbox + SLAM-Nav2 + Frontier Explorer + RViz2
ros2 launch diff_drive_description exploration.launch.py headless:=false rviz:=true# Pause autonomous exploration
ros2 service call /exploration/pause std_srvs/srv/Trigger
# Resume autonomous exploration
ros2 service call /exploration/resume std_srvs/srv/Trigger
# Stop autonomous exploration and cancel active goals
ros2 service call /exploration/stop std_srvs/srv/Trigger
# Save final exploration map
ros2 run nav2_map_server map_saver_cli -t /map -f maps/autonomous_exploration_map --ros-args -p map_subscribe_transient_local:=true -p use_sim_time:=trueAll phases are supported by automated validation suites:
# Phase 1: Gazebo Physics & Ground Contact
python3 tests/test_phase1_physics.py
# Phase 2: ros2_control Diff Drive Controllers
python3 tests/test_phase2_ros2_control.py
# Phase 3: Comprehensive 9-Maneuver Motion Suite
python3 tests/test_phase3_motion.py
# Phase 4: Odometry & TF2 Accuracy
python3 tests/test_phase4_odometry.py
# Phase 5: 2D LiDAR Integration & Scan Geometry
python3 tests/test_phase5_lidar.py
# Phase 6: SLAM Toolbox 2D Mapping & Map Persistence
python3 tests/test_phase6_slam.py
# Phase 7: Nav2 Autonomous Navigation Full Validation
python3 tests/test_phase7_navigation.py
# Phase 8: Frontier Detector Algorithmic Unit Tests (14/14 tests)
python3 tests/test_phase8_frontier_unit.py
# Phase 8: Autonomous Frontier Exploration Full Simulation Suite (16/16 tests)
python3 tests/test_phase8_exploration.py| Milestone | Status | Key Evidence |
|---|---|---|
| Phase 1: Gazebo Physics | VERIFIED | Spawns in test_world.sdf, stable ground contact at |
| Phase 2: ros2_control | VERIFIED |
diff_drive_controller & joint_state_broadcaster active at |
| Phase 3: Motion Validation | VERIFIED | 9 maneuvers verified using simulation clock (/clock). |
| Phase 4: Odometry & TF2 | VERIFIED |
odom -> base_footprint, static TF base_footprint -> base_link. |
| Phase 5: 2D LiDAR | VERIFIED |
|
| Phase 6: SLAM 2D Mapping | VERIFIED | Ceres-backed async mapping, dynamic map -> odom TF, maps/test_world_map. |
| Phase 7: Nav2 Navigation | VERIFIED | Map Server + AMCL + Costmaps + Navfn + DWB + BT Navigator. 11/11 tests pass: dynamic TF, path planning (80 waypoints), autonomous navigation to |
| Phase 8: Autonomous Exploration | VERIFIED | SLAM Toolbox + SLAM-Nav2 + frontier_exploration package. 30/30 tests pass (14 unit + 16 integration). Autonomous displacement maps/autonomous_exploration_map, RViz screenshot captured. |