# lukmanharahap/invicto-2024 architecture

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

- Interactive diagram: https://gitdiagram.com/lukmanharahap/invicto-2024
- Repository: https://github.com/lukmanharahap/invicto-2024

## Overview

INVICTO-2024 is an autonomous ball-collection and silo-targeting robot stack. Vision and two Arduino sensor controllers send measurements to the STM32F4, which acts as the real-time decision layer and controls robot behavior. The graph preserves the documented perception, sensing, control, and actuation stages, plus the STM32 motion-control internals. The README documents system-level data flows; sampled STM32 code also shows camera and Mega serial-buffer parsing. Detailed calls among control helpers are not established by the excerpts, so those links are omitted.

Main entry points: [`stm32/Core/Src/main.c`](https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Core/Src/main.c) (STM32 Runtime), [`stm32/Library/Src/robot_control.c`](https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/robot_control.c) (Robot State Logic), [`computer_vision/src/main.py`](https://github.com/lukmanharahap/invicto-2024/blob/main/computer_vision/src/main.py) (YOLO Pipeline), [`arduino_nano/src/main.cpp`](https://github.com/lukmanharahap/invicto-2024/blob/main/arduino_nano/src/main.cpp) (Nano IMU)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_perception["Vision Perception"]
  node_vision["YOLO Pipeline<br/>[main.py]"]
end

subgraph group_sensing["Sensor Controllers"]
  node_nano["Nano IMU<br/>[main.cpp]"]
  node_mega["Mega Sensors<br/>[main.cpp]"]
end

subgraph group_master["STM32 Master"]
  node_stm32["STM32 Runtime<br/>[main.c]"]
  node_control["Robot State Logic<br/>[robot_control.c]"]
end

subgraph group_motion["Motion Control"]
  node_odometry["Odometry<br/>[odometry.c]"]
  node_pid["PID Control<br/>[pid.c]"]
  node_motor["Motor Driver<br/>[invicto_motor.c]"]
  node_lcd["LCD Interface<br/>[lcd_i2c.c]"]
end

node_cameras(("Cameras"))
node_robot(("Robot Hardware"))

node_cameras -->|"capture frames"| node_vision
node_vision -->|"sends detections"| node_stm32
node_nano -->|"sends orientation"| node_stm32
node_mega -->|"sends sensor data"| node_stm32
node_stm32 -->|"runs task logic"| node_control
node_stm32 -->|"drives behavior"| node_robot
node_control -.->|"uses PID"| node_pid
node_control -.->|"uses odometry"| node_odometry
node_control -.->|"actuates"| node_motor

click node_vision "https://github.com/lukmanharahap/invicto-2024/blob/main/computer_vision/src/main.py"
click node_nano "https://github.com/lukmanharahap/invicto-2024/blob/main/arduino_nano/src/main.cpp"
click node_mega "https://github.com/lukmanharahap/invicto-2024/blob/main/arduino_mega/src/main.cpp"
click node_stm32 "https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Core/Src/main.c"
click node_control "https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/robot_control.c"
click node_odometry "https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/odometry.c"
click node_pid "https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/pid.c"
click node_motor "https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/invicto_motor.c"
click node_lcd "https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/lcd_i2c.c"

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_vision toneBlue
class node_nano,node_mega toneAmber
class node_stm32,node_control toneMint
class node_odometry,node_pid,node_motor,node_lcd toneRose
class node_cameras,node_robot toneIndigo
```

## Components

### Vision Perception

- [YOLO Pipeline](https://github.com/lukmanharahap/invicto-2024/blob/main/computer_vision/src/main.py): `computer_vision/src/main.py`

### Sensor Controllers

- [Nano IMU](https://github.com/lukmanharahap/invicto-2024/blob/main/arduino_nano/src/main.cpp): `arduino_nano/src/main.cpp`
- [Mega Sensors](https://github.com/lukmanharahap/invicto-2024/blob/main/arduino_mega/src/main.cpp): `arduino_mega/src/main.cpp`

### STM32 Master

- [STM32 Runtime](https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Core/Src/main.c): `stm32/Core/Src/main.c`
- [Robot State Logic](https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/robot_control.c): `stm32/Library/Src/robot_control.c`

### Motion Control

- [Odometry](https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/odometry.c): `stm32/Library/Src/odometry.c`
- [PID Control](https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/pid.c): `stm32/Library/Src/pid.c`
- [Motor Driver](https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/invicto_motor.c): `stm32/Library/Src/invicto_motor.c`
- [LCD Interface](https://github.com/lukmanharahap/invicto-2024/blob/main/stm32/Library/Src/lcd_i2c.c): `stm32/Library/Src/lcd_i2c.c`

### Other components

- **Cameras**
- **Robot Hardware**

## Connections

- Cameras → YOLO Pipeline: capture frames (evidence: `README.md`)
- YOLO Pipeline → STM32 Runtime: sends detections (evidence: `README.md`)
- Nano IMU → STM32 Runtime: sends orientation (evidence: `README.md`)
- Mega Sensors → STM32 Runtime: sends sensor data (evidence: `README.md`)
- STM32 Runtime → Robot State Logic: runs task logic (evidence: `README.md`)
- STM32 Runtime → Robot Hardware: drives behavior (evidence: `README.md`)
- Robot State Logic → PID Control: uses PID
- Robot State Logic → Odometry: uses odometry
- Robot State Logic → Motor Driver: actuates
