# naushikmaurya/uav-systems-integration-autonomous-navigation-2026- architecture

> Architecture diagram of the GitHub repository naushikmaurya/uav-systems-integration-autonomous-navigation-2026-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-
- Repository: https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-

## Overview

#### 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: [`server/mission_manager.py`](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/server/mission_manager.py) (Mission Manager), [`server/api_server.py`](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/server/api_server.py) (API Server), [`core/astar_pathfinder.py`](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/core/astar_pathfinder.py) (Path Planning), [`hardware/telemetry_handler.py`](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/telemetry_handler.py) (Telemetry Handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ground["Ground Station"]
  node_main["Application Entry<br/>Python runtime<br/>[main.py]"]
  node_config["Operational Config<br/>configuration<br/>[config.py]"]
  node_dashboard["Ground Dashboard<br/>browser SPA<br/>[index.html]"]
end

subgraph group_mission["Mission Control"]
  node_api["API Server<br/>FastAPI boundary<br/>[api_server.py]"]
  node_manager["Mission Manager<br/>lifecycle coordinator<br/>[mission_manager.py]"]
end

subgraph group_planning["Route Planning"]
  node_tsp["Delivery Ordering<br/>TSP solver<br/>[tsp_solver.py]"]
  node_astar["Path Planning<br/>A* planner"]
  node_router["Dynamic Router<br/>reroute policy<br/>[dynamic_router.py]"]
  node_obstacle_planning["Obstacle Planning<br/>planning integration"]
end

subgraph group_vehicle["Vehicle &amp; Safety"]
  node_mavlink["MAVLink Interface<br/>vehicle command transport"]
  node_telemetry["Telemetry Handler<br/>telemetry normalization"]
  node_battery["Battery Monitor<br/>safety policy<br/>[battery_monitor.py]"]
  node_servo["Servo Controller<br/>payload actuator"]
  node_detector["Obstacle Detector<br/>sensor input"]
  node_flight_controller{{"Pixhawk / ArduPilot<br/>external flight controller"}}
end

node_main -->|"starts backend"| node_api
node_config -->|"runtime settings"| node_main
node_dashboard -->|"HTTP mission control"| node_api
node_api -->|"/ws/telemetry"| node_dashboard
node_api -->|"lifecycle actions"| node_manager
node_manager -->|"orders deliveries"| node_tsp
node_tsp -->|"ordered stops"| node_astar
node_astar -->|"obstacle-aware plan"| node_manager
node_manager -->|"replan decisions"| node_router
node_router -->|"revised segments"| node_astar
node_obstacle_planning -->|"obstacle constraints"| node_astar
node_detector -->|"obstacle input"| node_obstacle_planning
node_manager -->|"mission and flight commands"| node_mavlink
node_manager -->|"delivery release"| node_servo
node_mavlink -->|"MAVLink serial/radio"| node_flight_controller
node_flight_controller -->|"vehicle state"| node_telemetry
node_telemetry -->|"normalized status"| node_manager
node_telemetry -->|"battery readings"| node_battery
node_battery -->|"safety actions"| node_manager
node_battery -->|"reroute conditions"| node_router
node_manager -->|"mission state"| node_api

click node_main "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/main.py"
click node_config "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/config.py"
click node_dashboard "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/dashboard/index.html"
click node_api "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/server/api_server.py"
click node_manager "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/server/mission_manager.py"
click node_tsp "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/core/tsp_solver.py"
click node_astar "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/core/astar_pathfinder.py"
click node_router "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/core/dynamic_router.py"
click node_obstacle_planning "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/core/obstacle_avoidance.py"
click node_mavlink "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/mavlink_interface.py"
click node_telemetry "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/telemetry_handler.py"
click node_battery "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/battery_monitor.py"
click node_servo "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/servo_controller.py"
click node_detector "https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/obstacle_detector.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_config,node_dashboard toneBlue
class node_api,node_manager toneAmber
class node_tsp,node_astar,node_router,node_obstacle_planning toneMint
class node_mavlink,node_telemetry,node_battery,node_servo,node_detector,node_flight_controller toneRose
```

## Components

### Ground Station

- [Application Entry](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/main.py): Python runtime · Selects simulation or real MAVLink operation. · `main.py`
- [Operational Config](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/config.py): configuration · `config.py`
- [Ground Dashboard](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/dashboard/index.html): browser SPA · Leaflet-based operator interface. · `dashboard/index.html`

### Mission Control

- [API Server](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/server/api_server.py): FastAPI boundary · Serves mission APIs and telemetry WebSocket. · `server/api_server.py`
- [Mission Manager](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/server/mission_manager.py): lifecycle coordinator · Owns mission progression, abort, RTH, and emergency actions. · `server/mission_manager.py`

### Route Planning

- [Delivery Ordering](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/core/tsp_solver.py): TSP solver · `core/tsp_solver.py`
- [Path Planning](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/core/astar_pathfinder.py): A* planner · `core/astar_pathfinder.py`
- [Dynamic Router](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/core/dynamic_router.py): reroute policy · Reevaluates routes after deliveries and changing conditions. · `core/dynamic_router.py`
- [Obstacle Planning](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/core/obstacle_avoidance.py): planning integration · `core/obstacle_avoidance.py`

### Vehicle & Safety

- [MAVLink Interface](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/mavlink_interface.py): vehicle command transport · Abstracts real serial/radio and simulation-compatible flight control. · `hardware/mavlink_interface.py`
- [Telemetry Handler](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/telemetry_handler.py): telemetry normalization · `hardware/telemetry_handler.py`
- [Battery Monitor](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/battery_monitor.py): safety policy · Applies warning, RTH, and emergency landing thresholds. · `hardware/battery_monitor.py`
- [Servo Controller](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/servo_controller.py): payload actuator · `hardware/servo_controller.py`
- [Obstacle Detector](https://github.com/naushikmaurya/uav-systems-integration-autonomous-navigation-2026-/blob/main/hardware/obstacle_detector.py): sensor input · Provides onboard obstacle observations. · `hardware/obstacle_detector.py`
- **Pixhawk / ArduPilot**: external flight controller

## Connections

- 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
