# jojoh2l/jetbot_pc_project_v3 architecture

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

- Interactive diagram: https://gitdiagram.com/jojoh2l/jetbot_pc_project_v3
- Repository: https://github.com/jojoh2l/jetbot_pc_project_v3

## Overview

JetBot PC Project v2 runs a configurable, frame-by-frame autonomy pipeline: it reads a camera or video source, produces model inferences, makes driving decisions, optionally sends motor commands, and logs and visualizes results for a dashboard. A separate JetBot-side Flask service streams camera frames and exposes motor-control endpoints backed by the robot driver. The README documents the main stages and safe defaults; some dashboard, logger, and visualization internals were not sampled, so their connections are limited to documented or indexed wiring.

Main entry points: [`PC/scripts/run_pipeline.py`](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/run_pipeline.py) (Pipeline Runtime), [`PC/scripts/nodes/ai_node.py`](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/ai_node.py) (AI Inference), [`PC/scripts/nodes/dashboard_node.py`](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/dashboard_node.py) (Dashboard), [`PC/scripts/core/config_store.py`](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/core/config_store.py) (Config Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["PC Runtime"]
  node_runtime["Pipeline Runtime<br/>[run_pipeline.py]"]
  node_camera["Camera / Video<br/>[camera_node.py]"]
  node_ai["AI Inference<br/>[ai_node.py]"]
  node_logic["Driving Logic<br/>[logic_node.py]"]
  node_robotclient["Robot Client"]
  node_logger["CSV Logger<br/>[logger_node.py]"]
  node_visualizer["Frame Visualizer"]
  node_dashboard["Dashboard<br/>[dashboard_node.py]"]
end

subgraph group_support["Configuration &amp; State"]
  node_messages["Runtime Messages<br/>[messages.py]"]
  node_config["Config Manager<br/>[config_store.py]"]
  node_configfile[("Tuning CSV<br/>[tuning.csv]")]
  node_state[("Shared State<br/>[shared_state.py]")]
end

subgraph group_jetbot["JetBot Device"]
  node_device(("JetBot Device"))
  node_jetbotservice["Camera / Motor API<br/>[stream_video2.py]"]
  node_driver["Motor Driver<br/>[move_jetbot.py]"]
end

subgraph group_models["AI Models"]
  node_roadmodel["Road Following<br/>[ai_brain_v3.py]"]
  node_collisionmodel["Collision Avoidance<br/>[ai_brain_v3.py]"]
  node_yolo["Object Detection<br/>[ai_brain_v3.py]"]
end

node_operator(("Operator"))

node_operator -->|"tunes and monitors"| node_dashboard
node_runtime -->|"loads settings"| node_config
node_config -->|"reads and writes"| node_configfile
node_runtime -->|"reads frames"| node_camera
node_runtime -->|"runs inference"| node_ai
node_runtime -->|"decides commands"| node_logic
node_runtime -->|"sends commands"| node_robotclient
node_runtime -->|"writes records"| node_logger
node_runtime -->|"renders frames"| node_visualizer
node_runtime -->|"starts dashboard"| node_dashboard
node_runtime -->|"updates status and frames"| node_state
node_runtime -->|"refreshes settings"| node_config
node_ai -->|"calls model"| node_roadmodel
node_ai -->|"calls model"| node_collisionmodel
node_ai -->|"calls model"| node_yolo
node_camera -.->|"reads video stream"| node_jetbotservice
node_robotclient -.->|"posts motor commands"| node_jetbotservice
node_jetbotservice -->|"sets motors or stops"| node_driver
node_device -->|"provides camera and motors"| node_jetbotservice
node_dashboard -->|"updates settings"| node_config
node_dashboard -->|"reads live state"| node_state

click node_runtime "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/run_pipeline.py"
click node_camera "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/camera_node.py"
click node_ai "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/ai_node.py"
click node_logic "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/logic_node.py"
click node_robotclient "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/robot_client_node.py"
click node_logger "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/logger_node.py"
click node_visualizer "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/visualization_node.py"
click node_dashboard "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/dashboard_node.py"
click node_messages "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/core/messages.py"
click node_config "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/core/config_store.py"
click node_configfile "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/config/tuning.csv"
click node_state "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/core/shared_state.py"
click node_roadmodel "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/ai_brain_v3.py"
click node_collisionmodel "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/ai_brain_v3.py"
click node_yolo "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/ai_brain_v3.py"
click node_jetbotservice "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/JETBOT/stream_video2.py"
click node_driver "https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/JETBOT/move_jetbot.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_runtime,node_camera,node_ai,node_logic,node_robotclient,node_logger,node_visualizer,node_dashboard toneBlue
class node_messages,node_config,node_configfile,node_state toneAmber
class node_device,node_jetbotservice,node_driver toneMint
class node_roadmodel,node_collisionmodel,node_yolo toneRose
class node_operator toneIndigo
```

## Components

### PC Runtime

- [Pipeline Runtime](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/run_pipeline.py): `PC/scripts/run_pipeline.py`
- [Camera / Video](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/camera_node.py): `PC/scripts/nodes/camera_node.py`
- [AI Inference](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/ai_node.py): `PC/scripts/nodes/ai_node.py`
- [Driving Logic](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/logic_node.py): `PC/scripts/nodes/logic_node.py`
- [Robot Client](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/robot_client_node.py): `PC/scripts/nodes/robot_client_node.py`
- [CSV Logger](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/logger_node.py): `PC/scripts/nodes/logger_node.py`
- [Frame Visualizer](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/visualization_node.py): `PC/scripts/nodes/visualization_node.py`
- [Dashboard](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/nodes/dashboard_node.py): `PC/scripts/nodes/dashboard_node.py`

### Configuration & State

- [Runtime Messages](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/core/messages.py): `PC/scripts/core/messages.py`
- [Config Manager](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/core/config_store.py): `PC/scripts/core/config_store.py`
- [Tuning CSV](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/config/tuning.csv): `PC/config/tuning.csv`
- [Shared State](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/core/shared_state.py): `PC/scripts/core/shared_state.py`

### JetBot Device

- **JetBot Device**
- [Camera / Motor API](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/JETBOT/stream_video2.py): `JETBOT/stream_video2.py`
- [Motor Driver](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/JETBOT/move_jetbot.py): `JETBOT/move_jetbot.py`

### AI Models

- [Road Following](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/ai_brain_v3.py): `PC/scripts/ai_brain_v3.py`
- [Collision Avoidance](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/ai_brain_v3.py): `PC/scripts/ai_brain_v3.py`
- [Object Detection](https://github.com/jojoh2l/jetbot_pc_project_v3/blob/main/PC/scripts/ai_brain_v3.py): `PC/scripts/ai_brain_v3.py`

### Other components

- **Operator**

## Connections

- Operator → Dashboard: tunes and monitors (evidence: `README.md`)
- Pipeline Runtime → Config Manager: loads settings (evidence: `PC/scripts/run_pipeline.py`)
- Config Manager → Tuning CSV: reads and writes (evidence: `PC/scripts/core/config_store.py`)
- Pipeline Runtime → Camera / Video: reads frames (evidence: `PC/scripts/run_pipeline.py`)
- Pipeline Runtime → AI Inference: runs inference (evidence: `PC/scripts/run_pipeline.py`)
- Pipeline Runtime → Driving Logic: decides commands (evidence: `PC/scripts/run_pipeline.py`)
- Pipeline Runtime → Robot Client: sends commands (evidence: `PC/scripts/run_pipeline.py`)
- Pipeline Runtime → CSV Logger: writes records (evidence: `PC/scripts/run_pipeline.py`)
- Pipeline Runtime → Frame Visualizer: renders frames (evidence: `PC/scripts/run_pipeline.py`)
- Pipeline Runtime → Dashboard: starts dashboard (evidence: `PC/scripts/run_pipeline.py`)
- Pipeline Runtime → Shared State: updates status and frames (evidence: `PC/scripts/run_pipeline.py`)
- Pipeline Runtime → Config Manager: refreshes settings (evidence: `PC/scripts/run_pipeline.py`)
- AI Inference → Road Following: calls model (evidence: `PC/scripts/nodes/ai_node.py`)
- AI Inference → Collision Avoidance: calls model (evidence: `PC/scripts/nodes/ai_node.py`)
- AI Inference → Object Detection: calls model (evidence: `PC/scripts/nodes/ai_node.py`)
- Camera / Video → Camera / Motor API: reads video stream
- Robot Client → Camera / Motor API: posts motor commands
- Camera / Motor API → Motor Driver: sets motors or stops (evidence: `JETBOT/stream_video2.py`)
- JetBot Device → Camera / Motor API: provides camera and motors
- Dashboard → Config Manager: updates settings (evidence: `PC/scripts/nodes/dashboard_node.py`)
- Dashboard → Shared State: reads live state (evidence: `PC/scripts/nodes/dashboard_node.py`)
