# jayaschool1981-rgb/ai-based-autonomous-navigation-system architecture

> Architecture diagram of the GitHub repository jayaschool1981-rgb/ai-based-autonomous-navigation-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system
- Repository: https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system

## Overview

##### Project type and purpose
- This is an embedded robotics system rather than a web or desktop application.
- Purpose: enable a small vehicle (Raspberry Pi/Jetson-Nano-powered) to navigate autonomously by fusing vision (YOLO-tiny object detection, OpenCV lane detection), ultrasonic sensing, and A* path planning, driving DC motors via an L298N controller.

##### File structure
- models/
- coco.names, yolov3-tiny.cfg → YOLO model definition and classes for object detection
- requirements.txt → Python dependencies (OpenCV, PyTorch/TorchVision or Darknet bindings, NumPy, etc.)
- src/
- camera_capture.py → captures frames from USB/Pi camera
- yolo_detector.py → runs YOLO-tiny on each frame
- lane_detection.py → runs Hough-transform-based lane extraction
- ultrasonic_sensor.py → reads distance from HC-SR04
- astar_planner.py → computes collision-free route using A*
- motor_controller.py → drives L298N PWM signals for differential steering
- main_robot.py → orchestrator: calls capture → detect/lane/sense → plan → drive

##### README for additional insights
- Hardware stack: Pi/Jetson, camera, ultrasonic, L298N + motors
- Key features list confirms perception, planning, control pipeline
- Simulation mode hint: code can run without hardware—add a “Simulated Sensor/Actuator” sub-component when drawing

##### Be very detailed—capture every architectural element
- Don’t hesitate to show sub-components (e.g., split computer vision into “Object Detector” and “Lane Detector”)
- Both real-world hardware and software abstractions

## Diagram (Mermaid)

```mermaid
graph TB

    %% Perception Layer
    subgraph "Perception Layer"
        camera_capture["Camera Capture"]:::perception
        yolo_detector["YOLO Detector"]:::perception
        lane_detection["Lane Detector"]:::perception
    end

    %% Sensor Interface
    subgraph "Sensor Interface"
        ultrasonic_sensor["Ultrasonic Sensor Reader"]:::perception
    end

    %% Planning Layer
    subgraph "Planning Layer"
        astar_planner["A* Path Planner"]:::planning
    end

    %% Control Layer
    subgraph "Control Layer"
        motor_controller["Motor Controller"]:::control
    end

    %% Orchestrator
    main_robot["Main Robot Orchestrator"]:::orchestrator

    %% Models & Resources
    subgraph "Models & Resources"
        model_cfg["YOLO Config"]:::resources
        model_names["Class Names"]:::resources
    end
    requirements["requirements.txt"]:::resources
    readme["README.md"]:::resources

    %% Hardware
    subgraph "Hardware"
        camera_hw["Camera"]:::hardware
        ultrasonic_hw["HC-SR04 Ultrasonic Sensor"]:::hardware
        host["Raspberry Pi / Jetson Nano"]:::hardware
        motors_hw["L298N + DC Motors"]:::hardware
    end

    %% Simulation
    synthetic["Simulated Sensors/Actuators"]:::simulation

    %% Data Flow
    camera_hw --> camera_capture --> yolo_detector --> main_robot
    camera_capture --> lane_detection --> main_robot
    ultrasonic_hw --> ultrasonic_sensor --> main_robot
    main_robot --> astar_planner --> main_robot
    main_robot --> motor_controller --> motors_hw
    host --> main_robot

    %% Simulation Paths
    synthetic -.-> camera_capture
    synthetic -.-> ultrasonic_sensor
    synthetic -.-> motor_controller

    %% Resource Access
    yolo_detector --> model_cfg
    yolo_detector --> model_names
    main_robot --> requirements
    main_robot --> readme

    %% Click Events
    click camera_capture "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/src/camera_capture.py"
    click yolo_detector "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/src/yolo_detector.py"
    click lane_detection "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/src/lane_detection.py"
    click ultrasonic_sensor "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/src/ultrasonic_sensor.py"
    click astar_planner "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/src/astar_planner.py"
    click motor_controller "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/src/motor_controller.py"
    click main_robot "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/src/main_robot.py"
    click model_cfg "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/models/yolov3-tiny.cfg"
    click model_names "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/models/coco.names"
    click requirements "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/requirements.txt"
    click readme "https://github.com/jayaschool1981-rgb/ai-based-autonomous-navigation-system/blob/main/README.md"

    %% Styles
    classDef perception fill:#AED6F1,stroke:#21618C,stroke-width:1px
    classDef planning fill:#A9DFBF,stroke:#1E8449,stroke-width:1px
    classDef control fill:#F5B041,stroke:#B9770E,stroke-width:1px
    classDef orchestrator fill:#D7BDE2,stroke:#7D3C98,stroke-width:1px
    classDef resources fill:#F0B3FF,stroke:#9B59B6,stroke-width:1px
    classDef hardware fill:#D5D8DC,stroke:#566573,stroke-width:1px
    classDef simulation fill:#BDC3C7,stroke-dasharray: 5 5,stroke:#7F8C8D,stroke-width:1px
```
