# azzmou/smart-mobile-base-ai architecture

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

- Interactive diagram: https://gitdiagram.com/azzmou/smart-mobile-base-ai
- Repository: https://github.com/azzmou/smart-mobile-base-ai

## Overview

This is a two-controller mobile robot: the Raspberry Pi captures video, tracks a target in either HSV color or EfficientDet-Lite0 mode, and sends movement commands to an Arduino; the Arduino handles motors and ultrasonic safety. The shown Python excerpt supports the vision, decision, and serial relationships. The Arduino source is present in the tree but unsampled, so its internal behavior and the protocol’s implementation are not expanded.

Main entry points: [`OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py) (Runtime entry), [`OneDrive/Desktop/smart-mobile-base-ai/src/motor_control/motor_controller.ino`](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/motor_control/motor_controller.ino) (Arduino controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Vision and tracking"]
  node_main["Runtime entry<br/>[robot_finale.py]"]
  node_tracker["Hybrid tracker<br/>[robot_finale.py]"]
  node_hsv["HSV tracking<br/>[robot_finale.py]"]
  node_efficientdet["EfficientDet detection<br/>[robot_finale.py]"]
  node_visualization["Detection visualization<br/>[robot_finale.py]"]
end

subgraph group_control["Robot control"]
  node_decision["Motion decision<br/>[robot_finale.py]"]
  node_serial["Serial link<br/>[robot_finale.py]"]
  node_arduino["Arduino controller"]
  node_robot_hardware["Motors and sensors"]
end

node_operator(("Operator"))
node_webcam["USB webcam"]

node_operator -->|"selects mode"| node_main
node_webcam -->|"provides frames"| node_main
node_main -->|"initializes and calls"| node_tracker
node_tracker -->|"dispatches color mode"| node_hsv
node_tracker -->|"dispatches ML mode"| node_efficientdet
node_hsv -->|"draws tracking"| node_visualization
node_efficientdet -->|"draws detections"| node_visualization
node_main -->|"passes target result"| node_decision
node_decision -->|"sends movement commands"| node_serial
node_serial -->|"transfers commands"| node_arduino
node_arduino -.->|"reports obstacle"| node_serial
node_arduino -.->|"controls and senses"| node_robot_hardware

click node_main "https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py"
click node_tracker "https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py"
click node_hsv "https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py"
click node_efficientdet "https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py"
click node_visualization "https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py"
click node_decision "https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py"
click node_serial "https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py"
click node_arduino "https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/motor_control/motor_controller.ino"

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,node_tracker,node_hsv,node_efficientdet,node_visualization toneBlue
class node_decision,node_serial,node_arduino,node_robot_hardware toneAmber
class node_operator,node_webcam toneIndigo
```

## Components

### Vision and tracking

- [Runtime entry](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py): `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`
- [Hybrid tracker](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py): `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`
- [HSV tracking](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py): `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`
- [EfficientDet detection](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py): `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`
- [Detection visualization](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py): `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`

### Robot control

- [Motion decision](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py): `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`
- [Serial link](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py): `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`
- [Arduino controller](https://github.com/azzmou/smart-mobile-base-ai/blob/main/OneDrive/Desktop/smart-mobile-base-ai/src/motor_control/motor_controller.ino): `OneDrive/Desktop/smart-mobile-base-ai/src/motor_control/motor_controller.ino`
- **Motors and sensors**

### Other components

- **Operator**
- **USB webcam**

## Connections

- Operator → Runtime entry: selects mode (evidence: `README.md`)
- USB webcam → Runtime entry: provides frames (evidence: `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`)
- Runtime entry → Hybrid tracker: initializes and calls (evidence: `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`)
- Hybrid tracker → HSV tracking: dispatches color mode (evidence: `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`)
- Hybrid tracker → EfficientDet detection: dispatches ML mode (evidence: `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`)
- HSV tracking → Detection visualization: draws tracking (evidence: `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`)
- EfficientDet detection → Detection visualization: draws detections (evidence: `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`)
- Runtime entry → Motion decision: passes target result (evidence: `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`)
- Motion decision → Serial link: sends movement commands (evidence: `OneDrive/Desktop/smart-mobile-base-ai/src/vision_ai/robot_finale.py`)
- Serial link → Arduino controller: transfers commands (evidence: `README.md`)
- Arduino controller → Serial link: reports obstacle
- Arduino controller → Motors and sensors: controls and senses
