# hccc1203/runaccm2025 architecture

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

- Interactive diagram: https://gitdiagram.com/hccc1203/runaccm2025
- Repository: https://github.com/hccc1203/runaccm2025

## Overview

This is an EdgeBoard autonomous-course-driving application. A producer captures frames and fans them into line-following and AI work queues; the AI consumer detects course objects, while the main consumer runs tracking and scene handling, then sends steering and speed commands over UART. The README documents the line-processing, centerline, preview-control, and ordered course-element stages. Edges are grounded in the README or SOURCE INDEX; dashed links mark relationships whose exact calls were not shown in the excerpts.

Main entry points: [`track/standard/standard.cpp`](https://github.com/hccc1203/runaccm2025/blob/main/track/standard/standard.cpp) (Standard tracking), [`thread/thread.cpp`](https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.cpp) (Control consumer), [`include/detection.hpp`](https://github.com/hccc1203/runaccm2025/blob/main/include/detection.hpp) (Object detection), [`thread/thread.h`](https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.h) (Frame queues)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime pipeline"]
  node_producer["Frame producer<br/>[thread.cpp]"]
  node_queues["Frame queues<br/>[thread.h]"]
  node_ai_consumer["AI consumer<br/>[thread.cpp]"]
  node_predict_results["Detection results<br/>[thread.cpp]"]
  node_consumer["Control consumer<br/>[thread.cpp]"]
end

subgraph group_vision["Vision and tracking"]
  node_detector["Object detection<br/>[detection.hpp]"]
  node_standard["Standard tracking<br/>[standard.cpp]"]
  node_image_processing["Image processing<br/>[imgprocess.cpp]"]
  node_general["Tracking utilities<br/>[general.h]"]
end

subgraph group_scenes["Course scenarios"]
  node_basic_elements["Cross and ring"]
  node_obstacle["Obstacle handling<br/>[obstacle.cpp]"]
  node_catering["Burger handling<br/>[catering.cpp]"]
  node_charging["Charging bays<br/>[charging.cpp]"]
  node_bridge["Bridge handling<br/>[bridge.cpp]"]
  node_layby["Layby handling<br/>[layby.cpp]"]
  node_crosswalk["Crosswalk handling<br/>[crosswalk.cpp]"]
end

subgraph group_platform["Configuration and control"]
  node_config["Runtime configuration<br/>[param.hpp]"]
  node_uart["UART control<br/>[uart.hpp]"]
end

node_camera(("Camera"))
node_nna["EdgeBoard NNA"]
node_onnx["ONNX NMS"]
node_vehicle(("Vehicle controller"))

node_camera -->|"provides frames"| node_producer
node_producer -->|"enqueues frames"| node_queues
node_producer -->|"feeds AI queue"| node_ai_consumer
node_ai_consumer -->|"runs detection"| node_detector
node_detector -->|"runs backbone"| node_nna
node_detector -->|"runs NMS"| node_onnx
node_ai_consumer -->|"updates results"| node_predict_results
node_queues -->|"provides frames"| node_consumer
node_consumer -->|"runs tracking"| node_standard
node_consumer -->|"reads results"| node_predict_results
node_standard -.->|"processes images"| node_image_processing
node_standard -.->|"uses utilities"| node_general
node_standard -.->|"handles ordered elements"| node_basic_elements
node_standard -.->|"handles obstacles"| node_obstacle
node_standard -.->|"handles burger"| node_catering
node_standard -.->|"handles charging bays"| node_charging
node_standard -.->|"handles bridges"| node_bridge
node_standard -.->|"handles laybys"| node_layby
node_standard -.->|"handles crosswalks"| node_crosswalk
node_config -->|"configures tracking"| node_standard
node_consumer -->|"sends commands"| node_uart
node_uart -->|"controls vehicle"| node_vehicle

click node_producer "https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.cpp"
click node_queues "https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.h"
click node_ai_consumer "https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.cpp"
click node_detector "https://github.com/hccc1203/runaccm2025/blob/main/include/detection.hpp"
click node_predict_results "https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.cpp"
click node_consumer "https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.cpp"
click node_standard "https://github.com/hccc1203/runaccm2025/blob/main/track/standard/standard.cpp"
click node_image_processing "https://github.com/hccc1203/runaccm2025/blob/main/track/imgprocess/imgprocess.cpp"
click node_general "https://github.com/hccc1203/runaccm2025/blob/main/track/standard/general.h"
click node_basic_elements "https://github.com/hccc1203/runaccm2025/tree/main/track/basic"
click node_obstacle "https://github.com/hccc1203/runaccm2025/blob/main/track/special/obstacle.cpp"
click node_catering "https://github.com/hccc1203/runaccm2025/blob/main/track/special/catering.cpp"
click node_charging "https://github.com/hccc1203/runaccm2025/blob/main/track/special/charging.cpp"
click node_bridge "https://github.com/hccc1203/runaccm2025/blob/main/track/special/bridge.cpp"
click node_layby "https://github.com/hccc1203/runaccm2025/blob/main/track/special/layby.cpp"
click node_crosswalk "https://github.com/hccc1203/runaccm2025/blob/main/track/special/crosswalk.cpp"
click node_config "https://github.com/hccc1203/runaccm2025/blob/main/param/param.hpp"
click node_uart "https://github.com/hccc1203/runaccm2025/blob/main/include/uart.hpp"

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_producer,node_queues,node_ai_consumer,node_predict_results,node_consumer toneBlue
class node_detector,node_standard,node_image_processing,node_general toneAmber
class node_basic_elements,node_obstacle,node_catering,node_charging,node_bridge,node_layby,node_crosswalk toneMint
class node_config,node_uart toneRose
class node_camera,node_nna,node_onnx,node_vehicle toneIndigo
```

## Components

### Runtime pipeline

- [Frame producer](https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.cpp): `thread/thread.cpp`
- [Frame queues](https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.h): `thread/thread.h`
- [AI consumer](https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.cpp): `thread/thread.cpp`
- [Detection results](https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.cpp): `thread/thread.cpp`
- [Control consumer](https://github.com/hccc1203/runaccm2025/blob/main/thread/thread.cpp): `thread/thread.cpp`

### Vision and tracking

- [Object detection](https://github.com/hccc1203/runaccm2025/blob/main/include/detection.hpp): `include/detection.hpp`
- [Standard tracking](https://github.com/hccc1203/runaccm2025/blob/main/track/standard/standard.cpp): `track/standard/standard.cpp`
- [Image processing](https://github.com/hccc1203/runaccm2025/blob/main/track/imgprocess/imgprocess.cpp): `track/imgprocess/imgprocess.cpp`
- [Tracking utilities](https://github.com/hccc1203/runaccm2025/blob/main/track/standard/general.h): `track/standard/general.h`

### Course scenarios

- [Cross and ring](https://github.com/hccc1203/runaccm2025/tree/main/track/basic): `track/basic`
- [Obstacle handling](https://github.com/hccc1203/runaccm2025/blob/main/track/special/obstacle.cpp): `track/special/obstacle.cpp`
- [Burger handling](https://github.com/hccc1203/runaccm2025/blob/main/track/special/catering.cpp): `track/special/catering.cpp`
- [Charging bays](https://github.com/hccc1203/runaccm2025/blob/main/track/special/charging.cpp): `track/special/charging.cpp`
- [Bridge handling](https://github.com/hccc1203/runaccm2025/blob/main/track/special/bridge.cpp): `track/special/bridge.cpp`
- [Layby handling](https://github.com/hccc1203/runaccm2025/blob/main/track/special/layby.cpp): `track/special/layby.cpp`
- [Crosswalk handling](https://github.com/hccc1203/runaccm2025/blob/main/track/special/crosswalk.cpp): `track/special/crosswalk.cpp`

### Configuration and control

- [Runtime configuration](https://github.com/hccc1203/runaccm2025/blob/main/param/param.hpp): `param/param.hpp`
- [UART control](https://github.com/hccc1203/runaccm2025/blob/main/include/uart.hpp): `include/uart.hpp`

### Other components

- **Camera**
- **EdgeBoard NNA**
- **ONNX NMS**
- **Vehicle controller**

## Connections

- Camera → Frame producer: provides frames (evidence: `readme.md`)
- Frame producer → Frame queues: enqueues frames (evidence: `readme.md`)
- Frame producer → AI consumer: feeds AI queue (evidence: `readme.md`)
- AI consumer → Object detection: runs detection (evidence: `readme.md`)
- Object detection → EdgeBoard NNA: runs backbone (evidence: `include/detection.hpp`)
- Object detection → ONNX NMS: runs NMS (evidence: `include/detection.hpp`)
- AI consumer → Detection results: updates results (evidence: `readme.md`)
- Frame queues → Control consumer: provides frames (evidence: `readme.md`)
- Control consumer → Standard tracking: runs tracking (evidence: `readme.md`)
- Control consumer → Detection results: reads results (evidence: `readme.md`)
- Standard tracking → Image processing: processes images
- Standard tracking → Tracking utilities: uses utilities
- Standard tracking → Cross and ring: handles ordered elements
- Standard tracking → Obstacle handling: handles obstacles
- Standard tracking → Burger handling: handles burger
- Standard tracking → Charging bays: handles charging bays
- Standard tracking → Bridge handling: handles bridges
- Standard tracking → Layby handling: handles laybys
- Standard tracking → Crosswalk handling: handles crosswalks
- Runtime configuration → Standard tracking: configures tracking (evidence: `readme.md`)
- Control consumer → UART control: sends commands (evidence: `readme.md`)
- UART control → Vehicle controller: controls vehicle (evidence: `readme.md`)
