# droneai-sitlab/tellodroneai_v2 architecture

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

- Interactive diagram: https://gitdiagram.com/droneai-sitlab/tellodroneai_v2
- Repository: https://github.com/droneai-sitlab/tellodroneai_v2

## Overview

TelloDroneAI_v2 is a Flask dashboard for piloting and monitoring a DJI Tello. Users connect WiFi, start the video stream, and issue manual, voice, or OCR/LLM-assisted commands; the backend queues commands for safety validation and execution. Video is read from the drone, processed for MJPEG display and optional OCR, while photos and clips can be saved locally. The graph reflects README-described capabilities and sampled call relationships; voice-to-command and OCR/LLM-to-queue wiring is not shown in the excerpts, so those links are marked unverified.

Main entry points: [`app.py`](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/app.py) (Flask API and orchestrator), [`static/js/main.js`](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/static/js/main.js) (Dashboard UI), [`drone/command_executor.py`](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/command_executor.py) (Command validation and execution), [`drone/media_capture.py`](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/media_capture.py) (Photo and video capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web dashboard"]
  node_dashboard["Dashboard UI<br/>[main.js]"]
  node_page["Dashboard page<br/>[index.html]"]
  node_backend["Flask API and orchestrator<br/>[app.py]"]
end

subgraph group_control["Drone control"]
  node_wifi["WiFi connection<br/>[wifi.py]"]
  node_executor["Command validation and execution"]
end

subgraph group_vision["Video and vision"]
  node_reader["Tello stream reader<br/>[frame_reader.py]"]
  node_processor["Frame processor<br/>[frame_processor.py]"]
  node_ocr["OCR sender<br/>[ocr_sender.py]"]
end

subgraph group_automation["Command automation"]
  node_ollama["Ollama client<br/>[ollama_client.py]"]
  node_parser["Text command parser<br/>[chat_parser.py]"]
  node_voice["Offline voice recognition<br/>[voice_module.py]"]
  node_queue["Priority command queue<br/>[app.py]"]
end

subgraph group_media["Media capture"]
  node_capture["Photo and video capture<br/>[media_capture.py]"]
  node_files[("Local captures")]
end

node_user(("Operator"))
node_ocrserver["OCR service"]
node_ollamaserver["Ollama service"]
node_drone["DJI Tello"]

node_user -->|"controls"| node_dashboard
node_dashboard -.->|"renders"| node_page
node_dashboard -->|"calls API"| node_backend
node_backend -->|"manages WiFi"| node_wifi
node_backend -->|"controls stream"| node_reader
node_reader -->|"reads video"| node_drone
node_backend -->|"processes frames"| node_processor
node_backend -->|"sends frames"| node_ocr
node_ocr -->|"posts frames"| node_ocrserver
node_ocr -->|"provides OCR text"| node_ollama
node_ollama -->|"requests inference"| node_ollamaserver
node_ollama -.->|"proposes commands"| node_queue
node_dashboard -.->|"submits text"| node_parser
node_parser -.->|"parses commands"| node_queue
node_dashboard -.->|"sends audio"| node_voice
node_voice -.->|"submits commands"| node_queue
node_backend -->|"dispatches commands"| node_queue
node_queue -->|"runs commands"| node_executor
node_executor -->|"controls flight"| node_drone
node_executor -->|"gets Tello handle"| node_reader
node_executor -->|"runs media commands"| node_capture
node_capture -->|"reads frames"| node_reader
node_capture -->|"processes frames"| node_processor
node_capture -->|"saves media"| node_files

click node_dashboard "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/static/js/main.js"
click node_page "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/templates/index.html"
click node_backend "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/app.py"
click node_wifi "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/wifi.py"
click node_reader "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/frame_reader.py"
click node_processor "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/frame_processor.py"
click node_ocr "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/ocr_sender.py"
click node_ollama "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/ollama_client.py"
click node_parser "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/chat_parser.py"
click node_voice "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/vosk-voice/voice_module.py"
click node_queue "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/app.py"
click node_executor "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/command_executor.py"
click node_capture "https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/media_capture.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_dashboard,node_page,node_backend toneBlue
class node_wifi,node_executor toneAmber
class node_reader,node_processor,node_ocr toneMint
class node_ollama,node_parser,node_voice,node_queue toneRose
class node_capture,node_files,node_user,node_ocrserver,node_ollamaserver,node_drone toneIndigo
```

## Components

### Web dashboard

- [Dashboard UI](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/static/js/main.js): `static/js/main.js`
- [Dashboard page](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/templates/index.html): `templates/index.html`
- [Flask API and orchestrator](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/app.py): `app.py`

### Drone control

- [WiFi connection](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/wifi.py): `drone/wifi.py`
- [Command validation and execution](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/command_executor.py): `drone/command_executor.py`

### Video and vision

- [Tello stream reader](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/frame_reader.py): `drone/frame_reader.py`
- [Frame processor](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/frame_processor.py): `drone/frame_processor.py`
- [OCR sender](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/ocr_sender.py): `drone/ocr_sender.py`

### Command automation

- [Ollama client](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/ollama_client.py): `drone/ollama_client.py`
- [Text command parser](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/chat_parser.py): `drone/chat_parser.py`
- [Offline voice recognition](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/vosk-voice/voice_module.py): `vosk-voice/voice_module.py`
- [Priority command queue](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/app.py): `app.py`

### Media capture

- [Photo and video capture](https://github.com/droneai-sitlab/tellodroneai_v2/blob/main/drone/media_capture.py): `drone/media_capture.py`
- **Local captures**

### Other components

- **Operator**
- **OCR service**
- **Ollama service**
- **DJI Tello**

## Connections

- Operator → Dashboard UI: controls (evidence: `README.md`)
- Dashboard UI → Dashboard page: renders
- Dashboard UI → Flask API and orchestrator: calls API (evidence: `static/js/main.js`)
- Flask API and orchestrator → WiFi connection: manages WiFi (evidence: `app.py`)
- Flask API and orchestrator → Tello stream reader: controls stream (evidence: `app.py`)
- Tello stream reader → DJI Tello: reads video (evidence: `drone/frame_reader.py`)
- Flask API and orchestrator → Frame processor: processes frames (evidence: `README.md`)
- Flask API and orchestrator → OCR sender: sends frames (evidence: `README.md`)
- OCR sender → OCR service: posts frames (evidence: `drone/ocr_sender.py`)
- OCR sender → Ollama client: provides OCR text (evidence: `README.md`)
- Ollama client → Ollama service: requests inference (evidence: `drone/ollama_client.py`)
- Ollama client → Priority command queue: proposes commands (evidence: `app.py`)
- Dashboard UI → Text command parser: submits text
- Text command parser → Priority command queue: parses commands (evidence: `app.py`)
- Dashboard UI → Offline voice recognition: sends audio
- Offline voice recognition → Priority command queue: submits commands
- Flask API and orchestrator → Priority command queue: dispatches commands (evidence: `README.md`)
- Priority command queue → Command validation and execution: runs commands (evidence: `README.md`)
- Command validation and execution → DJI Tello: controls flight (evidence: `README.md`)
- Command validation and execution → Tello stream reader: gets Tello handle (evidence: `drone/command_executor.py`)
- Command validation and execution → Photo and video capture: runs media commands (evidence: `drone/command_executor.py`)
- Photo and video capture → Tello stream reader: reads frames (evidence: `drone/media_capture.py`)
- Photo and video capture → Frame processor: processes frames (evidence: `drone/media_capture.py`)
- Photo and video capture → Local captures: saves media (evidence: `README.md`)
