System documentation for the autonomous mobile robot (TurtleBot3 Burger) designed for smart warehouse intralogistics.
The software system is built on ROS 2 Humble running on the Raspberry Pi 4B. It consists of a central mission controller FSM, a standalone ArUco detection pipeline, a hardware launcher controller, and the standard TurtleBot3/Nav2 stack components.
| Package | Description |
|---|---|
auto_nav |
Primary package containing the mission controller, exploration FSM, and launch files |
py_pubsub |
Utility package for basic ROS 2 publisher/subscriber testing |
testbed_pkg |
Testbed package for early assignment exercises |
turtlebot3_simulations |
Standard TurtleBot3 Gazebo simulation environment |
| Executable / Script | Entry Point | Run Location | Purpose |
|---|---|---|---|
mission_controller |
auto_nav.exploration_fsm:main |
Laptop (via launch file) | Central mission FSM β orchestrates exploration, docking, and delivery |
mission_gui |
auto_nav.mission_gui:main |
Laptop (manual) | Tkinter-based GUI for real-time mission monitoring |
aruco_live.py |
Standalone script | RPi (via SSH) | Camera capture, ArUco detection, pose estimation, ROS 2 publishing |
ball_launcher.py |
Standalone script | RPi (via SSH) | ROS 2 services for flywheel and servo hardware control |
aruco_dock.py |
Standalone script | Laptop (manual) | Standalone docking test β Nav2 + cmd_vel approach to a single marker |
station_b_launcher.py |
Standalone script | Laptop (manual) | Standalone Station B fire sequence test (assumes already docked) |
system_test.py |
Standalone script | Laptop (manual) | Pre-flight integration test with Tkinter GUI |
bringup_all.launch.py |
Launch file | Laptop | Unified launch: Cartographer β Nav2 β Mission FSM (event-driven) |
exploration_fsm.py)
System-level navigation logic showing the full mission FSM from initialisation through exploration, docking, and delivery.
The UltimateMissionController is a single ROS 2 node that acts as the orchestrator for the entire mission. It manages high-level phase transitions and coordinates between all subsystems. The FSM follows this sequence:
The controller exits early from exploration as soon as all required markers (Station A and B) are detected.
| Parameter | Value | Description |
|---|---|---|
TARGET_DISTANCE |
0.10 m | Final dock distance from marker |
NAV2_APPROACH_DISTANCE |
0.35 m | Runway distance for live marker approach |
YAML_APPROACH_DISTANCE |
0.60 m | Coarse approach distance using stored pose |
MAX_DOCK_RETRIES |
3 | Maximum docking attempts per station |
UNDOCK_DISTANCE |
0.30 m | Reverse distance after Station A delivery |
STATION_A_FIRE_DELAYS |
[6.0, 9.0, 1.0] | Team-specific timing delays (seconds before each ball) |
STATION_B_BALLS |
3 | Number of balls to fire at Station B |
TRIGGER_COOLDOWN |
5.0 s | Wait after firing for trigger marker to clear |
EXPLORATION_TIMEOUT |
600 s | Maximum time for explore_lite |
INITIAL_BFS_DURATION |
15 s | Time budget for initial BFS sweep |
FRONTIER_BLACKLIST_TTL |
90 s | Time-decaying blacklist entry lifetime |
FRONTIER_BLACKLIST_RADIUS |
0.30 m | Exclusion radius around failed frontier goals |
FRONTIER_HOP_DISTANCE |
0.60 m | Maximum travel per frontier cleanup hop |
| Parameter | Value | Description |
|---|---|---|
K_LINEAR |
0.3 m/s per m | Proportional gain for forward velocity |
K_ANGULAR |
1.5 rad/s per m | Proportional gain for angular correction |
MAX_LINEAR |
0.08 m/s | Maximum forward speed during approach |
MAX_ANGULAR |
0.50 rad/s | Maximum angular speed during alignment |
ALIGN_TOL_A |
0.03 m | Lateral tolerance for Station A |
ALIGN_TOL_B |
0.01 m | Lateral tolerance for Station B (tighter for moving target) |
BLIND_THRESHOLD |
0.20 m | cam_z below which camera detection is unreliable |
LOST_MARKER_S |
3.0 s | Tolerated gap before declaring marker lost |
| Stage | Strategy | Purpose |
|---|---|---|
| Phase 1a | Timed BFS Coverage Sweep | Rapid initial map seeding across known free space (15 s budget) |
| Phase 1b | explore_lite (frontier-based) | Systematic frontier exploration with up to 600 s timeout |
| Phase 1c | Frontier Cleanup (short-hop BFS) | Targeted cleanup of remaining frontiers that explore_lite missed |
| Phase 2 | Full Coverage Sweep | Exhaustive BFS visit of every reachable free cell as last resort |
Robustness features: time-decaying blacklist (TTL = 90 s, radius = 0.30 m) prevents oscillation; costmap clearance checking (0.22 m) ensures navigable targets; recovery spins (360Β°) trigger after 3 consecutive failures; frontier clustering groups connected cells and snaps goals to reachable centroids.
Google Cartographer fuses three data sources for real-time SLAM:
| Source | Purpose |
|---|---|
| LDS-02 LiDAR | 360Β° range measurements for scan matching and map construction |
| Wheel Encoders | Odometry estimates for inter-scan motion prediction |
| IMU | Inertial data for orientation refinement and drift correction |
Map output: occupancy grid at 0.05 m/cell resolution β free (0), occupied (100), unknown (-1) β published on /map.
| Component | Selection | Role |
|---|---|---|
| Global Planner | NavFn (A*) | Shortest collision-free path through global costmap |
| Local Controller | DWB (Dynamic Window Approach) | Real-time velocity commands for obstacle avoidance |
| Costmap | Global + Local layers | Inflated obstacle layers for safe path planning |
| Recovery Behaviors | Spin, BackUp, Wait | Automated recovery when the robot gets stuck |
Key burger.yaml parameters: xy_goal_tolerance: 0.25, controller_frequency: 10.0 Hz, robot_radius: 0.17 m (local) / 0.1 m (global), inflation_radius: 0.25 m, cost_scaling_factor: 1.5.
Cartographer over SLAM Toolbox: Superior map quality critical for docking alignment; higher CPU load acceptable on RPi 4B.
DWB over MPPI: Proven reliability in indoor corridors with lower computational overhead; response latency consistently under 100 ms. MPPI offers smoother trajectories in open spaces but adds unnecessary complexity for structured maze corridors.
aruco_live.py)cv2.aruco.ArucoDetector with DICT_6X6_250 identifies marker boundaries.cv2.solvePnP with SOLVEPNP_IPPE_SQUARE extracts rotation vector (rvec) and translation vector (tvec) from the markerβs four corner points and the camera calibration matrix (loaded from .npz file).cv2.Rodrigues β unit quaternion (x, y, z, w) using Shepperd trace method./aruco/markers as visualization_msgs/MarkerArray.Camera intrinsic matrix (K) and distortion coefficients are loaded from /home/ubuntu/calibration.npz. The marker object points are defined as a 4-point square at the physical marker size (5 cm default).
When the mission controller receives a marker, it transforms camera-frame coordinates to map-frame:
map β base_link TF to get robot pose and yaw.(map_x, map_y, normal_yaw) in detected markers dictionary.Stage 1 β Coarse Nav2 Approach: Navigate to standoff point 0.6 m from stored marker position along its normal direction using Nav2 global planner.
Stage 2 β Live Marker Acquisition: Wait for fresh camera sighting (360Β° spin search if not visible). Update pose to correct SLAM drift. New Nav2 goal at 0.35 m from live position.
| Stage 3 β Visual Servo (cmd_vel): Three sub-phases β Align (rotate until | cam_x | < tolerance), Drive (forward + angular correction until blind threshold), Dead-reckon (fixed speed through camera blind zone to reach 0.10 m target). |
/start_flywheel./fire_ball./stop_flywheel.ball_launcher.py)Runs on the RPi as a ROS 2 node exposing three services:
| Service | Behaviour |
|---|---|
/start_flywheel |
Sets both Motor A and Motor B to forward(1.0) via gpiozero.Motor |
/fire_ball |
Triggers servo actuation (placeholder β servo implementation pending) |
/stop_flywheel |
Calls stop() on both motors |
GPIO configuration: Motor A (fwd=23, bwd=24, en=13), Motor B (fwd=22, bwd=27, en=12). Graceful degradation to simulation mode if gpiozero is not available.
βββ docs/ # Documentation markdown files
β βββ challenge.md # Problem definition and requirements
β βββ general-system.md # System architecture overview
β βββ software.md # Software subsystem documentation
β βββ docking.md # Docking & delivery subsystem
β βββ improvements.md # Areas for improvement
β βββ assets/ # Diagrams and images
βββ software/
β βββ Navigation/Params/burger.yaml # Nav2 parameter configuration
β βββ docking/
β β βββ local/
β β β βββ aruco_dock.py # Standalone docking test (laptop)
β β β βββ aruco_dock_and_launch_test.py
β β β βββ aruco_dock_moving.py # Moving target docking test
β β β βββ station_b_launcher.py # Standalone Station B fire test
β β βββ rpi/
β β βββ aruco_live.py # ArUco detection (runs on RPi)
β β βββ ball_launcher.py # Hardware launcher controller (RPi)
β βββ system_test.py # Pre-flight integration test with GUI
βββ src/
β βββ auto_nav/ # Primary ROS 2 package
β β βββ auto_nav/
β β β βββ exploration_fsm.py # Mission controller FSM (1368 lines)
β β β βββ mission_gui.py # Tkinter mission monitoring GUI
β β β βββ r2auto_nav.py # Earlier navigation prototype
β β β βββ r2mover.py # Basic movement node
β β β βββ r2moverotate.py # Move and rotate node
β β β βββ r2occupancy.py # Occupancy grid utilities
β β β βββ r2occupancy2.py # Occupancy grid utilities v2
β β β βββ r2scanner.py # LiDAR scanner utilities
β β βββ launch/
β β β βββ bringup_all.launch.py # Unified launch file
β β βββ package.xml
β β βββ setup.py
β βββ py_pubsub/ # Basic pub/sub test package
β βββ testbed_pkg/ # Assignment testbed package
β βββ turtlebot3_simulations/ # Standard TurtleBot3 simulation
βββ Electrical/ # Electrical subsystem documentation
β βββ Electrical.md
β βββ assets/images/ # Circuit and architecture diagrams
βββ Mechanical/
βββ CAD Files/ # SolidWorks parts and assemblies
# Install dependencies
rosdep install --from-paths src --ignore-src -r -y
# Build workspace
colcon build --symlink-install
# Source the workspace
source install/setup.bash
python3 main_launch.py (starts aruco_live.py and ball_launcher.py).ros2 run auto_nav mission_gui (start monitoring GUI).ros2 launch auto_nav bringup_all.launch.py (start mission).After modifying burger.yaml or mission controller parameters, rebuild:
colcon build --packages-select auto_nav
source install/setup.bash
The controller publishes the current mission phase on /mission_phase as a String topic. Phase transitions are logged to the ROS 2 logger. At Station B, additional diagnostics track trigger detection count and balls fired.