# bfmc2026-sea-me/seame_brain architecture

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

- Interactive diagram: https://gitdiagram.com/bfmc2026-sea-me/seame_brain
- Repository: https://github.com/bfmc2026-sea-me/seame_brain

## Overview

SEA:ME BFMC Dashboard is a vehicle-side dashboard and integration runtime: the Python process manager launches dashboard, vehicle I/O, and ROS2 bridge processes; browser controls and telemetry travel through the dashboard backend and shared message queues. Major product branches include live camera, Ackermann control, global-planning visualization, traffic/semaphore data, serial hardware, and vehicle monitoring. The README and source index support the main process wiring and documented integrations; unsampled implementation details are represented conservatively.

Main entry points: [`Brain/main.py`](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/main.py) (Process launcher), [`Brain/src/dashboard/processDashboard.py`](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/processDashboard.py) (Dashboard backend), [`Brain/src/dashboard/frontend/src/app/app.component.ts`](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/frontend/src/app/app.component.ts) (Dashboard UI), [`Brain/src/hardware/serialhandler/processSerialHandler.py`](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/hardware/serialhandler/processSerialHandler.py) (Serial handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime orchestration"]
  node_main["Process launcher<br/>[main.py]"]
end

subgraph group_dashboard["Dashboard experience"]
  node_dashboard_backend["Dashboard backend"]
  node_web_ui["Dashboard UI<br/>[app.component.ts]"]
  node_websocket["WebSocket service"]
  node_cluster["Cluster controls"]
  node_map_ui["Map display<br/>[map.component.ts]"]
  node_calibration["Calibration<br/>[calibration.py]"]
end

subgraph group_vehicle["Vehicle services"]
  node_serial["Serial handler"]
  node_serial_read["Serial reader<br/>[threadRead.py]"]
  node_camera["Camera service<br/>[processCamera.py]"]
  node_traffic["Traffic communication"]
  node_semaphores["Semaphore service"]
  node_gateway["Gateway service<br/>[processGateway.py]"]
  node_state_machine["State machine<br/>[stateMachine.py]"]
  node_system_mode["System modes<br/>[systemMode.py]"]
end

subgraph group_ros["ROS2 integrations"]
  node_ackermann["Ackermann bridge"]
  node_global_planning["Global planning bridge"]
  node_ros_camera["ROS camera receiver"]
end

subgraph group_messaging["Message infrastructure"]
  node_messages["Message definitions<br/>[allMessages.py]"]
  node_sender["Message sender"]
  node_subscriber["Message subscriber"]
  node_queues["Interprocess queues"]
end

node_operator(("Vehicle operator"))
node_ros2(("ROS2 topics"))
node_traffic_server(("Traffic service"))
node_vehicle_hardware(("Vehicle serial hardware"))
node_camera_source(("Camera source"))

node_operator -->|"operates"| node_web_ui
node_web_ui -->|"sends controls"| node_websocket
node_websocket -->|"WebSocket and HTTP"| node_dashboard_backend
node_dashboard_backend -.->|"streams updates"| node_websocket
node_web_ui -->|"renders controls"| node_cluster
node_web_ui -.->|"renders map"| node_map_ui
node_dashboard_backend -->|"handles calibration"| node_calibration
node_main -->|"starts"| node_dashboard_backend
node_main -->|"starts"| node_ackermann
node_main -->|"starts"| node_global_planning
node_main -->|"starts"| node_ros_camera
node_main -->|"starts"| node_serial
node_main -->|"starts"| node_traffic
node_main -->|"starts"| node_semaphores
node_main -->|"starts"| node_gateway
node_main -.->|"starts"| node_state_machine
node_ackermann -->|"receives commands"| node_ros2
node_ackermann -->|"forwards speed and steer"| node_serial
node_global_planning -->|"exchanges planning data"| node_ros2
node_global_planning -->|"forwards map and pose data"| node_dashboard_backend
node_ros_camera -->|"receives frames"| node_camera_source
node_ros_camera -->|"forwards frames"| node_dashboard_backend
node_dashboard_backend -->|"provides map data"| node_map_ui
node_traffic -.->|"communicates"| node_traffic_server
node_serial -->|"starts reader"| node_serial_read
node_serial -.->|"serial I/O"| node_vehicle_hardware
node_semaphores -.->|"shares traffic data"| node_traffic
node_state_machine -->|"uses modes"| node_system_mode
node_dashboard_backend -->|"publishes commands"| node_sender
node_dashboard_backend -->|"subscribes to state"| node_subscriber
node_sender -->|"encodes message type"| node_messages
node_subscriber -->|"registers subscriptions"| node_queues
node_sender -->|"writes payloads"| node_queues
node_serial_read -->|"publishes telemetry"| node_sender
node_cluster -->|"sends dashboard actions"| node_websocket

click node_main "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/main.py"
click node_dashboard_backend "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/processDashboard.py"
click node_web_ui "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/frontend/src/app/app.component.ts"
click node_websocket "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/frontend/src/app/webSocket/web-socket.service.ts"
click node_cluster "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/frontend/src/app/cluster/state-switch/state-switch.component.ts"
click node_map_ui "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/frontend/src/app/cluster/map/map.component.ts"
click node_calibration "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/components/calibration.py"
click node_ackermann "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/bridge/processAckermannBridge.py"
click node_global_planning "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/bridge/processGlobalPlanningBridge.py"
click node_ros_camera "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/hardware/camera/processRosCamera.py"
click node_serial "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/hardware/serialhandler/processSerialHandler.py"
click node_serial_read "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/hardware/serialhandler/threads/threadRead.py"
click node_camera "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/hardware/camera/processCamera.py"
click node_traffic "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/data/TrafficCommunication/processTrafficCommunication.py"
click node_semaphores "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/data/Semaphores/processSemaphores.py"
click node_gateway "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/gateway/processGateway.py"
click node_state_machine "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/statemachine/stateMachine.py"
click node_system_mode "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/statemachine/systemMode.py"
click node_messages "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/utils/messages/allMessages.py"
click node_sender "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/utils/messages/messageHandlerSender.py"
click node_subscriber "https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/utils/messages/messageHandlerSubscriber.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_main toneBlue
class node_dashboard_backend,node_web_ui,node_websocket,node_cluster,node_map_ui,node_calibration toneAmber
class node_serial,node_serial_read,node_camera,node_traffic,node_semaphores,node_gateway,node_state_machine,node_system_mode toneMint
class node_ackermann,node_global_planning,node_ros_camera toneRose
class node_messages,node_sender,node_subscriber,node_queues,node_operator,node_ros2,node_traffic_server,node_vehicle_hardware,node_camera_source toneIndigo
```

## Components

### Runtime orchestration

- [Process launcher](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/main.py): `Brain/main.py`

### Dashboard experience

- [Dashboard backend](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/processDashboard.py): `Brain/src/dashboard/processDashboard.py`
- [Dashboard UI](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/frontend/src/app/app.component.ts): `Brain/src/dashboard/frontend/src/app/app.component.ts`
- [WebSocket service](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/frontend/src/app/webSocket/web-socket.service.ts): `Brain/src/dashboard/frontend/src/app/webSocket/web-socket.service.ts`
- [Cluster controls](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/frontend/src/app/cluster/state-switch/state-switch.component.ts): `Brain/src/dashboard/frontend/src/app/cluster/state-switch/state-switch.component.ts`
- [Map display](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/frontend/src/app/cluster/map/map.component.ts): `Brain/src/dashboard/frontend/src/app/cluster/map/map.component.ts`
- [Calibration](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/dashboard/components/calibration.py): `Brain/src/dashboard/components/calibration.py`

### Vehicle services

- [Serial handler](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/hardware/serialhandler/processSerialHandler.py): `Brain/src/hardware/serialhandler/processSerialHandler.py`
- [Serial reader](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/hardware/serialhandler/threads/threadRead.py): `Brain/src/hardware/serialhandler/threads/threadRead.py`
- [Camera service](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/hardware/camera/processCamera.py): `Brain/src/hardware/camera/processCamera.py`
- [Traffic communication](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/data/TrafficCommunication/processTrafficCommunication.py): `Brain/src/data/TrafficCommunication/processTrafficCommunication.py`
- [Semaphore service](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/data/Semaphores/processSemaphores.py): `Brain/src/data/Semaphores/processSemaphores.py`
- [Gateway service](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/gateway/processGateway.py): `Brain/src/gateway/processGateway.py`
- [State machine](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/statemachine/stateMachine.py): `Brain/src/statemachine/stateMachine.py`
- [System modes](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/statemachine/systemMode.py): `Brain/src/statemachine/systemMode.py`

### ROS2 integrations

- [Ackermann bridge](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/bridge/processAckermannBridge.py): `Brain/src/bridge/processAckermannBridge.py`
- [Global planning bridge](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/bridge/processGlobalPlanningBridge.py): `Brain/src/bridge/processGlobalPlanningBridge.py`
- [ROS camera receiver](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/hardware/camera/processRosCamera.py): `Brain/src/hardware/camera/processRosCamera.py`

### Message infrastructure

- [Message definitions](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/utils/messages/allMessages.py): `Brain/src/utils/messages/allMessages.py`
- [Message sender](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/utils/messages/messageHandlerSender.py): `Brain/src/utils/messages/messageHandlerSender.py`
- [Message subscriber](https://github.com/bfmc2026-sea-me/seame_brain/blob/main/Brain/src/utils/messages/messageHandlerSubscriber.py): `Brain/src/utils/messages/messageHandlerSubscriber.py`
- **Interprocess queues**

### Other components

- **Vehicle operator**
- **ROS2 topics**
- **Traffic service**
- **Vehicle serial hardware**
- **Camera source**

## Connections

- Vehicle operator → Dashboard UI: operates
- Dashboard UI → WebSocket service: sends controls (evidence: `Brain/src/dashboard/frontend/src/app/app.component.ts`)
- WebSocket service → Dashboard backend: WebSocket and HTTP
- Dashboard backend → WebSocket service: streams updates
- Dashboard UI → Cluster controls: renders controls (evidence: `Brain/src/dashboard/frontend/src/app/app.component.ts`)
- Dashboard UI → Map display: renders map
- Dashboard backend → Calibration: handles calibration (evidence: `Brain/src/dashboard/processDashboard.py`)
- Process launcher → Dashboard backend: starts (evidence: `Brain/main.py`)
- Process launcher → Ackermann bridge: starts (evidence: `Brain/main.py`)
- Process launcher → Global planning bridge: starts (evidence: `Brain/main.py`)
- Process launcher → ROS camera receiver: starts (evidence: `Brain/main.py`)
- Process launcher → Serial handler: starts (evidence: `Brain/main.py`)
- Process launcher → Traffic communication: starts (evidence: `Brain/main.py`)
- Process launcher → Semaphore service: starts (evidence: `Brain/main.py`)
- Process launcher → Gateway service: starts (evidence: `Brain/main.py`)
- Process launcher → State machine: starts (evidence: `Brain/main.py`)
- Ackermann bridge → ROS2 topics: receives commands
- Ackermann bridge → Serial handler: forwards speed and steer
- Global planning bridge → ROS2 topics: exchanges planning data (evidence: `Brain/src/bridge/processGlobalPlanningBridge.py`)
- Global planning bridge → Dashboard backend: forwards map and pose data (evidence: `Brain/src/dashboard/processDashboard.py`)
- ROS camera receiver → Camera source: receives frames
- ROS camera receiver → Dashboard backend: forwards frames
- Dashboard backend → Map display: provides map data
- Traffic communication → Traffic service: communicates
- Serial handler → Serial reader: starts reader (evidence: `Brain/src/hardware/serialhandler/processSerialHandler.py`)
- Serial handler → Vehicle serial hardware: serial I/O
- Semaphore service → Traffic communication: shares traffic data
- State machine → System modes: uses modes (evidence: `Brain/src/statemachine/stateMachine.py`)
- Dashboard backend → Message sender: publishes commands (evidence: `Brain/src/dashboard/processDashboard.py`)
- Dashboard backend → Message subscriber: subscribes to state (evidence: `Brain/src/dashboard/processDashboard.py`)
- Message sender → Message definitions: encodes message type (evidence: `Brain/src/utils/messages/messageHandlerSender.py`)
- Message subscriber → Interprocess queues: registers subscriptions (evidence: `Brain/src/utils/messages/messageHandlerSubscriber.py`)
- Message sender → Interprocess queues: writes payloads (evidence: `Brain/src/utils/messages/messageHandlerSender.py`)
- Serial reader → Message sender: publishes telemetry (evidence: `Brain/src/hardware/serialhandler/threads/threadRead.py`)
- Cluster controls → WebSocket service: sends dashboard actions (evidence: `Brain/src/dashboard/frontend/src/app/cluster/state-switch/state-switch.component.ts`)
