# arcturusnavigation/all_seaing_vehicle architecture

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

- Interactive diagram: https://gitdiagram.com/arcturusnavigation/all_seaing_vehicle
- Repository: https://github.com/arcturusnavigation/all_seaing_vehicle

## Overview

##### Main System Components

a) Hardware Interface Layer
- Drivers (all_seaing_driver)
- GPS systems (ublox, zed2i)
- Camera systems (webcam, ZED2i)
- LoRa communication (onshore/rover)
- Thrust control

b) Perception Layer (all_seaing_perception)
- Vision processing
- YOLOv5/v8 detection
- Point cloud processing
- Obstacle detection

c) Navigation & Control Layer
- Navigation (all_seaing_navigation)
- A* path planning
- Buoy pair finding
- Waypoint management
- Control (all_seaing_controller)
- PID controller
- X-drive controller
- Control multiplexer

d) Autonomy Layer (all_seaing_autonomy)
- Task management
- Path following
- Mission-specific behaviors (VRX, RoboBoat)

##### Key Relationships to Highlight

a) Data Flow:
- Sensor data → Perception → Navigation → Control → Actuators
- Custom message types (from all_seaing_interfaces)
- Transform broadcasts (all_seaing_description)

b) Control Flow:
- Task manager → Navigation goals → Controller execution
- Emergency override paths
- Multiplexed control inputs

##### Implementation Details

**[Hardware Layer]**
- ↑↓
**[Driver Layer]**
- ↑↓
**[Perception Layer]**
- ↑↓
**[Navigation & Control Layer]**
- ↑↓
**[Autonomy Layer]**
- ↑↓
**[User Interface Layer]**

##### Additional Elements

Include:
- Major ROS 2 message types used
- Critical parameter spaces
- Hardware requirements
- External dependencies

##### Notes for Implementation

- Use standardized ROS 2 architecture patterns
- Clear separation between simulation and real hardware paths
- Configuration switching points
- Safety-critical paths
- Diagnostic and monitoring paths

Remember to maintain a balance between showing enough detail to understand the system's architecture while avoiding overwhelming complexity that might obscure the main system structure.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style definitions
    classDef hardware fill:#ADD8E6,stroke:#333
    classDef perception fill:#90EE90,stroke:#333
    classDef navigation fill:#FFE4B5,stroke:#333
    classDef control fill:#F0E68C,stroke:#333
    classDef autonomy fill:#FFB6C1,stroke:#333
    classDef config fill:#D3D3D3,stroke:#333

    %% Hardware Interface Layer
    subgraph Hardware
        GPS[GPS Systems]:::hardware
        Camera[Camera Systems]:::hardware
        LoRa[LoRa Communication]:::hardware
        Thrust[Thrust Control]:::hardware
    end

    %% Driver Layer
    subgraph Drivers
        GPSDriver["GPS Converter"]:::hardware
        WebcamPub["Webcam Publisher"]:::hardware
        ZEDPub["ZED2i Publisher"]:::hardware
        OnshoreLoRa["Onshore LoRa"]:::hardware
        RoverLoRa["Rover LoRa"]:::hardware
        ThrustCmd["Thrust Commander"]:::hardware
    end

    %% Perception Layer
    subgraph Perception
        YOLOv5["YOLOv5 Detection"]:::perception
        YOLOv8["YOLOv8 Detection"]:::perception
        ColorSeg["Color Segmentation"]:::perception
        PointCloud["Point Cloud Processing"]:::perception
        ObstacleDetect["Obstacle Detection"]:::perception
    end

    %% Navigation & Control Layer
    subgraph Navigation
        AStar["A* Path Planning"]:::navigation
        BuoyPair["Buoy Pair Finding"]:::navigation
    end

    subgraph Control
        PIDCtrl["PID Controller"]:::control
        XDriveCtrl["X-Drive Controller"]:::control
        CtrlMux["Control Multiplexer"]:::control
    end

    %% Autonomy Layer
    subgraph Autonomy
        TaskMgr["Task Manager"]:::autonomy
        PathFollow["Path Following"]:::autonomy
        MissionBehaviors["Mission Behaviors"]:::autonomy
    end

    %% Configuration
    subgraph Config
        URDF["URDF Config"]:::config
        Launch["Launch Files"]:::config
        RViz["RViz Plugins"]:::config
    end

    %% Relationships
    GPS --> GPSDriver
    Camera --> WebcamPub
    Camera --> ZEDPub
    LoRa --> OnshoreLoRa
    LoRa --> RoverLoRa
    Thrust --> ThrustCmd

    WebcamPub & ZEDPub --> YOLOv5
    WebcamPub & ZEDPub --> YOLOv8
    WebcamPub & ZEDPub --> ColorSeg
    ZEDPub --> PointCloud
    PointCloud --> ObstacleDetect

    YOLOv5 & YOLOv8 & ColorSeg --> BuoyPair
    ObstacleDetect --> AStar
    BuoyPair --> AStar

    AStar --> PathFollow
    PathFollow --> TaskMgr
    TaskMgr --> MissionBehaviors

    PathFollow --> PIDCtrl
    PIDCtrl --> XDriveCtrl
    XDriveCtrl --> CtrlMux
    CtrlMux --> ThrustCmd

    %% Click events
    click GPSDriver "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_driver/all_seaing_driver/gps_converter.py"
    click WebcamPub "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_driver/all_seaing_driver/webcam_publisher.py"
    click ZEDPub "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_driver/all_seaing_driver/zed2i_publisher.py"
    click OnshoreLoRa "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_driver/all_seaing_driver/onshore_lora_combined.py"
    click RoverLoRa "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_driver/all_seaing_driver/rover_lora_combined.py"
    click ThrustCmd "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_driver/all_seaing_driver/thrust_commander.py"
    click YOLOv5 "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_perception/all_seaing_perception/yolov5_node.py"
    click YOLOv8 "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_perception/all_seaing_perception/yolov8_node.py"
    click ColorSeg "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_perception/all_seaing_perception/color_segmentation.py"
    click PointCloud "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_perception/all_seaing_perception/point_cloud_filter.cpp"
    click ObstacleDetect "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_perception/all_seaing_perception/obstacle_detector.cpp"
    click AStar "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_navigation/all_seaing_navigation/a_star.py"
    click BuoyPair "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_navigation/all_seaing_navigation/buoy_pair_finder.py"
    click PIDCtrl "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_controller/all_seaing_controller/pid_controller.py"
    click XDriveCtrl "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_controller/all_seaing_controller/xdrive_controller.py"
    click CtrlMux "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_controller/all_seaing_controller/control_mux.py"
    click TaskMgr "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_autonomy/all_seaing_autonomy/roboboat/task_manager.py"
    click PathFollow "https://github.com/arcturusnavigation/all_seaing_vehicle/blob/main/all_seaing_autonomy/all_seaing_autonomy/roboboat/FollowThePath.py"
    click MissionBehaviors "https://github.com/arcturusnavigation/all_seaing_vehicle/tree/main/all_seaing_autonomy/all_seaing_autonomy/roboboat/"
    click URDF "https://github.com/arcturusnavigation/all_seaing_vehicle/tree/main/all_seaing_description/urdf/"
    click Launch "https://github.com/arcturusnavigation/all_seaing_vehicle/tree/main/all_seaing_bringup/launch/"
    click RViz "https://github.com/arcturusnavigation/all_seaing_vehicle/tree/main/all_seaing_rviz_plugins/"
```
