# notgizmo1/drone-guidance architecture

> Architecture diagram of the GitHub repository notgizmo1/drone-guidance, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/notgizmo1/drone-guidance
- Repository: https://github.com/notgizmo1/drone-guidance

## Overview

Terminal Guidance is a Raspberry Pi companion-computer application for detecting and tracking targets, sending MAVLink control to an autopilot, and streaming annotated video to QGroundControl. The principal workflow runs through the application coordinator: camera frames enter detection and tracking, tracking output can drive control, and video is streamed to a ground station. The README documents watchdogs and a browser interface; the source index supports the coordinator’s component references, but excerpts do not expose every runtime call. The bundled QGroundControl source is a separate ground-station product, so it is shown only as the documented video recipient.

Main entry points: [`src/app.py`](https://github.com/notgizmo1/drone-guidance/blob/main/src/app.py) (Application coordinator), [`src/core/pipeline.py`](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/pipeline.py) (Detection pipeline), [`src/web/app.py`](https://github.com/notgizmo1/drone-guidance/blob/main/src/web/app.py) (Web interface), [`src/core/mavlink_controller.py`](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/mavlink_controller.py) (MAVLink controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and vision"]
  node_camera["Camera capture<br/>[camera.py]"]
  node_pipeline["Detection pipeline<br/>[pipeline.py]"]
  node_detector["YOLO detector<br/>[detector.py]"]
  node_tracker["Target tracker<br/>[tracker.py]"]
  node_roi["ROI tracker<br/>[roi_tracker.py]"]
  node_motion["Motion compensation"]
end

subgraph group_coordination["Application services"]
  node_app["Application coordinator<br/>[app.py]"]
  node_pid["PID controller<br/>[pid.py]"]
  node_config["Configuration<br/>[config.py]"]
  node_logging["Logging<br/>[logging.py]"]
end

subgraph group_interfaces["User and vehicle interfaces"]
  node_web["Web interface<br/>[app.py]"]
  node_mavlink["MAVLink controller"]
  node_streamer["Video streamer<br/>[streamer.py]"]
end

node_operator(("Browser operator"))
node_autopilot(("ArduPilot / PX4"))
node_qgc(("QGroundControl"))

node_operator -->|"controls"| node_web
node_web -->|"configures"| node_app
node_app -->|"coordinates"| node_camera
node_app -->|"coordinates"| node_pipeline
node_pipeline -->|"runs detection"| node_detector
node_pipeline -->|"uses tracking"| node_tracker
node_app -->|"coordinates"| node_tracker
node_app -->|"coordinates"| node_roi
node_app -->|"coordinates"| node_motion
node_app -->|"coordinates"| node_pid
node_app -->|"sends commands"| node_mavlink
node_mavlink -.->|"MAVLink control"| node_autopilot
node_app -->|"coordinates"| node_streamer
node_streamer -->|"streams video"| node_qgc
node_app -->|"loads settings"| node_config
node_app -->|"logs events"| node_logging
node_web -->|"exposes logs"| node_logging

click node_web "https://github.com/notgizmo1/drone-guidance/blob/main/src/web/app.py"
click node_app "https://github.com/notgizmo1/drone-guidance/blob/main/src/app.py"
click node_camera "https://github.com/notgizmo1/drone-guidance/blob/main/src/core/camera.py"
click node_pipeline "https://github.com/notgizmo1/drone-guidance/blob/main/src/core/pipeline.py"
click node_detector "https://github.com/notgizmo1/drone-guidance/blob/main/src/core/detector.py"
click node_tracker "https://github.com/notgizmo1/drone-guidance/blob/main/src/core/tracker.py"
click node_roi "https://github.com/notgizmo1/drone-guidance/blob/main/src/core/roi_tracker.py"
click node_motion "https://github.com/notgizmo1/drone-guidance/blob/main/src/core/motion_compensation.py"
click node_pid "https://github.com/notgizmo1/drone-guidance/blob/main/src/core/pid.py"
click node_mavlink "https://github.com/notgizmo1/drone-guidance/blob/main/src/core/mavlink_controller.py"
click node_streamer "https://github.com/notgizmo1/drone-guidance/blob/main/src/core/streamer.py"
click node_config "https://github.com/notgizmo1/drone-guidance/blob/main/src/utils/config.py"
click node_logging "https://github.com/notgizmo1/drone-guidance/blob/main/src/utils/logging.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_camera,node_pipeline,node_detector,node_tracker,node_roi,node_motion,node_operator toneBlue
class node_app,node_pid,node_config,node_logging toneAmber
class node_web,node_mavlink,node_streamer toneMint
class node_autopilot,node_qgc toneIndigo
```

## Components

### Capture and vision

- [Camera capture](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/camera.py): `src/core/camera.py`
- [Detection pipeline](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/pipeline.py): `src/core/pipeline.py`
- [YOLO detector](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/detector.py): `src/core/detector.py`
- [Target tracker](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/tracker.py): `src/core/tracker.py`
- [ROI tracker](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/roi_tracker.py): `src/core/roi_tracker.py`
- [Motion compensation](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/motion_compensation.py): `src/core/motion_compensation.py`

### Application services

- [Application coordinator](https://github.com/notgizmo1/drone-guidance/blob/main/src/app.py): `src/app.py`
- [PID controller](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/pid.py): `src/core/pid.py`
- [Configuration](https://github.com/notgizmo1/drone-guidance/blob/main/src/utils/config.py): `src/utils/config.py`
- [Logging](https://github.com/notgizmo1/drone-guidance/blob/main/src/utils/logging.py): `src/utils/logging.py`

### User and vehicle interfaces

- [Web interface](https://github.com/notgizmo1/drone-guidance/blob/main/src/web/app.py): `src/web/app.py`
- [MAVLink controller](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/mavlink_controller.py): `src/core/mavlink_controller.py`
- [Video streamer](https://github.com/notgizmo1/drone-guidance/blob/main/src/core/streamer.py): `src/core/streamer.py`

### Other components

- **Browser operator**
- **ArduPilot / PX4**
- **QGroundControl**

## Connections

- Browser operator → Web interface: controls (evidence: `src/web/app.py`)
- Web interface → Application coordinator: configures (evidence: `src/web/app.py`)
- Application coordinator → Camera capture: coordinates (evidence: `src/app.py`)
- Application coordinator → Detection pipeline: coordinates (evidence: `src/app.py`)
- Detection pipeline → YOLO detector: runs detection (evidence: `src/core/pipeline.py`)
- Detection pipeline → Target tracker: uses tracking (evidence: `src/core/pipeline.py`)
- Application coordinator → Target tracker: coordinates (evidence: `src/app.py`)
- Application coordinator → ROI tracker: coordinates (evidence: `src/app.py`)
- Application coordinator → Motion compensation: coordinates (evidence: `src/app.py`)
- Application coordinator → PID controller: coordinates (evidence: `src/app.py`)
- Application coordinator → MAVLink controller: sends commands (evidence: `src/app.py`)
- MAVLink controller → ArduPilot / PX4: MAVLink control
- Application coordinator → Video streamer: coordinates (evidence: `src/app.py`)
- Video streamer → QGroundControl: streams video (evidence: `README.md`)
- Application coordinator → Configuration: loads settings (evidence: `src/app.py`)
- Application coordinator → Logging: logs events (evidence: `src/app.py`)
- Web interface → Logging: exposes logs (evidence: `src/web/app.py`)
