# lmg0612/ai_powered_autonomous_mobility_ai_pam architecture

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

- Interactive diagram: https://gitdiagram.com/lmg0612/ai_powered_autonomous_mobility_ai_pam
- Repository: https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam

## Overview

This repository is a research-oriented voice-controlled drone ground station, with parallel simulator, API, and mission-planning experiments. The principal workflow is audio upload or capture, Whisper transcription, LLM command generation, command execution, then job-status/log review. The graph also retains the documented Tello fine-tuning and PDDL planning branches. Some subsystem links rely on README descriptions; unsampled internals are not inferred beyond those statements.

Main entry points: [`integrated-full-project/Real_UI_Last/frontend/src/App.tsx`](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/App.tsx) (Integrated control UI), [`api/main.py`](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/main.py) (API routes and jobs), [`SITL/main.py`](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/main.py) (SITL command loop), [`SITL/llm_interface.py`](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/llm_interface.py) (Gemini command generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_voice_api["Voice Command API"]
  node_api_server["API routes and jobs<br/>[main.py]"]
  node_whisper["Whisper transcription<br/>[whisper_service.py]"]
  node_command_runner["Command execution manager<br/>[command_runner.py]"]
  node_api_model["Command data models<br/>[model.py]"]
  node_drone_api["Drone command API<br/>[drone_api.py]"]
  node_web_demo["Voice demo page<br/>[app.js]"]
  node_integrated_api["Integrated API routes<br/>[api.py]"]
end

subgraph group_simulator["Drone Execution"]
  node_sitl_main["SITL command loop<br/>[main.py]"]
  node_sitl_llm["Gemini command generation<br/>[llm_interface.py]"]
  node_sitl_prompts["Command prompts<br/>[prompts.py]"]
  node_sitl_parser["JSON command parser<br/>[command_parser.py]"]
  node_sitl_control["DroneKit controls<br/>[drone_control.py]"]
  node_tello_main["Tello command loop<br/>[main.py]"]
  node_tello_llm["Tello command generation<br/>[llm_interface.py]"]
  node_tello_parser["Tello command parser<br/>[command_parser.py]"]
  node_tello_control["Tello controls<br/>[drone_control.py]"]
end

subgraph group_planning["Mission Planning"]
  node_pddl_main["PDDL mission generation<br/>[main.py]"]
  node_pddl_qwen["Qwen mission generation<br/>[main.py]"]
  node_pddl_check["Plan validation<br/>[check_pddl_real.py]"]
  node_pddl_qwen_check["Qwen plan validation<br/>[check_pddl_real.py]"]
end

subgraph group_research["Model Research"]
  node_dataset["Tello command dataset<br/>[tello_dataset.py]"]
end

subgraph group_ui["Operator Interface"]
  node_integrated_ui["Integrated control UI<br/>[App.tsx]"]
  node_pipeline_view["Pipeline summary view"]
  node_page_voice["Whisper and GPS page"]
  node_page_events["Sensor event log"]
  node_page_control["Control and video page"]
end

node_operator(("Operator"))
node_external_llm{{"Gemini service"}}
node_dronekit_sitl{{"DroneKit SITL"}}
node_tello_drone{{"Tello drone"}}
node_whisper_engine{{"Whisper engine"}}

node_operator -->|"uploads audio"| node_api_server
node_api_server -->|"transcribes audio"| node_whisper
node_whisper -->|"runs model"| node_whisper_engine
node_api_server -->|"starts jobs"| node_command_runner
node_api_server -->|"uses models"| node_api_model
node_api_server -.->|"generates commands"| node_external_llm
node_command_runner -->|"dispatches commands"| node_drone_api
node_operator -.->|"uses demo"| node_web_demo
node_operator -->|"enters command"| node_sitl_main
node_sitl_main -->|"requests commands"| node_sitl_llm
node_sitl_llm -->|"uses prompt"| node_sitl_prompts
node_sitl_llm -->|"calls Gemini"| node_external_llm
node_sitl_main -->|"passes JSON"| node_sitl_parser
node_sitl_parser -->|"dispatches controls"| node_sitl_control
node_sitl_control -->|"controls vehicle"| node_dronekit_sitl
node_operator -->|"enters command"| node_tello_main
node_tello_main -->|"requests commands"| node_tello_llm
node_tello_main -->|"passes commands"| node_tello_parser
node_tello_parser -.->|"dispatches controls"| node_tello_control
node_tello_control -.->|"controls drone"| node_tello_drone
node_operator -->|"describes mission"| node_pddl_main
node_pddl_main -.->|"creates plans"| node_pddl_check
node_operator -.->|"describes mission"| node_pddl_qwen
node_pddl_qwen -.->|"creates plans"| node_pddl_qwen_check
node_dataset -.->|"supports tuning"| node_tello_llm
node_operator -->|"uses dashboard"| node_integrated_ui
node_integrated_ui -->|"renders page"| node_page_voice
node_integrated_ui -->|"renders page"| node_page_events
node_integrated_ui -->|"renders page"| node_page_control
node_integrated_ui -->|"shows pipeline"| node_pipeline_view
node_integrated_ui -->|"uploads audio"| node_api_server
node_integrated_ui -.->|"calls API"| node_integrated_api

click node_api_server "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/main.py"
click node_whisper "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/whisper_service.py"
click node_command_runner "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/command_runner.py"
click node_api_model "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/model.py"
click node_drone_api "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/drone_api.py"
click node_web_demo "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/static/app.js"
click node_sitl_main "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/main.py"
click node_sitl_llm "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/llm_interface.py"
click node_sitl_prompts "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/prompts.py"
click node_sitl_parser "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/command_parser.py"
click node_sitl_control "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/drone_control.py"
click node_tello_main "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/tello/main.py"
click node_tello_llm "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/tello/llm_interface.py"
click node_tello_parser "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/tello/command_parser.py"
click node_tello_control "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/tello/drone_control.py"
click node_pddl_main "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/NLPDDL/uav/main.py"
click node_pddl_qwen "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/NLPDDL/uav.qwen/main.py"
click node_pddl_check "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/NLPDDL/uav/check_pddl_real.py"
click node_pddl_qwen_check "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/NLPDDL/uav.qwen/check_pddl_real.py"
click node_dataset "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/LLM/tello_dataset.py"
click node_integrated_ui "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/App.tsx"
click node_pipeline_view "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/components/PipelineCompact.tsx"
click node_page_voice "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/components/Page1WhisperGpsVideo.tsx"
click node_page_events "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/components/Page2SensorEventLog.tsx"
click node_page_control "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/components/Page3ControlVideo.tsx"
click node_integrated_api "https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/api/api.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_api_server,node_whisper,node_command_runner,node_api_model,node_drone_api,node_web_demo,node_integrated_api toneBlue
class node_sitl_main,node_sitl_llm,node_sitl_prompts,node_sitl_parser,node_sitl_control,node_tello_main,node_tello_llm,node_tello_parser,node_tello_control toneAmber
class node_pddl_main,node_pddl_qwen,node_pddl_check,node_pddl_qwen_check toneMint
class node_dataset toneRose
class node_integrated_ui,node_pipeline_view,node_page_voice,node_page_events,node_page_control,node_operator,node_external_llm,node_dronekit_sitl,node_tello_drone,node_whisper_engine toneIndigo
```

## Components

### Voice Command API

- [API routes and jobs](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/main.py): `api/main.py`
- [Whisper transcription](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/whisper_service.py): `api/whisper_service.py`
- [Command execution manager](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/command_runner.py): `api/command_runner.py`
- [Command data models](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/model.py): `api/model.py`
- [Drone command API](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/drone_api.py): `api/drone_api.py`
- [Voice demo page](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/api/static/app.js): `api/static/app.js`
- [Integrated API routes](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/api/api.py): `integrated-full-project/Real_UI_Last/api/api.py`

### Drone Execution

- [SITL command loop](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/main.py): `SITL/main.py`
- [Gemini command generation](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/llm_interface.py): `SITL/llm_interface.py`
- [Command prompts](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/prompts.py): `SITL/prompts.py`
- [JSON command parser](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/command_parser.py): `SITL/command_parser.py`
- [DroneKit controls](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/drone_control.py): `SITL/drone_control.py`
- [Tello command loop](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/tello/main.py): `SITL/tello/main.py`
- [Tello command generation](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/tello/llm_interface.py): `SITL/tello/llm_interface.py`
- [Tello command parser](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/tello/command_parser.py): `SITL/tello/command_parser.py`
- [Tello controls](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/SITL/tello/drone_control.py): `SITL/tello/drone_control.py`

### Mission Planning

- [PDDL mission generation](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/NLPDDL/uav/main.py): `NLPDDL/uav/main.py`
- [Qwen mission generation](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/NLPDDL/uav.qwen/main.py): `NLPDDL/uav.qwen/main.py`
- [Plan validation](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/NLPDDL/uav/check_pddl_real.py): `NLPDDL/uav/check_pddl_real.py`
- [Qwen plan validation](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/NLPDDL/uav.qwen/check_pddl_real.py): `NLPDDL/uav.qwen/check_pddl_real.py`

### Model Research

- [Tello command dataset](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/LLM/tello_dataset.py): `LLM/tello_dataset.py`

### Operator Interface

- [Integrated control UI](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/App.tsx): `integrated-full-project/Real_UI_Last/frontend/src/App.tsx`
- [Pipeline summary view](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/components/PipelineCompact.tsx): `integrated-full-project/Real_UI_Last/frontend/src/components/PipelineCompact.tsx`
- [Whisper and GPS page](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/components/Page1WhisperGpsVideo.tsx): `integrated-full-project/Real_UI_Last/frontend/src/components/Page1WhisperGpsVideo.tsx`
- [Sensor event log](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/components/Page2SensorEventLog.tsx): `integrated-full-project/Real_UI_Last/frontend/src/components/Page2SensorEventLog.tsx`
- [Control and video page](https://github.com/lmg0612/ai_powered_autonomous_mobility_ai_pam/blob/master/integrated-full-project/Real_UI_Last/frontend/src/components/Page3ControlVideo.tsx): `integrated-full-project/Real_UI_Last/frontend/src/components/Page3ControlVideo.tsx`

### Other components

- **Operator**
- **Gemini service**
- **DroneKit SITL**
- **Tello drone**
- **Whisper engine**

## Connections

- Operator → API routes and jobs: uploads audio (evidence: `api/main.py`)
- API routes and jobs → Whisper transcription: transcribes audio (evidence: `api/main.py`)
- Whisper transcription → Whisper engine: runs model (evidence: `api/whisper_service.py`)
- API routes and jobs → Command execution manager: starts jobs (evidence: `api/main.py`)
- API routes and jobs → Command data models: uses models (evidence: `api/main.py`)
- API routes and jobs → Gemini service: generates commands (evidence: `README.md`)
- Command execution manager → Drone command API: dispatches commands (evidence: `api/command_runner.py`)
- Operator → Voice demo page: uses demo
- Operator → SITL command loop: enters command (evidence: `SITL/main.py`)
- SITL command loop → Gemini command generation: requests commands (evidence: `SITL/main.py`)
- Gemini command generation → Command prompts: uses prompt (evidence: `SITL/llm_interface.py`)
- Gemini command generation → Gemini service: calls Gemini (evidence: `README.md`)
- SITL command loop → JSON command parser: passes JSON (evidence: `SITL/main.py`)
- JSON command parser → DroneKit controls: dispatches controls (evidence: `SITL/command_parser.py`)
- DroneKit controls → DroneKit SITL: controls vehicle (evidence: `README.md`)
- Operator → Tello command loop: enters command (evidence: `SITL/tello/main.py`)
- Tello command loop → Tello command generation: requests commands (evidence: `SITL/tello/main.py`)
- Tello command loop → Tello command parser: passes commands (evidence: `SITL/tello/main.py`)
- Tello command parser → Tello controls: dispatches controls
- Tello controls → Tello drone: controls drone (evidence: `README.md`)
- Operator → PDDL mission generation: describes mission (evidence: `README.md`)
- PDDL mission generation → Plan validation: creates plans
- Operator → Qwen mission generation: describes mission
- Qwen mission generation → Qwen plan validation: creates plans
- Tello command dataset → Tello command generation: supports tuning (evidence: `README.md`)
- Operator → Integrated control UI: uses dashboard (evidence: `integrated-full-project/Real_UI_Last/frontend/src/App.tsx`)
- Integrated control UI → Whisper and GPS page: renders page (evidence: `integrated-full-project/Real_UI_Last/frontend/src/App.tsx`)
- Integrated control UI → Sensor event log: renders page (evidence: `integrated-full-project/Real_UI_Last/frontend/src/App.tsx`)
- Integrated control UI → Control and video page: renders page (evidence: `integrated-full-project/Real_UI_Last/frontend/src/App.tsx`)
- Integrated control UI → Pipeline summary view: shows pipeline (evidence: `integrated-full-project/Real_UI_Last/frontend/src/App.tsx`)
- Integrated control UI → API routes and jobs: uploads audio (evidence: `integrated-full-project/Real_UI_Last/frontend/src/App.tsx`)
- Integrated control UI → Integrated API routes: calls API
