# watonomous/wato_asd_training architecture

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

- Interactive diagram: https://gitdiagram.com/watonomous/wato_asd_training
- Repository: https://github.com/watonomous/wato_asd_training

## Overview

##### Project Type and Purpose
- This is a ROS-based robotics monorepo designed for developing, simulating, and visualizing autonomous robot behaviors.
- It uses Docker to create reproducible environments for:
- Gazebo simulation (src/gazebo)
- ROS2 robot nodes (src/robot: bringup, control, costmap, map_memory, odometry_spoof, planner)
- Sample data pipelines (src/samples in C++ & Python: producers, transformers, aggregators)
- Visualization tools (Foxglove)

##### File Structure Analysis
- Top-level:
- config: JSON/YAML parameters for services & nodes
- docker/: Dockerfiles for each service category
- modules/: docker-compose YAML grouping containers by function (gazebo, robot, samples, vis_tools)
- src/: ROS2 packages & samples
- watod & watod_scripts/: CLI helpers for env setup
- src sub-directories follow ROS2 package conventions (package.xml, CMakeLists.txt, launch files), indicating a distributed pub/sub architecture.

##### README Insights
- Emphasizes Docker usage for reproducibility.

##### Elements
- Clear labels on each container and ROS2 package.

##### Detailed Capture of Architectural Elements
- Launch files under each container to indicate startup sequence.
- Message definitions (Filtered.msg, Unfiltered.msg, etc.) to show topic schemas.
- Module boundaries: e.g., “modules/docker-compose.robot.yaml” controlling which containers run together.
- Watod CLI as a gateway to environment setup, not part of the runtime graph.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Central Bus
    DDSBus(("DDS Pub/Sub\nBus")):::bus

    %% Simulation Layer
    subgraph "Simulation" 
        Gazebo["Gazebo Simulator\nLaunch: gazebo.launch.xml"]:::sim
    end

    %% Robot Control Layer
    subgraph "Robot Control"
        Bringup["bringup_robot\nLaunch Orchestration"]:::control
        OdomSpoof["odometry_spoof"]:::control
        ControlNode["control"]:::control
        Costmap["costmap"]:::control
        MapMemory["map_memory"]:::control
        Planner["planner"]:::control
    end

    %% Sample Pipelines C++
    subgraph "Sample Pipelines (C++)"
        CPPProducer["Producer (C++)"]:::samples
        CPPTransformer["Transformer (C++)"]:::samples
        CPPAggregator["Aggregator (C++)"]:::samples
    end

    %% Sample Pipelines Python
    subgraph "Sample Pipelines (Python)"
        PyProducer["Producer (Python)"]:::samples
        PyTransformer["Transformer (Python)"]:::samples
        PyAggregator["Aggregator (Python)"]:::samples
    end

    %% Visualization Layer
    subgraph "Visualization"
        Foxglove["Foxglove Web UI"]:::vis
    end

    %% Message Definitions
    subgraph "Message Definitions"
        SampleMsgs["sample_msgs"]:::msg
        WatoMsgs["wato_msgs"]:::msg
    end

    %% CLI Tools
    CLI["watod CLI"]:::cli
    CLIScripts["watod_scripts"]:::cli
    Entrypoint["wato_ros_entrypoint.sh"]:::cli

    %% Connections Simulation
    Gazebo -->|"/odom,/scan topics"| DDSBus

    %% Connections Robot Control
    OdomSpoof -->|"/odom"| DDSBus
    Costmap -->|"/scan,/odom"| DDSBus
    MapMemory -->|"/scan,/odom"| DDSBus
    ControlNode -->|"/cmd_vel"| DDSBus
    Planner -->|"/waypoints"| DDSBus

    %% Feedback loop control to simulator
    ControlNode -->|"/cmd_vel"| Gazebo

    %% Planner to control
    Planner -->|calls control| ControlNode

    %% DDSBus to Robot Nodes
    DDSBus -->|feeds| ControlNode
    DDSBus -->|feeds| Costmap
    DDSBus -->|feeds| MapMemory
    DDSBus -->|feeds| Planner

    %% Sample Pipelines
    CPPProducer -->|reads topics| DDSBus
    CPPTransformer -->|reads topics| DDSBus
    CPPAggregator -->|reads topics| DDSBus

    PyProducer -->|reads topics| DDSBus
    PyTransformer -->|reads topics| DDSBus
    PyAggregator -->|reads topics| DDSBus

    %% Visualization
    DDSBus -->|all topics| Foxglove

    %% Message Definitions usage
    SampleMsgs -->|defines schemas| DDSBus
    WatoMsgs -->|defines schemas| DDSBus

    %% CLI orchestration
    CLI -.->|orchestrates| Gazebo
    CLI -.->|orchestrates| Bringup
    CLI -.->|orchestrates| CPPProducer
    CLI -.->|orchestrates| PyProducer
    CLI -.->|orchestrates| Foxglove

    CLI --> CLIScripts
    CLI --> Entrypoint

    %% Click Events
    click Gazebo "https://github.com/watonomous/wato_asd_training/tree/main/src/gazebo"
    click Gazebo "https://github.com/watonomous/wato_asd_training/blob/main/docker/gazebo/gazeboserver.Dockerfile"
    click Gazebo "https://github.com/watonomous/wato_asd_training/blob/main/modules/docker-compose.gazebo.yaml"

    click Bringup "https://github.com/watonomous/wato_asd_training/tree/main/src/robot/bringup_robot"
    click Bringup "https://github.com/watonomous/wato_asd_training/blob/main/docker/robot/robot.Dockerfile"
    click Bringup "https://github.com/watonomous/wato_asd_training/blob/main/modules/docker-compose.robot.yaml"
    click OdomSpoof "https://github.com/watonomous/wato_asd_training/tree/main/src/robot/odometry_spoof"
    click ControlNode "https://github.com/watonomous/wato_asd_training/tree/main/src/robot/control"
    click Costmap "https://github.com/watonomous/wato_asd_training/tree/main/src/robot/costmap"
    click MapMemory "https://github.com/watonomous/wato_asd_training/tree/main/src/robot/map_memory"
    click Planner "https://github.com/watonomous/wato_asd_training/tree/main/src/robot/planner"

    click CPPProducer "https://github.com/watonomous/wato_asd_training/tree/main/src/samples/cpp/producer"
    click CPPProducer "https://github.com/watonomous/wato_asd_training/blob/main/docker/samples/cpp_producer.Dockerfile"
    click CPPTransformer "https://github.com/watonomous/wato_asd_training/tree/main/src/samples/cpp/transformer"
    click CPPTransformer "https://github.com/watonomous/wato_asd_training/blob/main/docker/samples/cpp_transformer.Dockerfile"
    click CPPAggregator "https://github.com/watonomous/wato_asd_training/tree/main/src/samples/cpp/aggregator"
    click CPPAggregator "https://github.com/watonomous/wato_asd_training/blob/main/docker/samples/cpp_aggregator.Dockerfile"

    click PyProducer "https://github.com/watonomous/wato_asd_training/tree/main/src/samples/python/producer"
    click PyProducer "https://github.com/watonomous/wato_asd_training/blob/main/docker/samples/py_producer.Dockerfile"
    click PyTransformer "https://github.com/watonomous/wato_asd_training/tree/main/src/samples/python/transformer"
    click PyTransformer "https://github.com/watonomous/wato_asd_training/blob/main/docker/samples/py_transformer.Dockerfile"
    click PyAggregator "https://github.com/watonomous/wato_asd_training/tree/main/src/samples/python/aggregator"
    click PyAggregator "https://github.com/watonomous/wato_asd_training/blob/main/docker/samples/py_aggregator.Dockerfile"
    click CPPProducer "https://github.com/watonomous/wato_asd_training/blob/main/modules/docker-compose.samples.yaml"
    click PyProducer "https://github.com/watonomous/wato_asd_training/blob/main/modules/docker-compose.samples.yaml"

    click Foxglove "https://github.com/watonomous/wato_asd_training/blob/main/docker/vis_tools/foxglove.Dockerfile"
    click Foxglove "https://github.com/watonomous/wato_asd_training/blob/main/modules/docker-compose.vis_tools.yaml"
    click Foxglove "https://github.com/watonomous/wato_asd_training/blob/main/config/wato_asd_training_foxglove_config.json"

    click SampleMsgs "https://github.com/watonomous/wato_asd_training/tree/main/src/samples/sample_msgs/msg"
    click WatoMsgs "https://github.com/watonomous/wato_asd_training/tree/main/src/wato_msgs/sample_msgs/msg"

    click CLI "https://github.com/watonomous/wato_asd_training/tree/main/watod"
    click CLIScripts "https://github.com/watonomous/wato_asd_training/tree/main/watod_scripts"
    click Entrypoint "https://github.com/watonomous/wato_asd_training/blob/main/docker/wato_ros_entrypoint.sh"

    %% Styles
    classDef sim fill:#D0E8FF,stroke:#000;
    classDef control fill:#DFFFD0,stroke:#000;
    classDef samples fill:#FFE8A8,stroke:#000;
    classDef vis fill:#E8D0FF,stroke:#000;
    classDef msg fill:#F0F0F0,stroke:#000;
    classDef bus fill:#FFFFFF,stroke:#000,stroke-dasharray: 4 2;
    classDef cli fill:#FFD0D0,stroke:#000;
```
