# serkanmzlm/vehicle-control-sotfware architecture

> Architecture diagram of the GitHub repository serkanmzlm/vehicle-control-sotfware, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/serkanmzlm/vehicle-control-sotfware
- Repository: https://github.com/serkanmzlm/vehicle-control-sotfware

## Overview

Key Components to Include in the System Design:

##### Core System Architecture
a. Interface Layer (Top)
- Control inputs (Keyboard, Joystick, ESP8266)
- Visualization tools (RViz2, Gazebo, RQT)

b. Processing Layer (Middle)
- Commander Node (Main control logic)
- Control Unit Node
- Obstacle Avoidance System
- Sensor Processing

c. Hardware/Simulation Layer (Bottom)
- Physical Vehicle / Gazebo Simulation
- Sensors (Lidar, IMU, Camera)

##### Key Components Details

- src/modules/
- commander (Obstacle avoidance & estimation)
- control_unit (Input handling)
- camera (Image processing)
- laser_scan_filter (Sensor data processing)

- src/gz_bridge/
- create_model
- data_bridge

##### Data Flow Visualization
- Sensor data paths from hardware/simulation to processing
- Control command flow from input devices to actuators
- Demonstrate visualization data routing to RViz2/Gazebo

##### Specific Implementation Details
- Hardware Interfaces (as bold lines)
- Simulation-specific components with a distinct border style
- Real hardware interfaces with a different border style

##### Additional Elements
- A camera processing pipeline
- Sensor fusion architecture (future implementation)

Design Guidelines:

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef interface fill:#a8d1ff,stroke:#000
    classDef processing fill:#ffe0a8,stroke:#000
    classDef hardware fill:#ffa8a8,stroke:#000
    classDef bridge fill:#a8ffa8,stroke:#000
    classDef sensor fill:#ffeda8,stroke:#000
    classDef visualization fill:#e0a8ff,stroke:#000
    classDef config fill:#d3d3d3,stroke:#000

    %% Interface Layer
    subgraph Interface
        InputDevices["Input Devices"]:::interface
        KBControl["Keyboard Controller"]:::interface
        JoyControl["Joystick Controller"]:::interface
        ESPControl["ESP8266 Controller"]:::interface
        VizTools["Visualization Tools"]:::visualization
        RViz["RViz2"]:::visualization
        Gazebo["Gazebo"]:::visualization
        RQT["RQT"]:::visualization
    end

    %% Processing Layer
    subgraph Processing
        Commander["Commander Node"]:::processing
        ControlUnit["Control Unit"]:::processing
        ObstacleAvoid["Obstacle Avoidance"]:::processing
        SensorProc["Sensor Processing"]:::processing
        CameraProc["Camera Processing"]:::processing
        LaserProc["Laser Scan Processing"]:::processing
    end

    %% Hardware/Simulation Layer
    subgraph Hardware
        Vehicle["Physical Vehicle/Simulation"]:::hardware
        Sensors["Sensors"]:::sensor
        LIDAR["LIDAR"]:::sensor
        IMU["IMU"]:::sensor
        Camera["Camera"]:::sensor
        GZBridge["Gazebo Bridge"]:::bridge
    end

    %% Relationships
    InputDevices --> |Control| KBControl & JoyControl & ESPControl
    KBControl & JoyControl & ESPControl --> ControlUnit
    ControlUnit --> Commander
    Commander --> ObstacleAvoid
    Sensors --> SensorProc
    LIDAR --> LaserProc
    Camera --> CameraProc
    SensorProc --> Commander
    Commander --> Vehicle
    Vehicle --> GZBridge
    GZBridge --> VizTools
    VizTools --> RViz & Gazebo & RQT

    %% Click Events
    click KBControl "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/blob/main/src/modules/control_unit/include/control/keyboard.hpp"
    click JoyControl "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/blob/main/src/modules/control_unit/include/control/joystick.hpp"
    click ESPControl "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/blob/main/src/modules/control_unit/include/control/esp8266.hpp"
    click Commander "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/tree/main/src/modules/commander/"
    click ObstacleAvoid "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/blob/main/src/modules/commander/include/avoidance/avoidance.hpp"
    click ControlUnit "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/tree/main/src/modules/control_unit/"
    click LaserProc "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/tree/main/src/modules/laser_scan_filter/"
    click CameraProc "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/tree/main/src/modules/camera/"
    click RViz "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/blob/main/Tools/rviz/vehicle_config.rviz"
    click Gazebo "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/tree/main/Tools/simulation/worlds/"
    click Vehicle "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/tree/main/Tools/simulation/models/orion/"
    click Camera "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/tree/main/Tools/simulation/models/rpi_camera/"
    click IMU "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/tree/main/Tools/simulation/models/imu/"
    click GZBridge "https://github.com/serkanMzlm/Vehicle-Control-Sotfware/tree/main/src/gz_bridge/"

    %% Legend
    subgraph Legend
        L1[Interface Components]:::interface
        L2[Processing Components]:::processing
        L3[Hardware Components]:::hardware
        L4[Bridge Components]:::bridge
        L5[Sensor Components]:::sensor
        L6[Visualization Tools]:::visualization
    end
```
