# projeto-bombeiros/project_repository architecture

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

- Interactive diagram: https://gitdiagram.com/projeto-bombeiros/project_repository
- Repository: https://github.com/projeto-bombeiros/project_repository

## Overview

BLAZE is a firefighting robot prototype with a PC operator application and ESP32 firmware. The principal workflow is selecting a saved hardware/vision profile, preparing a matching firmware configuration, then operating or monitoring the robot over USB/Wi‑Fi while camera-based vision can support autonomous aiming. The graph includes the documented profile, hardware-catalog, sensing, motion, cannon and communications stages. Several runtime internals are unsampled, and the README provided no content, so uncertain links are dashed rather than asserted.

Main entry points: [`Prototipo v0.2/esp32/src/main.cpp`](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/main.cpp) (Firmware cycle), [`Prototipo v0.2/pc_operador/launcher.py`](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/launcher.py) (Setup launcher), [`Prototipo v0.2/pc_operador/runtime.py`](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/runtime.py) (PC runtime), [`Prototipo v0.2/esp32/include/types.h`](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/include/types.h) (Command and reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator["PC operator"]
  node_launcher["Setup launcher<br/>[launcher.py]"]
  node_operator_ui["Operator console"]
  node_pc_runtime["PC runtime<br/>[runtime.py]"]
  node_vision["Camera and vision<br/>[runtime.py]"]
  node_esp_connection["ESP connection<br/>[runtime.py]"]
end

subgraph group_profiles["Profiles and hardware"]
  node_profile_manager["Profile manager<br/>[profile_manager.py]"]
  node_actuator_catalog["Actuator catalog"]
  node_profile_data["Profile defaults<br/>[defaults]"]
end

subgraph group_firmware["ESP32 firmware"]
  node_firmware_main["Firmware cycle<br/>[main.cpp]"]
  node_firmware_types["Command and reports<br/>[types.h]"]
  node_central["Safety and state<br/>[central.h]"]
  node_net_link["Network link<br/>[net_link.h]"]
  node_motion["Track motion<br/>[motion.h]"]
  node_cannon_jet["Cannon and jet<br/>[cannon_jet.h]"]
  node_sensing_safety["Sensors and cooling<br/>[sensing_safety.h]"]
  node_pwm_compat["PWM compatibility<br/>[pwm_compat.h]"]
end

subgraph group_robot_io["Robot interfaces"]
  node_pin_map["GPIO pin map<br/>[pins.h]"]
  node_robot_hardware{{"Robot actuators and sensors"}}
end

node_operator_user(("Operator"))
node_camera_source{{"Camera source"}}

node_operator_user -.->|"selects setup"| node_launcher
node_launcher -->|"prepares profile"| node_profile_manager
node_profile_manager -->|"loads defaults"| node_profile_data
node_profile_manager -->|"validates hardware"| node_actuator_catalog
node_launcher -->|"starts runtime"| node_pc_runtime
node_launcher -->|"opens console"| node_operator_ui
node_operator_ui -->|"uses runtime"| node_pc_runtime
node_launcher -->|"creates camera"| node_vision
node_launcher -->|"creates connection"| node_esp_connection
node_camera_source -.->|"supplies frames"| node_vision
node_vision -.->|"provides vision results"| node_pc_runtime
node_pc_runtime -.->|"sends commands"| node_esp_connection
node_esp_connection -.->|"exchanges telemetry"| node_net_link
node_firmware_main -->|"polls and transmits"| node_net_link
node_firmware_main -->|"observes state"| node_central
node_firmware_main -->|"initializes motion"| node_motion
node_firmware_main -->|"initializes cannon"| node_cannon_jet
node_firmware_main -->|"initializes sensing"| node_sensing_safety
node_net_link -->|"uses command types"| node_firmware_types
node_motion -->|"uses command types"| node_firmware_types
node_cannon_jet -->|"uses report types"| node_firmware_types
node_sensing_safety -->|"uses safety reports"| node_firmware_types
node_motion -.->|"drives tracks"| node_robot_hardware
node_cannon_jet -.->|"commands actuators"| node_robot_hardware
node_sensing_safety -.->|"reads sensors"| node_robot_hardware
node_pin_map -->|"maps GPIO"| node_robot_hardware
node_firmware_main -->|"uses PWM helpers"| node_pwm_compat

click node_launcher "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/launcher.py"
click node_operator_ui "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/central_operador.py"
click node_pc_runtime "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/runtime.py"
click node_vision "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/runtime.py"
click node_esp_connection "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/runtime.py"
click node_profile_manager "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/profile_manager.py"
click node_actuator_catalog "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/actuator_catalog.py"
click node_profile_data "https://github.com/projeto-bombeiros/project_repository/tree/main/Prototipo%20v0.2/pc_operador/parameters_setups/defaults"
click node_firmware_main "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/main.cpp"
click node_firmware_types "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/include/types.h"
click node_central "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/central.h"
click node_net_link "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/net_link.h"
click node_motion "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/motion.h"
click node_cannon_jet "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/cannon_jet.h"
click node_sensing_safety "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/sensing_safety.h"
click node_pwm_compat "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/pwm_compat.h"
click node_pin_map "https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/include/pins.h"

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_launcher,node_operator_ui,node_pc_runtime,node_vision,node_esp_connection toneBlue
class node_profile_manager,node_actuator_catalog,node_profile_data toneAmber
class node_firmware_main,node_firmware_types,node_central,node_net_link,node_motion,node_cannon_jet,node_sensing_safety,node_pwm_compat toneMint
class node_pin_map,node_robot_hardware toneRose
class node_operator_user,node_camera_source toneIndigo
```

## Components

### PC operator

- [Setup launcher](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/launcher.py): `Prototipo v0.2/pc_operador/launcher.py`
- [Operator console](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/central_operador.py): `Prototipo v0.2/pc_operador/central_operador.py`
- [PC runtime](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/runtime.py): `Prototipo v0.2/pc_operador/runtime.py`
- [Camera and vision](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/runtime.py): `Prototipo v0.2/pc_operador/runtime.py`
- [ESP connection](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/runtime.py): `Prototipo v0.2/pc_operador/runtime.py`

### Profiles and hardware

- [Profile manager](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/profile_manager.py): `Prototipo v0.2/pc_operador/profile_manager.py`
- [Actuator catalog](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/pc_operador/actuator_catalog.py): `Prototipo v0.2/pc_operador/actuator_catalog.py`
- [Profile defaults](https://github.com/projeto-bombeiros/project_repository/tree/main/Prototipo%20v0.2/pc_operador/parameters_setups/defaults): `Prototipo v0.2/pc_operador/parameters_setups/defaults`

### ESP32 firmware

- [Firmware cycle](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/main.cpp): `Prototipo v0.2/esp32/src/main.cpp`
- [Command and reports](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/include/types.h): `Prototipo v0.2/esp32/include/types.h`
- [Safety and state](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/central.h): `Prototipo v0.2/esp32/src/central.h`
- [Network link](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/net_link.h): `Prototipo v0.2/esp32/src/net_link.h`
- [Track motion](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/motion.h): `Prototipo v0.2/esp32/src/motion.h`
- [Cannon and jet](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/cannon_jet.h): `Prototipo v0.2/esp32/src/cannon_jet.h`
- [Sensors and cooling](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/sensing_safety.h): `Prototipo v0.2/esp32/src/sensing_safety.h`
- [PWM compatibility](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/src/pwm_compat.h): `Prototipo v0.2/esp32/src/pwm_compat.h`

### Robot interfaces

- [GPIO pin map](https://github.com/projeto-bombeiros/project_repository/blob/main/Prototipo%20v0.2/esp32/include/pins.h): `Prototipo v0.2/esp32/include/pins.h`
- **Robot actuators and sensors**

### Other components

- **Operator**
- **Camera source**

## Connections

- Operator → Setup launcher: selects setup
- Setup launcher → Profile manager: prepares profile (evidence: `Prototipo v0.2/pc_operador/launcher.py`)
- Profile manager → Profile defaults: loads defaults (evidence: `Prototipo v0.2/pc_operador/profile_manager.py`)
- Profile manager → Actuator catalog: validates hardware (evidence: `Prototipo v0.2/pc_operador/profile_manager.py`)
- Setup launcher → PC runtime: starts runtime (evidence: `Prototipo v0.2/pc_operador/launcher.py`)
- Setup launcher → Operator console: opens console (evidence: `Prototipo v0.2/pc_operador/launcher.py`)
- Operator console → PC runtime: uses runtime (evidence: `Prototipo v0.2/pc_operador/central_operador.py`)
- Setup launcher → Camera and vision: creates camera (evidence: `Prototipo v0.2/pc_operador/launcher.py`)
- Setup launcher → ESP connection: creates connection (evidence: `Prototipo v0.2/pc_operador/launcher.py`)
- Camera source → Camera and vision: supplies frames
- Camera and vision → PC runtime: provides vision results (evidence: `Prototipo v0.2/pc_operador/runtime.py`)
- PC runtime → ESP connection: sends commands (evidence: `Prototipo v0.2/pc_operador/runtime.py`)
- ESP connection → Network link: exchanges telemetry
- Firmware cycle → Network link: polls and transmits (evidence: `Prototipo v0.2/esp32/src/main.cpp`)
- Firmware cycle → Safety and state: observes state (evidence: `Prototipo v0.2/esp32/src/main.cpp`)
- Firmware cycle → Track motion: initializes motion (evidence: `Prototipo v0.2/esp32/src/main.cpp`)
- Firmware cycle → Cannon and jet: initializes cannon (evidence: `Prototipo v0.2/esp32/src/main.cpp`)
- Firmware cycle → Sensors and cooling: initializes sensing (evidence: `Prototipo v0.2/esp32/src/main.cpp`)
- Network link → Command and reports: uses command types (evidence: `Prototipo v0.2/esp32/src/net_link.h`)
- Track motion → Command and reports: uses command types (evidence: `Prototipo v0.2/esp32/src/motion.h`)
- Cannon and jet → Command and reports: uses report types (evidence: `Prototipo v0.2/esp32/src/cannon_jet.h`)
- Sensors and cooling → Command and reports: uses safety reports (evidence: `Prototipo v0.2/esp32/src/sensing_safety.h`)
- Track motion → Robot actuators and sensors: drives tracks
- Cannon and jet → Robot actuators and sensors: commands actuators
- Sensors and cooling → Robot actuators and sensors: reads sensors
- GPIO pin map → Robot actuators and sensors: maps GPIO (evidence: `Prototipo v0.2/esp32/include/pins.h`)
- Firmware cycle → PWM compatibility: uses PWM helpers (evidence: `Prototipo v0.2/esp32/src/main.cpp`)
