How naushikmaurya/uav-systems-integration-autonomous-navigation-2026- works
1. Purpose and Entry Points
This is an autonomous multi-stop drone delivery control system. It optimizes delivery order and paths, monitors flight/battery state, controls payload servos, and exposes a ground-station dashboard.
Primary startup is main.py, which selects simulation or real serial/MAVLink operation and starts the backend. Operational configuration is centralized in config.py. The dashboard is served from dashboard/index.html.
2. Mission Orchestration Boundary
server/mission_manager.py is the mission lifecycle coordinator: it owns configured waypoints, mission start/abort/return-to-home/emergency-land actions, delivery progression, and event/state reporting. It connects route planning and vehicle commands rather than embedding either concern.
server/api_server.py is the ground-station boundary. It provides REST mission-control/status endpoints and a telemetry WebSocket, translating dashboard requests into mission-manager actions and publishing current state.
Paths: server/mission_manager.py, server/api_server.py, main.py.
3. Route Planning Pipeline
Mission waypoint input is first ordered by priority/weight/distance through the TSP solver, then converted to obstacle-aware segments through A* pathfinding. Dynamic routing reevaluates the active plan periodically and after deliveries based on battery/signal conditions.
Core planning components:
• core/tsp_solver.py — multi-delivery visit ordering.
• core/astar_pathfinder.py — collision-free grid path planning.
• core/dynamic_router.py — reroute policy and route adaptation.
• core/obstacle_avoidance.py — obstacle-related planning/detection integration point.
The main boundary is planner output versus flight execution: planners compute route/waypoint decisions; MAVLink is responsible for vehicle-level command transport.
4. Vehicle, Telemetry, and Safety Control
hardware/mavlink_interface.py abstracts Pixhawk/ArduPilot communication over MAVLink, including real SiK-radio serial links or simulation-compatible operation. It is the critical control boundary for mission upload, flight modes, RTH, and landing.
hardware/telemetry_handler.py collects/normalizes vehicle telemetry for backend consumers. hardware/battery_monitor.py applies warning, RTH, and emergency-landing thresholds; its output can force mission-manager/router decisions. hardware/servo_controller.py executes per-payload release control. hardware/obstacle_detector.py represents onboard sensor-based obstacle input.
Paths: hardware/mavlink_interface.py, hardware/telemetry_handler.py, hardware/battery_monitor.py.
5. End-to-End Control and Data Flow
1. Dashboard users configure/start/control a mission through HTTP in dashboard/index.html.
2. server/api_server.py delegates lifecycle changes to server/mission_manager.py.
3. The manager invokes core/tsp_solver.py, core/astar_pathfinder.py, and core/dynamic_router.py to produce or revise executable waypoint plans.
4. hardware/mavlink_interface.py sends commands to the flight controller; hardware/servo_controller.py releases payloads after delivery arrival handling.
5. MAVLink and local hardware state flow through telemetry/battery handlers back to the manager/server.
6. The API server pushes status to browser clients over /ws/telemetry at the configured cadence.
6. Runtime, Infrastructure, and External Dependencies
The runtime is Python 3.9+ with FastAPI/Uvicorn for the local ground-station backend and a single-page Leaflet-based browser dashboard. Production hardware is a Pixhawk Cube running ArduPilot, connected via MAVLink serial and paired 915 MHz SiK radios; a Raspberry Pi is the intended companion computer. Simulation is supported by the same entry path without physical hardware.
Model artifacts yolov8n.onnx and yolov8n.pt indicate optional YOLOv8-based vision/obstacle validation, with supporting operational scripts under scripts/.
Main entry points: mission_manager.py Mission Manager · api_server.py API Server · astar_pathfinder.py Path Planning · telemetry_handler.py Telemetry Handler
Components 15
Ground Station
- Application Entry · Selects simulation or real MAVLink operation.
main.py - Operational Config
config.py - Ground Dashboard · Leaflet-based operator interface.
dashboard/index.html
Mission Control
- API Server · Serves mission APIs and telemetry WebSocket.
server/api_server.py - Mission Manager · Owns mission progression, abort, RTH, and emergency actions.
server/mission_manager.py
Route Planning
- Delivery Ordering
core/tsp_solver.py - Path Planning
core/astar_pathfinder.py - Dynamic Router · Reevaluates routes after deliveries and changing conditions.
core/dynamic_router.py - Obstacle Planning
core/obstacle_avoidance.py
Vehicle & Safety
- MAVLink Interface · Abstracts real serial/radio and simulation-compatible flight control.
hardware/mavlink_interface.py - Telemetry Handler
hardware/telemetry_handler.py - Battery Monitor · Applies warning, RTH, and emergency landing thresholds.
hardware/battery_monitor.py - Servo Controller
hardware/servo_controller.py - Obstacle Detector · Provides onboard obstacle observations.
hardware/obstacle_detector.py - Pixhawk / ArduPilot
Connections 21
- Application Entry → API Server: starts backend
- Operational Config → Application Entry: runtime settings
- Ground Dashboard → API Server: HTTP mission control
- API Server → Ground Dashboard: /ws/telemetry
- API Server → Mission Manager: lifecycle actions
- Mission Manager → Delivery Ordering: orders deliveries
- Delivery Ordering → Path Planning: ordered stops
- Path Planning → Mission Manager: obstacle-aware plan
- Mission Manager → Dynamic Router: replan decisions
- Dynamic Router → Path Planning: revised segments
- Obstacle Planning → Path Planning: obstacle constraints
- Obstacle Detector → Obstacle Planning: obstacle input
- Mission Manager → MAVLink Interface: mission and flight commands
- Mission Manager → Servo Controller: delivery release
- MAVLink Interface → Pixhawk / ArduPilot: MAVLink serial/radio
- Pixhawk / ArduPilot → Telemetry Handler: vehicle state
- Telemetry Handler → Mission Manager: normalized status
- Telemetry Handler → Battery Monitor: battery readings
- Battery Monitor → Mission Manager: safety actions
- Battery Monitor → Dynamic Router: reroute conditions
- Mission Manager → API Server: mission state