# spr-algorithm/spr_vision_tutorial_27 architecture

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

- Interactive diagram: https://gitdiagram.com/spr-algorithm/spr_vision_tutorial_27
- Repository: https://github.com/spr-algorithm/spr_vision_tutorial_27

## Overview

This repository is a RoboMaster vision-algorithm training curriculum, progressing from C++ tooling and a vector-library exercise through OpenCV detection and camera abstractions to a planned ROS2 auto-aim system. The README documents the learner’s route and capstone data flow; sampled code also shows a YOLO-based armor detector and Hikrobot SDK headers. Stage-three algorithms and the complete capstone are curriculum goals, not implemented runtime components in the shown tree.

Main entry points: [`tutorial_2/homework_2/tasks/yolos/yolov5.cpp`](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tasks/yolos/yolov5.cpp) (YOLO detector), [`tutorial_2/tutotial_2.md`](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/tutotial_2.md) (Vision and OOP), [`tutorial_2/homework_2.md`](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2.md) (Camera exercise), [`tutorial_3/homework_3.md`](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md) (PnP pose solve)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_curriculum["Training stages"]
  node_stage1["C++ foundations<br/>[tutorial_1.md]"]
  node_vector["Vector exercise<br/>[homework_1.md]"]
  node_stage2["Vision and OOP<br/>[tutotial_2.md]"]
  node_stage3["ROS2 and aiming<br/>[tutorial_3.md]"]
  node_ros_homework["ROS2 exercise<br/>[homework_3.md]"]
end

subgraph group_vision["Vision exercises"]
  node_camera_ex["Camera exercise<br/>[homework_2.md]"]
  node_opencv_demo["OpenCV example"]
  node_camera_sdk["Hikrobot SDK<br/>[MvCameraControl.h]"]
end

subgraph group_runtime["Detection internals"]
  node_armor["Armor model<br/>[armor.hpp]"]
  node_detector["YOLO detector<br/>[yolov5.cpp]"]
  node_detector_api["Detector API<br/>[yolo.cpp]"]
  node_img_tools["Image tools<br/>[img_tools.cpp]"]
  node_logger["Logging<br/>[logger.cpp]"]
end

subgraph group_capstone["Capstone system"]
  node_recognition["Armor recognition<br/>[homework_3.md]"]
  node_pnp["PnP pose solve<br/>[homework_3.md]"]
  node_model_ekf["Model and EKF<br/>[homework_3.md]"]
  node_ballistics["Ballistic solve<br/>[homework_3.md]"]
  node_simulator["Daedalus simulator"]
  node_gimbal["Gimbal command"]
end

node_learner(("Trainee"))

node_learner -->|"starts with"| node_stage1
node_stage1 -->|"assigns"| node_vector
node_vector -->|"continues to"| node_stage2
node_stage2 -->|"assigns"| node_camera_ex
node_stage2 -->|"includes"| node_opencv_demo
node_camera_ex -->|"covers camera APIs"| node_camera_sdk
node_detector_api -->|"dispatches to"| node_detector
node_detector -->|"creates detections"| node_armor
node_detector -->|"draws with"| node_img_tools
node_detector -->|"logs with"| node_logger
node_camera_ex -->|"prepares for"| node_stage3
node_stage3 -->|"assigns"| node_ros_homework
node_ros_homework -->|"builds"| node_recognition
node_recognition -->|"provides corners"| node_pnp
node_simulator -->|"provides camera data"| node_pnp
node_pnp -->|"provides pose"| node_model_ekf
node_model_ekf -->|"provides prediction"| node_ballistics
node_ballistics -->|"publishes command"| node_gimbal
node_gimbal -->|"controls"| node_simulator

