# ak-wagle/my_bot architecture

> Architecture diagram of the GitHub repository ak-wagle/my_bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ak-wagle/my_bot
- Repository: https://github.com/ak-wagle/my_bot

## Overview

##### Main Components
a. Robot Description & Hardware Abstraction:
b. Configuration & Parameter Management:
- A section for “Configurations” encompassing all YAML files (e.g., nav2_params.yaml, ball_tracker_params_*.yaml, joystick.yaml). These files parameterize the various ROS nodes for localization, mapping, control, and ball tracking.
c. ROS Launch & Execution:
- A “Launch System” component that includes all the Python launch scripts (e.g., launch_robot.launch.py, ball_tracker.launch.py, navigation_launch.py, rsp.launch.py, etc.). These scripts instantiate and configure ROS nodes at runtime.
d. Simulation Environment:
- A “Simulation & Gazebo” block that references the worlds (empty.world, obstacles.world, obstacles101) and possibly includes Gazebo control (gazebo_control.xacro) being used to simulate the robot’s interaction with physical world dynamics.
e. SLAM and Navigation:
f. Ball Tracking and Joystick Control:
g. Web-Based Control Interface:
- A “Web Controller” module which is built in a separate directory. Label it with the technologies at play (React/Vite, ESLint configuration, etc.). Indicate it communicates via ROS 2 websocket/video server packages provided externally by collaborators.

##### Relationships and Data Flow
- “Robot Description & URDF” to the “Simulation & Gazebo” as well as to hardware-specific nodes if applicable.
- Sensor data (from simulation or real hardware) flowing to SLAM/Localization.
- Control commands from joystick or web-controller nodes to the drive system.
- Telemetry feedback (visualization, RViz configurations) linking with both simulation and web dashboard.
- Middleware (ROS topics/services) that link the various components.

##### Architectural Patterns and Key Design Principles
- Separation of Concerns: Emphasize that the project separates simulation, control, and configuration into distinct modules.
- Modularity: The existence of dedicated launch files and config files shows that each subsystem (e.g., SLAM, ball tracking, web control) is developed independently but interacts over a common ROS 2 middleware.
- Extensibility: The web-controller is a clear external module that interacts with ROS 2 via well-defined interfaces.

- Detail individual components around the core, linking configuration files to their respective nodes.
- Be precise: ensure all nodes, scripts, and configurations as discerned from the file tree and README are represented.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        WC["Web Controller (React/Vite, ESLint)"]:::web
    end

    %% ROS 2 Core Layer
    subgraph "ROS 2 Core Layer"
        LS["Launch System"]:::launch
        CF["Configurations"]:::config
        RD["Robot Description & URDF"]:::core
        SLAM["SLAM/Localization & Navigation"]:::core
        BT["Ball Tracking"]:::core
        JC["Joystick Control"]:::core
    end

    %% Hardware/Simulation Layer
    subgraph "Hardware/Simulation Layer"
        SIM["Simulation & Gazebo"]:::simulation
    end

    %% Relationships
    LS -->|"initiates"| SLAM
    LS -->|"initiates"| BT
    LS -->|"initiates"| JC
    LS -->|"initiates"| RD

    CF -->|"feeds"| SLAM
    CF -->|"feeds"| BT
    CF -->|"feeds"| JC

    RD -->|"defines_model"| SIM

    SIM -->|"sensor_data"| SLAM
    JC -->|"control_commands"| SIM
    WC -->|"commands/telemetry"| JC
    SIM -->|"telemetry_feedback"| WC

    %% Click Events
    click RD "https://github.com/ak-wagle/my_bot/tree/main/description/"
    click CF "https://github.com/ak-wagle/my_bot/tree/main/config/"
    click LS "https://github.com/ak-wagle/my_bot/tree/main/launch/"
    click SIM "https://github.com/ak-wagle/my_bot/tree/main/worlds/"
    click BT "https://github.com/ak-wagle/my_bot/blob/main/config/ball_tracker_params_robot.yaml"
    click JC "https://github.com/ak-wagle/my_bot/blob/main/config/joystick.yaml"
    click WC "https://github.com/ak-wagle/my_bot/tree/main/web-controller/"

    %% Styles
    classDef core fill:#e3f0ff,stroke:#333,stroke-width:2px;
    classDef launch fill:#eaffd0,stroke:#333,stroke-width:2px;
    classDef config fill:#f9e2e2,stroke:#333,stroke-width:2px;
    classDef simulation fill:#d0ffe5,stroke:#333,stroke-width:2px;
    classDef web fill:#d0dfff,stroke:#333,stroke-width:2px;
```
