# mohamed-montasser/robotic-inspection-system architecture

> Architecture diagram of the GitHub repository mohamed-montasser/robotic-inspection-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohamed-montasser/robotic-inspection-system
- Repository: https://github.com/mohamed-montasser/robotic-inspection-system

## Overview

##### Project type and purpose
- This is an embedded-vision robotics project composed of two independent subsystems:
a) Arduino-based robot movement controller
b) PC-based vision processing pipeline
- There is no data exchange between the two; they run in parallel on separate platforms.

##### File structure
- Top-level:
- LICENSE, README.md
- /arduino/: contains `code.ino` (robot control logic)
- /vision/: contains `recognition.py` (vision algorithm)
- No shared libraries, no network or API layers—each subsystem is self-contained.
- Deployment artifacts: Arduino sketch and Python script.

##### Extract insights from the README
- Hardware platform for movement: Arduino microcontroller + motor drivers
- Vision platform: PC with Python 3.x and OpenCV
- Instructions specify separate launch procedures; confirms architectural separation.

##### Main components
A. Hardware Layer
1. Robot Body
- Motors (DC or servo)
- Motor driver circuitry
- Power supply
2. Arduino Board
- ATmega MCU
3. Camera Sensor
- USB or MIPI-CSI interface
B. Software Layer – Arduino Subsystem
1. `code.ino`
2. Arduino IDE (build toolchain)
3. Motor control routines
C. Software Layer – Vision Subsystem
1. `recognition.py`
2. Python 3.x runtime
3. OpenCV (and other CV libraries)
4. Camera input feed
D. External Interfaces
1. USB (camera → PC)
2. USB or serial (PC → Arduino) [optional, but currently unused]

##### Relationships and interactions
- Hardware → Software: Camera feeds raw frames into `recognition.py`.
- Arduino code → Motors: control signals from MCU to motor driver.

##### Architectural patterns and principles
- Clear separation of concerns: Embedded control vs. vision processing
- Single responsibility per subsystem
- Modular design: each folder maps to a deployable unit
- Hardware/software layering: physical sensors/actuators at bottom, code above

##### Essential elements to capture
- Component boundaries (hardware vs. software, embedded vs. PC)
- Runtimes and libraries that enable each module
- Isolation of subsystems, making it obvious there is zero coupling today

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Embedded Subsystem
    subgraph "Embedded Subsystem"
        direction TB
        ArduinoDir["Arduino Subsystem Directory"]:::runtime
        ArduinoIDE["Arduino IDE (Toolchain)"]:::runtime
        ArduinoSketch["Arduino Sketch (code.ino)"]:::software
        MCURaw["ATmega MCU"]:::hardware
        MotorDriver["Motor Driver Circuitry"]:::hardware
        Motors["Motors"]:::hardware
        PowerSupply["Power Supply"]:::hardware
        ArduinoDir --> ArduinoIDE
        ArduinoIDE --> ArduinoSketch
        ArduinoSketch --> MCURaw
        MCURaw --> MotorDriver
        MotorDriver --> Motors
        PowerSupply --> MCURaw
    end

    %% Vision Subsystem
    subgraph "Vision Subsystem"
        direction TB
        VisionDir["Vision Subsystem Directory"]:::runtime
        PythonRuntime["Python 3.x Runtime"]:::runtime
        RecognitionScript["Recognition Script (recognition.py)"]:::software
        OpenCV["OpenCV & CV Libraries"]:::runtime
        Camera["Camera Sensor"]:::hardware
        VisionDir --> PythonRuntime
        PythonRuntime --> RecognitionScript
        RecognitionScript --> OpenCV
        Camera --> RecognitionScript
    end

    %% Future Integration (optional)
    ArduinoSketch -.->|"future_serial_link"| RecognitionScript

    %% Click Events
    click ArduinoDir "https://github.com/mohamed-montasser/robotic-inspection-system/tree/main/arduino/"
    click ArduinoSketch "https://github.com/mohamed-montasser/robotic-inspection-system/blob/main/arduino/code.ino"
    click VisionDir "https://github.com/mohamed-montasser/robotic-inspection-system/tree/main/Vision/"
    click RecognitionScript "https://github.com/mohamed-montasser/robotic-inspection-system/blob/main/Vision/recognition.py"

    %% Styles
    classDef hardware fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef software fill:#90EE90,stroke:#000,stroke-width:1px
    classDef runtime fill:#D3D3D3,stroke:#000,stroke-width:1px
```
