# buaa-transistor-alg/unifiedautoaimpipeline architecture

> Architecture diagram of the GitHub repository buaa-transistor-alg/unifiedautoaimpipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/buaa-transistor-alg/unifiedautoaimpipeline
- Repository: https://github.com/buaa-transistor-alg/unifiedautoaimpipeline

## Overview

This is a unified auto-aim application with Armor and PowerRune perception modes, selectable camera/video/interactive input, and none/visualize/gimbal output. The main workflow acquires frames, processes them through the selected perception pipeline, then uses its target predictor for ballistic aiming and output. The pipelines share asynchronous stage scheduling, inference-process communication, coordinate transforms, and output infrastructure. The README is empty; the documented pipeline contracts support the main stage relationships, but unsampled implementation details are not expanded.

Main entry points: [`src/Armor/ArmorPipeline.cpp`](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/Armor/ArmorPipeline.cpp) (Armor Pipeline), [`src/PowerRune/PowerRunePipeline.cpp`](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/PowerRune/PowerRunePipeline.cpp) (PowerRune Pipeline), [`src/main.cpp`](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/main.cpp) (Runtime Orchestrator), [`src/common/Output`](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/common/Output) (Output Modes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["Runtime Orchestrator<br/>[main.cpp]"]
  node_input["Input Modes"]
end

subgraph group_armor["Armor Perception"]
  node_armor_pipe["Armor Pipeline<br/>[ArmorPipeline.cpp]"]
  node_armor_detect["Armor Detect / PnP"]
  node_armor_track["Armor Tracking"]
end

subgraph group_rune["PowerRune Perception"]
  node_rune_pipe["PowerRune Pipeline"]
  node_rune_pose["Rune Detect / Pose"]
  node_rune_predict["Rune Filtering / Prediction"]
end

subgraph group_shared["Shared Runtime"]
  node_stage["Stage Scheduler<br/>[PipelineStage.h]"]
  node_infer_client["Inference Client<br/>[InferShmClient.cpp]"]
  node_infer_manager["Process Manager"]
  node_infer_server["Inference Processes"]
  node_tf["Transform Tree"]
  node_result["Pipeline Result<br/>[PipelineResult.h]"]
end

subgraph group_aim["Aiming Outputs"]
  node_ballistics["Ballistic Prediction"]
  node_output["Output Modes"]
  node_visual["Visualization"]
  node_gimbal["Gimbal Output<br/>[GimbalOutput.cpp]"]
end

node_operator(("Operator"))
node_world(("Camera / Scene"))
node_robot(("Robot Controller"))

node_operator -->|"selects modes"| node_main
node_world -->|"provides frames"| node_input
node_input -->|"supplies frames"| node_main
node_main -->|"feeds selected pipeline"| node_armor_pipe
node_main -->|"feeds selected pipeline"| node_rune_pipe
node_armor_pipe -->|"schedules stages"| node_stage
node_rune_pipe -->|"schedules stages"| node_stage
node_armor_pipe -->|"requests inference"| node_infer_client
node_rune_pipe -->|"requests inference"| node_infer_client
node_infer_client -->|"exchanges shared-memory data"| node_infer_server
node_infer_manager -.->|"starts / restarts"| node_infer_server
node_armor_pipe -->|"runs detection and pose"| node_armor_detect
node_armor_pipe -->|"filters targets"| node_armor_track
node_rune_pipe -->|"runs detection and pose"| node_rune_pose
node_rune_pipe -->|"filters and predicts"| node_rune_predict
node_armor_pipe -->|"syncs transforms"| node_tf
node_rune_pipe -->|"syncs transforms"| node_tf
node_armor_pipe -->|"assembles perception and predictor"| node_result
node_rune_pipe -->|"assembles perception and predictor"| node_result
node_main -->|"retrieves frame result"| node_result
node_main -->|"supplies target predictor"| node_ballistics
node_main -->|"dispatches result"| node_output
node_output -->|"renders when selected"| node_visual
node_output -->|"aims when selected"| node_gimbal
node_gimbal -->|"reads state / sends control"| node_robot

click node_main "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/main.cpp"
click node_input "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/common/Input"
click node_armor_pipe "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/Armor/ArmorPipeline.cpp"
click node_armor_detect "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/Armor"
click node_armor_track "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/Armor/EKF"
click node_rune_pipe "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/PowerRune/PowerRunePipeline.cpp"
click node_rune_pose "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/PowerRune"
click node_rune_predict "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/PowerRune"
click node_stage "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/include/common/PipelineStage.h"
click node_infer_client "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Infer/InferShmClient.cpp"
click node_infer_manager "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Infer/InferProcessManager.cpp"
click node_infer_server "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/Infer"
click node_tf "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/common/TransformTree"
click node_result "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/include/common/PipelineResult.h"
click node_ballistics "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Ballistic/SequencePredictor.cpp"
click node_output "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/common/Output"
click node_visual "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Output/VisualizeOutput.cpp"
click node_gimbal "https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Output/GimbalOutput.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_input toneBlue
class node_armor_pipe,node_armor_detect,node_armor_track toneAmber
class node_rune_pipe,node_rune_pose,node_rune_predict toneMint
class node_stage,node_infer_client,node_infer_manager,node_infer_server,node_tf,node_result toneRose
class node_ballistics,node_output,node_visual,node_gimbal,node_operator,node_world,node_robot toneIndigo
```

## Components

### Application

- [Runtime Orchestrator](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/main.cpp): `src/main.cpp`
- [Input Modes](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/common/Input): `src/common/Input`

### Armor Perception

- [Armor Pipeline](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/Armor/ArmorPipeline.cpp): `src/Armor/ArmorPipeline.cpp`
- [Armor Detect / PnP](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/Armor): `src/Armor`
- [Armor Tracking](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/Armor/EKF): `src/Armor/EKF`

### PowerRune Perception

- [PowerRune Pipeline](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/PowerRune/PowerRunePipeline.cpp): `src/PowerRune/PowerRunePipeline.cpp`
- [Rune Detect / Pose](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/PowerRune): `src/PowerRune`
- [Rune Filtering / Prediction](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/PowerRune): `src/PowerRune`

### Shared Runtime

- [Stage Scheduler](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/include/common/PipelineStage.h): `include/common/PipelineStage.h`
- [Inference Client](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Infer/InferShmClient.cpp): `src/common/Infer/InferShmClient.cpp`
- [Process Manager](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Infer/InferProcessManager.cpp): `src/common/Infer/InferProcessManager.cpp`
- [Inference Processes](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/Infer): `src/Infer`
- [Transform Tree](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/common/TransformTree): `src/common/TransformTree`
- [Pipeline Result](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/include/common/PipelineResult.h): `include/common/PipelineResult.h`

### Aiming Outputs

- [Ballistic Prediction](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Ballistic/SequencePredictor.cpp): `src/common/Ballistic/SequencePredictor.cpp`
- [Output Modes](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/tree/main/src/common/Output): `src/common/Output`
- [Visualization](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Output/VisualizeOutput.cpp): `src/common/Output/VisualizeOutput.cpp`
- [Gimbal Output](https://github.com/buaa-transistor-alg/unifiedautoaimpipeline/blob/main/src/common/Output/GimbalOutput.cpp): `src/common/Output/GimbalOutput.cpp`

### Other components

- **Operator**
- **Camera / Scene**
- **Robot Controller**

## Connections

- Operator → Runtime Orchestrator: selects modes
- Camera / Scene → Input Modes: provides frames
- Input Modes → Runtime Orchestrator: supplies frames
- Runtime Orchestrator → Armor Pipeline: feeds selected pipeline
- Runtime Orchestrator → PowerRune Pipeline: feeds selected pipeline
- Armor Pipeline → Stage Scheduler: schedules stages
- PowerRune Pipeline → Stage Scheduler: schedules stages
- Armor Pipeline → Inference Client: requests inference
- PowerRune Pipeline → Inference Client: requests inference
- Inference Client → Inference Processes: exchanges shared-memory data
- Process Manager → Inference Processes: starts / restarts
- Armor Pipeline → Armor Detect / PnP: runs detection and pose
- Armor Pipeline → Armor Tracking: filters targets
- PowerRune Pipeline → Rune Detect / Pose: runs detection and pose
- PowerRune Pipeline → Rune Filtering / Prediction: filters and predicts
- Armor Pipeline → Transform Tree: syncs transforms
- PowerRune Pipeline → Transform Tree: syncs transforms
- Armor Pipeline → Pipeline Result: assembles perception and predictor
- PowerRune Pipeline → Pipeline Result: assembles perception and predictor
- Runtime Orchestrator → Pipeline Result: retrieves frame result
- Runtime Orchestrator → Ballistic Prediction: supplies target predictor
- Runtime Orchestrator → Output Modes: dispatches result
- Output Modes → Visualization: renders when selected
- Output Modes → Gimbal Output: aims when selected
- Gimbal Output → Robot Controller: reads state / sends control
