# jcy9066/dabom_capstone architecture

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

- Interactive diagram: https://gitdiagram.com/jcy9066/dabom_capstone
- Repository: https://github.com/jcy9066/dabom_capstone

## Overview

Autonomous Patrol Bot connects a Raspberry Pi robot to a GPU-hosted control server. The main workflow carries camera, LiDAR, and encoder telemetry from the robot to the server; the dashboard displays status and video, while operators issue manual commands. The server also supports perception, map management, localization, and Nav2 dry-run navigation. The README documents several subsystem links whose implementation files were not sampled; those links cite the README rather than implying that unsampled source was inspected. Actual autonomous motor output is documented as blocked.

Main entry points: [`server/app.py`](https://github.com/jcy9066/dabom_capstone/blob/main/server/app.py) (FastAPI Server), [`raspberry/robot_command_client.py`](https://github.com/jcy9066/dabom_capstone/blob/main/raspberry/robot_command_client.py) (Raspberry Pi), [`server/auth_service.py`](https://github.com/jcy9066/dabom_capstone/blob/main/server/auth_service.py) (Account Auth), [`perception/main.py`](https://github.com/jcy9066/dabom_capstone/blob/main/perception/main.py) (Inference Runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Server Control"]
  node_server["FastAPI Server<br/>[app.py]"]
  node_auth["Account Auth<br/>[auth_service.py]"]
  node_database[("MySQL Accounts<br/>[database.py]")]
  node_email["Email Verification<br/>[email_service.py]"]
  node_encoder["Encoder Odometry"]
  node_lidar_bridge["LiDAR Bridge"]
  node_nav_api["Navigation API"]
  node_map_service["Map Management"]
end

subgraph group_dashboard["Web Dashboard"]
  node_frontend["Dashboard App<br/>[app.py]"]
  node_camera["Video Feed<br/>[camera_service.py]"]
  node_ui_controls["Dashboard Controls"]
end

subgraph group_perception["AI Perception"]
  node_perception_entry["Inference Runtime<br/>[main.py]"]
  node_pipeline["Pipeline Selection"]
  node_frame_processor["Frame Analysis<br/>[frame_processor.py]"]
  node_device["CUDA Device<br/>[device.py]"]
  node_action_models["Action Models"]
  node_action_batch["Action Batching<br/>[action_batch.py]"]
  node_action_policy["Action Policy<br/>[action_policy.py]"]
  node_violence["Violence Heuristic"]
end

subgraph group_navigation["ROS Navigation"]
  node_ros_modes["Mapping Localization"]
  node_nav2["Nav2 Commands"]
  node_dryrun["Dry-run Planner<br/>[dry_run_planner.py]"]
  node_map_bridge["ROS Map Bridge<br/>[map_bridge.py]"]
end

subgraph group_robot["Robot Hardware"]
  node_pi["Raspberry Pi"]
  node_motor["Motor Controller"]
  node_pico["Pico W Firmware"]
  node_speaker["Speaker Stub"]
end

node_operator(("Operator"))
node_camera_sensor(("Robot Camera"))
node_lidar_sensor(("Robot LiDAR"))

node_operator -->|"opens dashboard"| node_frontend
node_frontend -->|"uses control APIs"| node_server
node_server -->|"handles authentication"| node_auth
node_auth -->|"reads and writes"| node_database
node_auth -->|"requests verification"| node_email
node_server -->|"serves video feed"| node_camera
node_camera_sensor -->|"captures video"| node_pi
node_pi -->|"uploads H.264"| node_server
node_operator -->|"selects controls"| node_ui_controls
node_ui_controls -->|"sends commands"| node_server
node_server -->|"processes streams"| node_perception_entry
node_perception_entry -->|"creates pipeline"| node_pipeline
node_pipeline -->|"resolves device"| node_device
node_perception_entry -->|"processes frames"| node_frame_processor
node_pipeline -->|"selects model"| node_action_models
node_action_models -->|"uses batching"| node_action_batch
node_action_models -->|"uses policy"| node_action_policy
node_frame_processor -->|"evaluates behavior"| node_violence
node_lidar_sensor -->|"publishes scan"| node_pi
node_pi -->|"forwards scan"| node_lidar_bridge
node_lidar_bridge -->|"feeds ROS scan"| node_ros_modes
node_pi -->|"sends encoder ticks"| node_server
node_server -->|"forwards telemetry"| node_encoder
node_operator -->|"manages maps"| node_nav_api
node_nav_api -->|"loads and saves"| node_map_service
node_map_service -->|"exchanges map data"| node_map_bridge
node_ros_modes -->|"starts navigation"| node_nav2
node_nav2 -->|"routes dry-run output"| node_dryrun
node_dryrun -.->|"reports dry-run"| node_server
node_server -->|"sends manual commands"| node_pi
node_pi -->|"dispatches commands"| node_motor
node_motor -->|"controls over UART"| node_pico
node_pi -->|"dispatches speech"| node_speaker

click node_server "https://github.com/jcy9066/dabom_capstone/blob/main/server/app.py"
click node_auth "https://github.com/jcy9066/dabom_capstone/blob/main/server/auth_service.py"
click node_database "https://github.com/jcy9066/dabom_capstone/blob/main/server/database.py"
click node_email "https://github.com/jcy9066/dabom_capstone/blob/main/server/email_service.py"
click node_encoder "https://github.com/jcy9066/dabom_capstone/blob/main/server/encoder_ros_bridge.py"
click node_lidar_bridge "https://github.com/jcy9066/dabom_capstone/blob/main/server/lidar_ros_bridge.py"
click node_nav_api "https://github.com/jcy9066/dabom_capstone/blob/main/server/navigation_map_api.py"
click node_map_service "https://github.com/jcy9066/dabom_capstone/blob/main/server/navigation_map_service.py"
click node_frontend "https://github.com/jcy9066/dabom_capstone/blob/main/frontend/app.py"
click node_camera "https://github.com/jcy9066/dabom_capstone/blob/main/frontend/services/camera_service.py"
click node_ui_controls "https://github.com/jcy9066/dabom_capstone/tree/main/frontend/services/static"
click node_perception_entry "https://github.com/jcy9066/dabom_capstone/blob/main/perception/main.py"
click node_pipeline "https://github.com/jcy9066/dabom_capstone/blob/main/perception/pipeline_factory.py"
click node_frame_processor "https://github.com/jcy9066/dabom_capstone/blob/main/perception/frame_processor.py"
click node_device "https://github.com/jcy9066/dabom_capstone/blob/main/perception/device.py"
click node_action_models "https://github.com/jcy9066/dabom_capstone/tree/main/perception/models"
click node_action_batch "https://github.com/jcy9066/dabom_capstone/blob/main/perception/models/action_batch.py"
click node_action_policy "https://github.com/jcy9066/dabom_capstone/blob/main/perception/models/action_policy.py"
click node_violence "https://github.com/jcy9066/dabom_capstone/blob/main/perception/models/violence_heuristic.py"
click node_ros_modes "https://github.com/jcy9066/dabom_capstone/tree/main/navigation/ros/patrol_navigation/launch"
click node_nav2 "https://github.com/jcy9066/dabom_capstone/blob/main/navigation/ros/patrol_navigation/patrol_navigation/nav2_command_bridge.py"
click node_dryrun "https://github.com/jcy9066/dabom_capstone/blob/main/navigation/dry_run_planner.py"
click node_map_bridge "https://github.com/jcy9066/dabom_capstone/blob/main/navigation/ros/patrol_navigation/patrol_navigation/map_bridge.py"
click node_pi "https://github.com/jcy9066/dabom_capstone/blob/main/raspberry/robot_command_client.py"
click node_motor "https://github.com/jcy9066/dabom_capstone/blob/main/raspberry/controllers/motor_controller.py"
click node_speaker "https://github.com/jcy9066/dabom_capstone/blob/main/raspberry/controllers/speaker_controller.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_server,node_auth,node_database,node_email,node_encoder,node_lidar_bridge,node_nav_api,node_map_service toneBlue
class node_frontend,node_camera,node_ui_controls toneAmber
class node_perception_entry,node_pipeline,node_frame_processor,node_device,node_action_models,node_action_batch,node_action_policy,node_violence toneMint
class node_ros_modes,node_nav2,node_dryrun,node_map_bridge toneRose
class node_pi,node_motor,node_pico,node_speaker,node_operator,node_camera_sensor,node_lidar_sensor toneIndigo
```

## Components

### Server Control

- [FastAPI Server](https://github.com/jcy9066/dabom_capstone/blob/main/server/app.py): `server/app.py`
- [Account Auth](https://github.com/jcy9066/dabom_capstone/blob/main/server/auth_service.py): `server/auth_service.py`
- [MySQL Accounts](https://github.com/jcy9066/dabom_capstone/blob/main/server/database.py): `server/database.py`
- [Email Verification](https://github.com/jcy9066/dabom_capstone/blob/main/server/email_service.py): `server/email_service.py`
- [Encoder Odometry](https://github.com/jcy9066/dabom_capstone/blob/main/server/encoder_ros_bridge.py): `server/encoder_ros_bridge.py`
- [LiDAR Bridge](https://github.com/jcy9066/dabom_capstone/blob/main/server/lidar_ros_bridge.py): `server/lidar_ros_bridge.py`
- [Navigation API](https://github.com/jcy9066/dabom_capstone/blob/main/server/navigation_map_api.py): `server/navigation_map_api.py`
- [Map Management](https://github.com/jcy9066/dabom_capstone/blob/main/server/navigation_map_service.py): `server/navigation_map_service.py`

### Web Dashboard

- [Dashboard App](https://github.com/jcy9066/dabom_capstone/blob/main/frontend/app.py): `frontend/app.py`
- [Video Feed](https://github.com/jcy9066/dabom_capstone/blob/main/frontend/services/camera_service.py): `frontend/services/camera_service.py`
- [Dashboard Controls](https://github.com/jcy9066/dabom_capstone/tree/main/frontend/services/static): `frontend/services/static`

### AI Perception

- [Inference Runtime](https://github.com/jcy9066/dabom_capstone/blob/main/perception/main.py): `perception/main.py`
- [Pipeline Selection](https://github.com/jcy9066/dabom_capstone/blob/main/perception/pipeline_factory.py): `perception/pipeline_factory.py`
- [Frame Analysis](https://github.com/jcy9066/dabom_capstone/blob/main/perception/frame_processor.py): `perception/frame_processor.py`
- [CUDA Device](https://github.com/jcy9066/dabom_capstone/blob/main/perception/device.py): `perception/device.py`
- [Action Models](https://github.com/jcy9066/dabom_capstone/tree/main/perception/models): `perception/models`
- [Action Batching](https://github.com/jcy9066/dabom_capstone/blob/main/perception/models/action_batch.py): `perception/models/action_batch.py`
- [Action Policy](https://github.com/jcy9066/dabom_capstone/blob/main/perception/models/action_policy.py): `perception/models/action_policy.py`
- [Violence Heuristic](https://github.com/jcy9066/dabom_capstone/blob/main/perception/models/violence_heuristic.py): `perception/models/violence_heuristic.py`

### ROS Navigation

- [Mapping Localization](https://github.com/jcy9066/dabom_capstone/tree/main/navigation/ros/patrol_navigation/launch): `navigation/ros/patrol_navigation/launch`
- [Nav2 Commands](https://github.com/jcy9066/dabom_capstone/blob/main/navigation/ros/patrol_navigation/patrol_navigation/nav2_command_bridge.py): `navigation/ros/patrol_navigation/patrol_navigation/nav2_command_bridge.py`
- [Dry-run Planner](https://github.com/jcy9066/dabom_capstone/blob/main/navigation/dry_run_planner.py): `navigation/dry_run_planner.py`
- [ROS Map Bridge](https://github.com/jcy9066/dabom_capstone/blob/main/navigation/ros/patrol_navigation/patrol_navigation/map_bridge.py): `navigation/ros/patrol_navigation/patrol_navigation/map_bridge.py`

### Robot Hardware

- [Raspberry Pi](https://github.com/jcy9066/dabom_capstone/blob/main/raspberry/robot_command_client.py): `raspberry/robot_command_client.py`
- [Motor Controller](https://github.com/jcy9066/dabom_capstone/blob/main/raspberry/controllers/motor_controller.py): `raspberry/controllers/motor_controller.py`
- **Pico W Firmware**
- [Speaker Stub](https://github.com/jcy9066/dabom_capstone/blob/main/raspberry/controllers/speaker_controller.py): `raspberry/controllers/speaker_controller.py`

### Other components

- **Operator**
- **Robot Camera**
- **Robot LiDAR**

## Connections

- Operator → Dashboard App: opens dashboard (evidence: `README.md`)
- Dashboard App → FastAPI Server: uses control APIs (evidence: `README.md`)
- FastAPI Server → Account Auth: handles authentication (evidence: `server/app.py`)
- Account Auth → MySQL Accounts: reads and writes (evidence: `server/auth_service.py`)
- Account Auth → Email Verification: requests verification (evidence: `server/auth_service.py`)
- FastAPI Server → Video Feed: serves video feed (evidence: `README.md`)
- Robot Camera → Raspberry Pi: captures video (evidence: `README.md`)
- Raspberry Pi → FastAPI Server: uploads H.264 (evidence: `README.md`)
- Operator → Dashboard Controls: selects controls (evidence: `README.md`)
- Dashboard Controls → FastAPI Server: sends commands (evidence: `README.md`)
- FastAPI Server → Inference Runtime: processes streams (evidence: `server/app.py`)
- Inference Runtime → Pipeline Selection: creates pipeline (evidence: `perception/main.py`)
- Pipeline Selection → CUDA Device: resolves device (evidence: `perception/pipeline_factory.py`)
- Inference Runtime → Frame Analysis: processes frames (evidence: `perception/main.py`)
- Pipeline Selection → Action Models: selects model (evidence: `perception/pipeline_factory.py`)
- Action Models → Action Batching: uses batching (evidence: `perception/models/action_rtmpose_posec3d.py`)
- Action Models → Action Policy: uses policy (evidence: `perception/models/action_rtmpose_posec3d.py`)
- Frame Analysis → Violence Heuristic: evaluates behavior (evidence: `perception/frame_processor.py`)
- Robot LiDAR → Raspberry Pi: publishes scan (evidence: `README.md`)
- Raspberry Pi → LiDAR Bridge: forwards scan (evidence: `README.md`)
- LiDAR Bridge → Mapping Localization: feeds ROS scan (evidence: `README.md`)
- Raspberry Pi → FastAPI Server: sends encoder ticks (evidence: `README.md`)
- FastAPI Server → Encoder Odometry: forwards telemetry (evidence: `README.md`)
- Operator → Navigation API: manages maps (evidence: `README.md`)
- Navigation API → Map Management: loads and saves (evidence: `README.md`)
- Map Management → ROS Map Bridge: exchanges map data (evidence: `README.md`)
- Mapping Localization → Nav2 Commands: starts navigation (evidence: `README.md`)
- Nav2 Commands → Dry-run Planner: routes dry-run output (evidence: `README.md`)
- Dry-run Planner → FastAPI Server: reports dry-run (evidence: `server/app.py`)
- FastAPI Server → Raspberry Pi: sends manual commands (evidence: `README.md`)
- Raspberry Pi → Motor Controller: dispatches commands (evidence: `raspberry/robot_command_client.py`)
- Motor Controller → Pico W Firmware: controls over UART (evidence: `README.md`)
- Raspberry Pi → Speaker Stub: dispatches speech (evidence: `raspberry/robot_command_client.py`)
