# rakeshvarma007/autonomous-self-navigating-rover architecture

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

- Interactive diagram: https://gitdiagram.com/rakeshvarma007/autonomous-self-navigating-rover
- Repository: https://github.com/rakeshvarma007/autonomous-self-navigating-rover

## Overview

This is a Raspberry Pi–based autonomous rover with Arduino motor and ultrasonic control. Its main workflow captures camera frames, detects objects, combines detections with distance readings to choose movement, and sends commands to the rover; a Flask dashboard provides video, telemetry, manual control, and a kill switch. The main control, vision, and web logic share un.py. Dashboard interaction details are documented in the README, but the template was not sampled, so its specific wiring is not shown.

Main entry points: [`un.py`](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py) (Flask Routes), [`aurd.cpp`](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/aurd.cpp) (Arduino Firmware), [`templates/index.html`](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/templates/index.html) (Dashboard UI), [`yolov8n.onnx`](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/yolov8n.onnx) (ONNX Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_perception["Perception"]
  node_capture["Frame Capture<br/>[un.py]"]
  node_detector["YOLO Detector<br/>[un.py]"]
  node_model["ONNX Model<br/>[yolov8n.onnx]"]
end

subgraph group_navigation["Navigation and Hardware"]
  node_policy["Navigation Logic<br/>[un.py]"]
  node_distance["Distance Reader<br/>[un.py]"]
  node_hardware["Rover Hardware<br/>[un.py]"]
  node_firmware["Arduino Firmware<br/>[aurd.cpp]"]
end

subgraph group_dashboard["Web Dashboard"]
  node_flask["Flask Routes<br/>[un.py]"]
  node_stream["Video Stream<br/>[un.py]"]
  node_template["Dashboard UI<br/>[index.html]"]
  node_telemetry["Telemetry<br/>[un.py]"]
  node_manual["Manual Controls<br/>[un.py]"]
  node_kill["Kill Switch<br/>[un.py]"]
end

node_operator(("Operator"))
node_camera["Camera"]
node_rover["Motors and Sensor"]

node_camera -.->|"provides frames"| node_capture
node_capture -->|"passes frames"| node_detector
node_detector -->|"loads model"| node_model
node_detector -->|"returns detections"| node_policy
node_distance -->|"provides distance"| node_policy
node_policy -->|"issues commands"| node_hardware
node_hardware -->|"writes serial"| node_firmware
node_firmware -->|"sends readings"| node_distance
node_firmware -->|"drives motors"| node_rover
node_rover -->|"returns echo"| node_firmware
node_operator -->|"uses dashboard"| node_template
node_template -.->|"requests controls"| node_flask
node_flask -->|"serves feed"| node_stream
node_stream -->|"encodes frames"| node_capture
node_flask -->|"serves readings"| node_telemetry
node_flask -->|"dispatches control"| node_manual
node_manual -->|"sets manual mode"| node_policy
node_flask -->|"dispatches stop"| node_kill
node_kill -->|"stops rover"| node_hardware

click node_capture "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py"
click node_detector "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py"
click node_model "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/yolov8n.onnx"
click node_policy "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py"
click node_distance "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py"
click node_hardware "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py"
click node_firmware "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/aurd.cpp"
click node_flask "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py"
click node_stream "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py"
click node_template "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/templates/index.html"
click node_telemetry "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py"
click node_manual "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py"
click node_kill "https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.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_capture,node_detector,node_model toneBlue
class node_policy,node_distance,node_hardware,node_firmware toneAmber
class node_flask,node_stream,node_template,node_telemetry,node_manual,node_kill toneMint
class node_operator,node_camera,node_rover toneIndigo
```

## Components

### Perception

- [Frame Capture](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`
- [YOLO Detector](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`
- [ONNX Model](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/yolov8n.onnx): `yolov8n.onnx`

### Navigation and Hardware

- [Navigation Logic](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`
- [Distance Reader](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`
- [Rover Hardware](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`
- [Arduino Firmware](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/aurd.cpp): `aurd.cpp`

### Web Dashboard

- [Flask Routes](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`
- [Video Stream](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`
- [Dashboard UI](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/templates/index.html): `templates/index.html`
- [Telemetry](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`
- [Manual Controls](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`
- [Kill Switch](https://github.com/rakeshvarma007/autonomous-self-navigating-rover/blob/main/un.py): `un.py`

### Other components

- **Operator**
- **Camera**
- **Motors and Sensor**

## Connections

- Camera → Frame Capture: provides frames
- Frame Capture → YOLO Detector: passes frames (evidence: `un.py`)
- YOLO Detector → ONNX Model: loads model (evidence: `un.py`)
- YOLO Detector → Navigation Logic: returns detections (evidence: `un.py`)
- Distance Reader → Navigation Logic: provides distance (evidence: `un.py`)
- Navigation Logic → Rover Hardware: issues commands (evidence: `un.py`)
- Rover Hardware → Arduino Firmware: writes serial (evidence: `un.py`)
- Arduino Firmware → Distance Reader: sends readings (evidence: `aurd.cpp`)
- Arduino Firmware → Motors and Sensor: drives motors (evidence: `aurd.cpp`)
- Motors and Sensor → Arduino Firmware: returns echo (evidence: `aurd.cpp`)
- Operator → Dashboard UI: uses dashboard (evidence: `readme.md`)
- Dashboard UI → Flask Routes: requests controls
- Flask Routes → Video Stream: serves feed (evidence: `un.py`)
- Video Stream → Frame Capture: encodes frames (evidence: `un.py`)
- Flask Routes → Telemetry: serves readings (evidence: `un.py`)
- Flask Routes → Manual Controls: dispatches control (evidence: `un.py`)
- Manual Controls → Navigation Logic: sets manual mode (evidence: `un.py`)
- Flask Routes → Kill Switch: dispatches stop (evidence: `un.py`)
- Kill Switch → Rover Hardware: stops rover (evidence: `un.py`)