click node_stage1 "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_1/tutorial_1.md"
click node_vector "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_1/homework_1.md"
click node_stage2 "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/tutotial_2.md"
click node_camera_ex "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2.md"
click node_opencv_demo "https://github.com/spr-algorithm/spr_vision_tutorial_27/tree/main/tutorial_2/example/opencv"
click node_armor "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tasks/armor.hpp"
click node_detector "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tasks/yolos/yolov5.cpp"
click node_detector_api "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tasks/yolo.cpp"
click node_img_tools "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tools/img_tools.cpp"
click node_logger "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tools/logger.cpp"
click node_camera_sdk "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/io/hikrobot/include/MvCameraControl.h"
click node_stage3 "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/tutorial_3.md"
click node_ros_homework "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md"
click node_recognition "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md"
click node_pnp "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md"
click node_model_ekf "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md"
click node_ballistics "https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md"

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_stage1,node_vector,node_stage2,node_stage3,node_ros_homework toneBlue
class node_camera_ex,node_opencv_demo,node_camera_sdk toneAmber
class node_armor,node_detector,node_detector_api,node_img_tools,node_logger toneMint
class node_recognition,node_pnp,node_model_ekf,node_ballistics,node_simulator,node_gimbal toneRose
class node_learner toneIndigo
```

## Components

### Training stages

- [C++ foundations](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_1/tutorial_1.md): `tutorial_1/tutorial_1.md`
- [Vector exercise](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_1/homework_1.md): `tutorial_1/homework_1.md`
- [Vision and OOP](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/tutotial_2.md): `tutorial_2/tutotial_2.md`
- [ROS2 and aiming](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/tutorial_3.md): `tutorial_3/tutorial_3.md`
- [ROS2 exercise](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md): `tutorial_3/homework_3.md`

### Vision exercises

- [Camera exercise](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2.md): `tutorial_2/homework_2.md`
- [OpenCV example](https://github.com/spr-algorithm/spr_vision_tutorial_27/tree/main/tutorial_2/example/opencv): `tutorial_2/example/opencv`
- [Hikrobot SDK](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/io/hikrobot/include/MvCameraControl.h): `tutorial_2/homework_2/io/hikrobot/include/MvCameraControl.h`

### Detection internals

- [Armor model](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tasks/armor.hpp): `tutorial_2/homework_2/tasks/armor.hpp`
- [YOLO detector](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tasks/yolos/yolov5.cpp): `tutorial_2/homework_2/tasks/yolos/yolov5.cpp`
- [Detector API](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tasks/yolo.cpp): `tutorial_2/homework_2/tasks/yolo.cpp`
- [Image tools](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tools/img_tools.cpp): `tutorial_2/homework_2/tools/img_tools.cpp`
- [Logging](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_2/homework_2/tools/logger.cpp): `tutorial_2/homework_2/tools/logger.cpp`

### Capstone system

- [Armor recognition](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md): `tutorial_3/homework_3.md`
- [PnP pose solve](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md): `tutorial_3/homework_3.md`
- [Model and EKF](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md): `tutorial_3/homework_3.md`
- [Ballistic solve](https://github.com/spr-algorithm/spr_vision_tutorial_27/blob/main/tutorial_3/homework_3.md): `tutorial_3/homework_3.md`
- **Daedalus simulator**
- **Gimbal command**

### Other components

- **Trainee**

## Connections

- Trainee → C++ foundations: starts with (evidence: `Readme.md`)
- C++ foundations → Vector exercise: assigns (evidence: `Readme.md`)
- Vector exercise → Vision and OOP: continues to (evidence: `Readme.md`)
- Vision and OOP → Camera exercise: assigns (evidence: `Readme.md`)
- Vision and OOP → OpenCV example: includes (evidence: `Readme.md`)
- Camera exercise → Hikrobot SDK: covers camera APIs (evidence: `Readme.md`)
- Detector API → YOLO detector: dispatches to (evidence: `tutorial_2/homework_2/tasks/yolo.cpp`)
- YOLO detector → Armor model: creates detections (evidence: `tutorial_2/homework_2/tasks/yolos/yolov5.cpp`)
- YOLO detector → Image tools: draws with (evidence: `tutorial_2/homework_2/tasks/yolos/yolov5.cpp`)
- YOLO detector → Logging: logs with (evidence: `tutorial_2/homework_2/tasks/yolos/yolov5.cpp`)
- Camera exercise → ROS2 and aiming: prepares for (evidence: `Readme.md`)
- ROS2 and aiming → ROS2 exercise: assigns (evidence: `Readme.md`)
- ROS2 exercise → Armor recognition: builds (evidence: `Readme.md`)
- Armor recognition → PnP pose solve: provides corners (evidence: `Readme.md`)
- Daedalus simulator → PnP pose solve: provides camera data (evidence: `Readme.md`)
- PnP pose solve → Model and EKF: provides pose (evidence: `Readme.md`)
- Model and EKF → Ballistic solve: provides prediction (evidence: `Readme.md`)
- Ballistic solve → Gimbal command: publishes command (evidence: `Readme.md`)
- Gimbal command → Daedalus simulator: controls (evidence: `Readme.md`)
