# reakt-sh/reaktor-driver architecture

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

- Interactive diagram: https://gitdiagram.com/reakt-sh/reaktor-driver
- Repository: https://github.com/reakt-sh/reaktor-driver

## Overview

REAKTOR is a test-vehicle control system: the onboard Python connector discovers serial devices, opens the driver and sensors, and exposes motor control while collecting status, power, and GNSS data for storage or live broadcast. The Arduino driver handles vehicle I/O and motor behavior. The graph preserves these product stages and the documented manual controls, display, and power-meter/GPS capabilities. Source evidence is sampled mainly from connector code; driver internals and several listed modules are unsampled, so unsupported links are omitted.

Main entry points: [`connector/connector/control_center.py`](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/control_center.py) (Control Center), [`connector/connector/motor/connection.py`](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/motor/connection.py) (Motor Connection), [`connector/connector/gnss/connection.py`](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/gnss/connection.py) (GNSS Connection), [`driver/src/main.ino`](https://github.com/reakt-sh/reaktor-driver/blob/main/driver/src/main.ino) (Arduino Driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_onboard["Onboard Connector"]
  node_center["Control Center<br/>[control_center.py]"]
  node_discovery["Serial Discovery<br/>[device_helper.py]"]
  node_motor_api["Motor Connection<br/>[connection.py]"]
  node_motor_protocol["Motor Protocol<br/>[protocol.py]"]
  node_motor_data["Vehicle Status<br/>[data.py]"]
  node_storage[("Session Storage<br/>[control_center.py]")]
  node_live_server["Live Data Server"]
end

subgraph group_sensors["Sensor Inputs"]
  node_power_api["Power Connection<br/>[connection.py]"]
  node_power_protocol["Power Protocol<br/>[protocol.py]"]
  node_power_data["Power Readings<br/>[data.py]"]
  node_gnss_api["GNSS Connection<br/>[connection.py]"]
  node_gnss_data["Position Data<br/>[data.py]"]
end

subgraph group_vehicle["Vehicle Driver"]
  node_driver["Arduino Driver<br/>[main.ino]"]
  node_mode_control["Drive Modes<br/>[mode.h]"]
  node_manual_inputs["Manual Inputs<br/>[switches.ino]"]
  node_throttle["Throttle<br/>[throttle.ino]"]
  node_display["Driver Display<br/>[panel.ino]"]
end

subgraph group_shared["Shared Runtime"]
  node_shared_serial["Serial Transport"]
  node_provider["Data Provider<br/>[data_provider.py]"]
end

node_operator(("Control Client"))
node_gpsd["GPS Service"]
node_power_sensor["Power Meter"]
node_motor_controller["Motor Controller"]

node_operator -->|"uses API"| node_center
node_center -->|"finds ports"| node_discovery
node_center -->|"opens driver"| node_motor_api
node_center -->|"opens sensor"| node_power_api
node_center -->|"opens receiver"| node_gnss_api
node_center -->|"registers status"| node_motor_api
node_center -->|"reads snapshot"| node_power_api
node_center -->|"reads snapshot"| node_gnss_api
node_center -->|"writes session"| node_storage
node_center -->|"broadcasts data"| node_live_server
node_operator -.->|"sends controls"| node_motor_api
node_motor_api -->|"delegates messages"| node_motor_protocol
node_motor_protocol -->|"reads and sends"| node_shared_serial
node_motor_protocol -->|"decodes status"| node_motor_data
node_motor_api -.->|"publishes updates"| node_provider
node_power_api -->|"delegates messages"| node_power_protocol
node_power_protocol -->|"reads and sends"| node_shared_serial
node_power_protocol -->|"decodes readings"| node_power_data
node_power_api -.->|"publishes updates"| node_provider
node_gnss_api -->|"receives GPS data"| node_gpsd
node_gnss_api -->|"creates positions"| node_gnss_data
node_gnss_api -.->|"publishes updates"| node_provider
node_driver -.->|"uses drive modes"| node_mode_control
node_manual_inputs -.->|"sets mode"| node_mode_control
node_throttle -.->|"provides input"| node_driver
node_driver -.->|"updates display"| node_display
node_driver -.->|"controls motor"| node_motor_controller
node_center -.->|"connects by serial"| node_power_sensor
node_motor_api -.->|"communicates serially"| node_driver

click node_center "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/control_center.py"
click node_discovery "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/util/device_helper.py"
click node_motor_api "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/motor/connection.py"
click node_motor_protocol "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/motor/protocol.py"
click node_motor_data "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/motor/data.py"
click node_power_api "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/power/connection.py"
click node_power_protocol "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/power/protocol.py"
click node_power_data "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/power/data.py"
click node_gnss_api "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/gnss/connection.py"
click node_gnss_data "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/gnss/data.py"
click node_driver "https://github.com/reakt-sh/reaktor-driver/blob/main/driver/src/main.ino"
click node_mode_control "https://github.com/reakt-sh/reaktor-driver/blob/main/driver/include/mode.h"
click node_manual_inputs "https://github.com/reakt-sh/reaktor-driver/blob/main/driver/src/switches.ino"
click node_throttle "https://github.com/reakt-sh/reaktor-driver/blob/main/driver/src/throttle.ino"
click node_display "https://github.com/reakt-sh/reaktor-driver/blob/main/driver/src/panel.ino"
click node_shared_serial "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/shared/serial_connection.py"
click node_provider "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/shared/data_provider.py"
click node_storage "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/control_center.py"
click node_live_server "https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/util/live_data_server.py"

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_center,node_discovery,node_motor_api,node_motor_protocol,node_motor_data,node_storage,node_live_server,node_operator toneBlue
class node_power_api,node_power_protocol,node_power_data,node_gnss_api,node_gnss_data toneAmber
class node_driver,node_mode_control,node_manual_inputs,node_throttle,node_display toneMint
class node_shared_serial,node_provider toneRose
class node_gpsd,node_power_sensor,node_motor_controller toneIndigo
```

## Components

### Onboard Connector

- [Control Center](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/control_center.py): `connector/connector/control_center.py`
- [Serial Discovery](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/util/device_helper.py): `connector/connector/util/device_helper.py`
- [Motor Connection](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/motor/connection.py): `connector/connector/motor/connection.py`
- [Motor Protocol](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/motor/protocol.py): `connector/connector/motor/protocol.py`
- [Vehicle Status](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/motor/data.py): `connector/connector/motor/data.py`
- [Session Storage](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/control_center.py): `connector/connector/control_center.py`
- [Live Data Server](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/util/live_data_server.py): `connector/connector/util/live_data_server.py`

### Sensor Inputs

- [Power Connection](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/power/connection.py): `connector/connector/power/connection.py`
- [Power Protocol](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/power/protocol.py): `connector/connector/power/protocol.py`
- [Power Readings](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/power/data.py): `connector/connector/power/data.py`
- [GNSS Connection](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/gnss/connection.py): `connector/connector/gnss/connection.py`
- [Position Data](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/gnss/data.py): `connector/connector/gnss/data.py`

### Vehicle Driver

- [Arduino Driver](https://github.com/reakt-sh/reaktor-driver/blob/main/driver/src/main.ino): `driver/src/main.ino`
- [Drive Modes](https://github.com/reakt-sh/reaktor-driver/blob/main/driver/include/mode.h): `driver/include/mode.h`
- [Manual Inputs](https://github.com/reakt-sh/reaktor-driver/blob/main/driver/src/switches.ino): `driver/src/switches.ino`
- [Throttle](https://github.com/reakt-sh/reaktor-driver/blob/main/driver/src/throttle.ino): `driver/src/throttle.ino`
- [Driver Display](https://github.com/reakt-sh/reaktor-driver/blob/main/driver/src/panel.ino): `driver/src/panel.ino`

### Shared Runtime

- [Serial Transport](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/shared/serial_connection.py): `connector/connector/shared/serial_connection.py`
- [Data Provider](https://github.com/reakt-sh/reaktor-driver/blob/main/connector/connector/shared/data_provider.py): `connector/connector/shared/data_provider.py`

### Other components

- **Control Client**
- **GPS Service**
- **Power Meter**
- **Motor Controller**

## Connections

- Control Client → Control Center: uses API
- Control Center → Serial Discovery: finds ports (evidence: `connector/connector/control_center.py`)
- Control Center → Motor Connection: opens driver (evidence: `connector/connector/control_center.py`)
- Control Center → Power Connection: opens sensor (evidence: `connector/connector/control_center.py`)
- Control Center → GNSS Connection: opens receiver (evidence: `connector/connector/control_center.py`)
- Control Center → Motor Connection: registers status (evidence: `connector/connector/control_center.py`)
- Control Center → Power Connection: reads snapshot (evidence: `connector/connector/control_center.py`)
- Control Center → GNSS Connection: reads snapshot (evidence: `connector/connector/control_center.py`)
- Control Center → Session Storage: writes session (evidence: `connector/connector/control_center.py`)
- Control Center → Live Data Server: broadcasts data (evidence: `connector/connector/control_center.py`)
- Control Client → Motor Connection: sends controls
- Motor Connection → Motor Protocol: delegates messages (evidence: `connector/connector/motor/connection.py`)
- Motor Protocol → Serial Transport: reads and sends (evidence: `connector/connector/motor/protocol.py`)
- Motor Protocol → Vehicle Status: decodes status (evidence: `connector/connector/motor/protocol.py`)
- Motor Connection → Data Provider: publishes updates
- Power Connection → Power Protocol: delegates messages (evidence: `connector/connector/power/connection.py`)
- Power Protocol → Serial Transport: reads and sends (evidence: `connector/connector/power/protocol.py`)
- Power Protocol → Power Readings: decodes readings (evidence: `connector/connector/power/protocol.py`)
- Power Connection → Data Provider: publishes updates
- GNSS Connection → GPS Service: receives GPS data (evidence: `connector/connector/gnss/connection.py`)
- GNSS Connection → Position Data: creates positions (evidence: `connector/connector/gnss/connection.py`)
- GNSS Connection → Data Provider: publishes updates
- Arduino Driver → Drive Modes: uses drive modes
- Manual Inputs → Drive Modes: sets mode
- Throttle → Arduino Driver: provides input
- Arduino Driver → Driver Display: updates display
- Arduino Driver → Motor Controller: controls motor
- Control Center → Power Meter: connects by serial
- Motor Connection → Arduino Driver: communicates serially
