# wwbing/vehicleterminal architecture

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

- Interactive diagram: https://gitdiagram.com/wwbing/vehicleterminal
- Repository: https://github.com/wwbing/vehicleterminal

## Overview

This repository is an embedded Qt in-vehicle terminal paired with an optional modular voice assistant. The user-facing workflow runs from the Qt main window into navigation, media, weather, and monitoring features; the voice workflow recognizes speech, interprets it with an offline LLM, and synthesizes spoken output, with ZeroMQ connecting the AI services. README-level architecture and capabilities are documented, but most application source was not sampled, so subsystem links below rely on those documented relationships rather than inspected calls.

Main entry points: [`VehicleTerminal/mainwindow.cpp`](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/mainwindow.cpp) (Qt Main Window), [`LLM_Voice_Flow/zmq-comm-kit/src/ZmqClient.cpp`](https://github.com/wwbing/vehicleterminal/blob/main/LLM_Voice_Flow/zmq-comm-kit/src/ZmqClient.cpp) (ZeroMQ Messaging), [`VehicleTerminal/Music/musicplayer.cpp`](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Music/musicplayer.cpp) (Music Player), [`VehicleTerminal/Monitor/monitor.cpp`](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Monitor/monitor.cpp) (Environment Monitor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_terminal["Vehicle Terminal"]
  node_main["Qt Main Window<br/>[mainwindow.cpp]"]
  node_entry["Application Entry<br/>[main.cpp]"]
  node_settings["Settings<br/>[settingwindow.cpp]"]
  node_music["Music Player<br/>[musicplayer.cpp]"]
  node_musicsearch["Music Search<br/>[searchmusic.cpp]"]
  node_navigation["Map Navigation<br/>[baidumap.cpp]"]
  node_weather["Weather<br/>[weather.cpp]"]
  node_monitor["Environment Monitor<br/>[monitor.cpp]"]
  node_camera["Camera Capture<br/>[capture_thread.cpp]"]
  node_speech["Speech Interface"]
end

subgraph group_voice["Voice Interaction"]
  node_asr["Speech Recognition"]
  node_language["Language Recognition"]
  node_intent["Instruction Parsing"]
  node_llm["Offline LLM"]
  node_zmq["ZeroMQ Messaging<br/>[ZmqClient.cpp]"]
  node_tts["Speech Synthesis<br/>[main.cpp]"]
end

subgraph group_hardware["Hardware Access"]
  node_gps["GPS Interface<br/>[gps.c]"]
  node_sensors["Sensor Drivers<br/>[dht11_dri.c]"]
  node_light_sensor["I2C Sensor Access<br/>[i2cbusses.c]"]
  node_npu["RK3576 NPU"]
  node_camera_service["Camera Device"]
  node_speaker["Vehicle Speakers"]
end

subgraph group_services["External Services"]
  node_online["Network APIs"]
  node_mapservice["Baidu Maps"]
  node_musicservice["Music API"]
  node_weatherapi["Weather API"]
end

node_driver(("Driver"))

node_driver -->|"interacts"| node_main
node_entry -->|"creates"| node_main
node_main -->|"dispatches"| node_settings
node_main -->|"dispatches"| node_music
node_main -->|"dispatches"| node_navigation
node_main -->|"dispatches"| node_weather
node_main -->|"dispatches"| node_monitor
node_music -->|"searches"| node_musicsearch
node_music -->|"requests"| node_musicservice
node_navigation -->|"reads location"| node_gps
node_navigation -->|"displays maps"| node_mapservice
node_weather -->|"requests forecast"| node_weatherapi
node_monitor -->|"reads environment"| node_sensors
node_monitor -->|"reads sensor"| node_light_sensor
node_monitor -->|"shows video"| node_camera
node_camera -->|"captures video"| node_camera_service
node_driver -->|"speaks"| node_speech
node_speech -.->|"sends audio"| node_asr
node_asr -->|"recognizes language"| node_language
node_asr -->|"sends transcript"| node_zmq
node_language -->|"sends language"| node_zmq
node_zmq -->|"routes transcript"| node_llm
node_llm -->|"interprets request"| node_intent
node_llm -->|"runs inference"| node_npu
node_intent -.->|"routes instruction"| node_zmq
node_llm -->|"sends response"| node_zmq
node_zmq -->|"routes text"| node_tts
node_tts -->|"plays audio"| node_speaker
node_tts -->|"reports playback"| node_zmq
node_intent -.->|"controls features"| node_main
node_weather -->|"uses network"| node_online
node_music -->|"uses network"| node_online

click node_main "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/mainwindow.cpp"
click node_entry "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/main.cpp"
click node_settings "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/settingwindow.cpp"
click node_music "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Music/musicplayer.cpp"
click node_musicsearch "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Music/searchmusic.cpp"
click node_navigation "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Map/baidumap.cpp"
click node_gps "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Map/gps.c"
click node_weather "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Weather/weather.cpp"
click node_monitor "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Monitor/monitor.cpp"
click node_camera "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Monitor/capture_thread.cpp"
click node_sensors "https://github.com/wwbing/vehicleterminal/blob/main/%E9%A9%B1%E5%8A%A8/dht11_driver/dht11_dri.c"
click node_light_sensor "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Monitor/i2cbusses.c"
click node_speech "https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/speechrecognition.cpp"
click node_asr "https://github.com/wwbing/vehicleterminal/tree/main/LLM_Voice_Flow/voice/sherpa-onnx"
click node_language "https://github.com/wwbing/vehicleterminal/tree/main/LLM_Voice_Flow/voice/sherpa-onnx"
click node_intent "https://github.com/wwbing/vehicleterminal/tree/main/LLM_Voice_Flow"
click node_llm "https://github.com/wwbing/vehicleterminal/tree/main/LLM_Voice_Flow/llm/rknn-llm"
click node_zmq "https://github.com/wwbing/vehicleterminal/blob/main/LLM_Voice_Flow/zmq-comm-kit/src/ZmqClient.cpp"
click node_tts "https://github.com/wwbing/vehicleterminal/blob/main/LLM_Voice_Flow/tts/tts_server/src/main.cpp"

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_entry,node_settings,node_music,node_musicsearch,node_navigation,node_weather,node_monitor,node_camera,node_speech toneBlue
class node_asr,node_language,node_intent,node_llm,node_zmq,node_tts toneAmber
class node_gps,node_sensors,node_light_sensor,node_npu,node_camera_service,node_speaker toneMint
class node_online,node_mapservice,node_musicservice,node_weatherapi toneRose
class node_driver toneIndigo
```

## Components

### Vehicle Terminal

- [Qt Main Window](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/mainwindow.cpp): `VehicleTerminal/mainwindow.cpp`
- [Application Entry](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/main.cpp): `VehicleTerminal/main.cpp`
- [Settings](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/settingwindow.cpp): `VehicleTerminal/settingwindow.cpp`
- [Music Player](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Music/musicplayer.cpp): `VehicleTerminal/Music/musicplayer.cpp`
- [Music Search](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Music/searchmusic.cpp): `VehicleTerminal/Music/searchmusic.cpp`
- [Map Navigation](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Map/baidumap.cpp): `VehicleTerminal/Map/baidumap.cpp`
- [Weather](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Weather/weather.cpp): `VehicleTerminal/Weather/weather.cpp`
- [Environment Monitor](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Monitor/monitor.cpp): `VehicleTerminal/Monitor/monitor.cpp`
- [Camera Capture](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Monitor/capture_thread.cpp): `VehicleTerminal/Monitor/capture_thread.cpp`
- [Speech Interface](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/speechrecognition.cpp): `VehicleTerminal/speechrecognition.cpp`

### Voice Interaction

- [Speech Recognition](https://github.com/wwbing/vehicleterminal/tree/main/LLM_Voice_Flow/voice/sherpa-onnx): `LLM_Voice_Flow/voice/sherpa-onnx`
- [Language Recognition](https://github.com/wwbing/vehicleterminal/tree/main/LLM_Voice_Flow/voice/sherpa-onnx): `LLM_Voice_Flow/voice/sherpa-onnx`
- [Instruction Parsing](https://github.com/wwbing/vehicleterminal/tree/main/LLM_Voice_Flow): `LLM_Voice_Flow`
- [Offline LLM](https://github.com/wwbing/vehicleterminal/tree/main/LLM_Voice_Flow/llm/rknn-llm): `LLM_Voice_Flow/llm/rknn-llm`
- [ZeroMQ Messaging](https://github.com/wwbing/vehicleterminal/blob/main/LLM_Voice_Flow/zmq-comm-kit/src/ZmqClient.cpp): `LLM_Voice_Flow/zmq-comm-kit/src/ZmqClient.cpp`
- [Speech Synthesis](https://github.com/wwbing/vehicleterminal/blob/main/LLM_Voice_Flow/tts/tts_server/src/main.cpp): `LLM_Voice_Flow/tts/tts_server/src/main.cpp`

### Hardware Access

- [GPS Interface](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Map/gps.c): `VehicleTerminal/Map/gps.c`
- [Sensor Drivers](https://github.com/wwbing/vehicleterminal/blob/main/%E9%A9%B1%E5%8A%A8/dht11_driver/dht11_dri.c): `驱动/dht11_driver/dht11_dri.c`
- [I2C Sensor Access](https://github.com/wwbing/vehicleterminal/blob/main/VehicleTerminal/Monitor/i2cbusses.c): `VehicleTerminal/Monitor/i2cbusses.c`
- **RK3576 NPU**
- **Camera Device**
- **Vehicle Speakers**

### External Services

- **Network APIs**
- **Baidu Maps**
- **Music API**
- **Weather API**

### Other components

- **Driver**

## Connections

- Driver → Qt Main Window: interacts
- Application Entry → Qt Main Window: creates (evidence: `VehicleTerminal/main.cpp`)
- Qt Main Window → Settings: dispatches
- Qt Main Window → Music Player: dispatches
- Qt Main Window → Map Navigation: dispatches
- Qt Main Window → Weather: dispatches
- Qt Main Window → Environment Monitor: dispatches
- Music Player → Music Search: searches
- Music Player → Music API: requests
- Map Navigation → GPS Interface: reads location
- Map Navigation → Baidu Maps: displays maps
- Weather → Weather API: requests forecast
- Environment Monitor → Sensor Drivers: reads environment
- Environment Monitor → I2C Sensor Access: reads sensor
- Environment Monitor → Camera Capture: shows video
- Camera Capture → Camera Device: captures video
- Driver → Speech Interface: speaks
- Speech Interface → Speech Recognition: sends audio
- Speech Recognition → Language Recognition: recognizes language
- Speech Recognition → ZeroMQ Messaging: sends transcript
- Language Recognition → ZeroMQ Messaging: sends language
- ZeroMQ Messaging → Offline LLM: routes transcript
- Offline LLM → Instruction Parsing: interprets request
- Offline LLM → RK3576 NPU: runs inference
- Instruction Parsing → ZeroMQ Messaging: routes instruction (evidence: `LLM_Voice_Flow/zmq-comm-kit/src/ZmqClient.cpp`)
- Offline LLM → ZeroMQ Messaging: sends response
- ZeroMQ Messaging → Speech Synthesis: routes text (evidence: `LLM_Voice_Flow/tts/tts_server/src/main.cpp`)
- Speech Synthesis → Vehicle Speakers: plays audio (evidence: `LLM_Voice_Flow/tts/tts_server/src/main.cpp`)
- Speech Synthesis → ZeroMQ Messaging: reports playback (evidence: `LLM_Voice_Flow/tts/tts_server/src/main.cpp`)
- Instruction Parsing → Qt Main Window: controls features
- Weather → Network APIs: uses network
- Music Player → Network APIs: uses network
