# miofelix/intelligent-rescue-2025 architecture

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

- Interactive diagram: https://gitdiagram.com/miofelix/intelligent-rescue-2025
- Repository: https://github.com/miofelix/intelligent-rescue-2025

## Overview

The product is a dual-core intelligent rescue robot: Jetson vision and a finite-state mission controller identify and approach balls, grab them, locate a placement zone, and release; UART carries motion and servo commands to STM32 firmware. The README documents YOLO recognition, PID-guided grasping, and reliable UART communication. Sampled source confirms the Jetson orchestration and STM32 timer callback’s hardware-control calls; other firmware relationships are limited to README and source-index evidence.

Main entry points: [`jetson/main.py`](https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/main.py) (Rescue FSM), [`stm32/system/callback.c`](https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/system/callback.c) (Timer and command handler), [`jetson/vision.py`](https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/vision.py) (Detection and filtering), [`jetson/control.py`](https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/control.py) (Visual motion control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_jetson["Jetson autonomy"]
  node_mission["Rescue FSM<br/>[main.py]"]
  node_config["Mission configuration<br/>[config.py]"]
  node_vision["Detection and filtering<br/>[vision.py]"]
  node_video["Video stream<br/>[vision.py]"]
  node_motion["Visual motion control<br/>[control.py]"]
end

subgraph group_link["Command link"]
  node_protocol["UART packet protocol<br/>[uart.py]"]
end

subgraph group_stm32["STM32 firmware"]
  node_uartdriver["STM32 UART driver<br/>[uart.c]"]
  node_callback["Timer and command handler<br/>[callback.c]"]
  node_motor["Motor PID and drivers<br/>[motor.c]"]
  node_servo["Servo control<br/>[servo.c]"]
  node_display["OLED status display<br/>[oled.c]"]
  node_font["Display fonts<br/>[font.c]"]
end

node_operator(("Mission operator"))
node_camera["Camera"]
node_yolo["YOLO model"]

node_operator -.->|"starts mission"| node_mission
node_camera -.->|"provides frames"| node_video
node_video -->|"supplies frames"| node_mission
node_mission -->|"runs inference"| node_yolo
node_mission -->|"uses detections"| node_vision
node_mission -->|"commands movement"| node_motion
node_motion -->|"inherits control"| node_protocol
node_mission -->|"uses settings"| node_config
node_vision -->|"uses thresholds"| node_config
node_protocol -.->|"sends commands"| node_uartdriver
node_uartdriver -.->|"delivers commands"| node_callback
node_callback -->|"reads command"| node_uartdriver
node_callback -->|"updates motor PID"| node_motor
node_callback -->|"sets angles"| node_servo
node_callback -->|"renders status"| node_display
node_display -->|"uses glyphs"| node_font
node_mission -->|"checks grasp and zone"| node_vision
node_mission -->|"grabs and releases"| node_motion

click node_mission "https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/main.py"
click node_config "https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/config.py"
click node_vision "https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/vision.py"
click node_video "https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/vision.py"
click node_motion "https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/control.py"
click node_protocol "https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/uart.py"
click node_uartdriver "https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/uart.c"
click node_callback "https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/system/callback.c"
click node_motor "https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/motor.c"
click node_servo "https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/servo.c"
click node_display "https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/oled.c"
click node_font "https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/font.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_mission,node_config,node_vision,node_video,node_motion toneBlue
class node_protocol toneAmber
class node_uartdriver,node_callback,node_motor,node_servo,node_display,node_font toneMint
class node_operator,node_camera,node_yolo toneIndigo
```

## Components

### Jetson autonomy

- [Rescue FSM](https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/main.py): `jetson/main.py`
- [Mission configuration](https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/config.py): `jetson/config.py`
- [Detection and filtering](https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/vision.py): `jetson/vision.py`
- [Video stream](https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/vision.py): `jetson/vision.py`
- [Visual motion control](https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/control.py): `jetson/control.py`

### Command link

- [UART packet protocol](https://github.com/miofelix/intelligent-rescue-2025/blob/main/jetson/uart.py): `jetson/uart.py`

### STM32 firmware

- [STM32 UART driver](https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/uart.c): `stm32/hardware/uart.c`
- [Timer and command handler](https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/system/callback.c): `stm32/system/callback.c`
- [Motor PID and drivers](https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/motor.c): `stm32/hardware/motor.c`
- [Servo control](https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/servo.c): `stm32/hardware/servo.c`
- [OLED status display](https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/oled.c): `stm32/hardware/oled.c`
- [Display fonts](https://github.com/miofelix/intelligent-rescue-2025/blob/main/stm32/hardware/font.c): `stm32/hardware/font.c`

### Other components

- **Mission operator**
- **Camera**
- **YOLO model**

## Connections

- Mission operator → Rescue FSM: starts mission (evidence: `README.md`)
- Camera → Video stream: provides frames (evidence: `README.md`)
- Video stream → Rescue FSM: supplies frames (evidence: `jetson/main.py`)
- Rescue FSM → YOLO model: runs inference (evidence: `jetson/main.py`)
- Rescue FSM → Detection and filtering: uses detections (evidence: `jetson/main.py`)
- Rescue FSM → Visual motion control: commands movement (evidence: `jetson/main.py`)
- Visual motion control → UART packet protocol: inherits control (evidence: `jetson/control.py`)
- Rescue FSM → Mission configuration: uses settings (evidence: `jetson/main.py`)
- Detection and filtering → Mission configuration: uses thresholds (evidence: `jetson/vision.py`)
- UART packet protocol → STM32 UART driver: sends commands (evidence: `README.md`)
- STM32 UART driver → Timer and command handler: delivers commands (evidence: `stm32/hardware/uart.c`)
- Timer and command handler → STM32 UART driver: reads command (evidence: `stm32/system/callback.c`)
- Timer and command handler → Motor PID and drivers: updates motor PID (evidence: `stm32/system/callback.c`)
- Timer and command handler → Servo control: sets angles (evidence: `stm32/system/callback.c`)
- Timer and command handler → OLED status display: renders status (evidence: `stm32/system/callback.c`)
- OLED status display → Display fonts: uses glyphs
- Rescue FSM → Detection and filtering: checks grasp and zone (evidence: `jetson/main.py`)
- Rescue FSM → Visual motion control: grabs and releases (evidence: `README.md`)
