# luaiabuelsamen/ventionmotionplanner architecture

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

- Interactive diagram: https://gitdiagram.com/luaiabuelsamen/ventionmotionplanner
- Repository: https://github.com/luaiabuelsamen/ventionmotionplanner

## Overview

- Assets: Contains robot meshes, Mujoco scene XML files, and other simulation models.
- Configurations: Holds global configuration files and the demos.yml file which acts as a master config for different simulation setups.
- ROS2 Packages within the src/ directory:
- curobo_api: Provides the ROS2 API interfacing with the Curobo system.
- curobo_action: Defines ROS2 actions (such as MoveJ, MoveL, and PublishJoints) that allow robot control.
- gantry: Likely responsible for gantry control and kinematics (plus its own meshes, configuration, and URDF/xacro files).
- motion_plan: Handles path planning and movement strategies (includes collision tests, planners, and RViz publishers).
- mujoco_api: Deals with Mujoco simulation interfacing (includes nodes for launching Mujoco, parsing XML, and providing utility functions).
- vention_curobo: Implements additional control and planning logic (e.g., pick_and_place and trajectory planning).

##### External Dependencies and Tools
- ROS2: The primary middleware for messaging, node orchestration, and launching nodes.
- Mujoco: The physics simulation engine that is used to simulate the robot and its environment.
- ROS2 Launch System: Uses launch files (e.g., curobo.launch.py) to bootstrap the simulation by loading demos from the demos.yml file.
- Build and Deployment: Managed via colcon (as detailed in the README).

##### Relationships and Interactions
- Configuration Flow: The demos.yml file directs which assets and config files get loaded, linking specific robot/world configurations (from the config and assets directories) with the correct simulation XML files.
- ROS2 Node Interactions:
- The launch command (e.g., “ros2 launch curobo_api curobo.launch.py demo:=ur5e_with_gantry”) initiates the primary node(s) that read the configuration.
- Various ROS2 components (curobo_api, curobo_action, motion_plan, etc.) interact using message passing, where action commands, robot state, and planning information are exchanged.
- The mujoco_api serves as a bridge between ROS2 messages and the Mujoco simulation, ensuring data flow from ROS2 to simulation and vice versa.
- Asset and Simulation Link: The assets directory (with various XML and mesh files) is pointed to by entries in the demos.yml file, thus directly affecting the simulation’s visual and collision properties.

##### Architectural Patterns and Principles
- Separation of Concerns: Clear segregation between configuration, assets, and logic (each ROS2 package focuses on a specific area).
- Modularization: Each ROS2 package can be seen as a separate module (or microservice in a broader sense) that handles specific tasks such as robot control or motion planning.

## Diagram (Mermaid)

```mermaid
graph TD
    %% External Dependencies
    subgraph "External Dependencies"
        ROS2["ROS2 Middleware"]:::external
        Mujoco["Mujoco Simulation Engine"]:::external
    end

    %% Configuration and Assets
    subgraph "Configuration & Assets"
        Config["Configuration Files (demos.yml)"]:::config
        Assets["Assets (Meshes & Mujoco XML)"]:::assets
    end

    %% ROS2 Launch and Packages
    subgraph "ROS2 Launch & Packages"
        Launch["ROS2 Launch (curobo.launch.py)"]:::launch
        API["curobo_api"]:::ros2Node
        Action["curobo_action"]:::ros2Node
        Gantry["gantry"]:::ros2Node
        Motion["motion_plan"]:::ros2Node
        MujocoAPI["mujoco_api"]:::ros2Node
        Vention["vention_curobo"]:::ros2Node
    end

    %% Relationships and Data Flow
    Config -->|"loads"| Launch
    Launch -->|"initiates"| API
    API -->|"calls actions"| Action
    API -->|"orchestrates planning"| Motion
    Motion -->|"sends planning info"| Gantry
    API -->|"bridges ROS2-Simulation"| MujocoAPI
    MujocoAPI -->|"communicates"| Mujoco
    Assets -->|"provides models to"| Mujoco
    Gantry -->|"interacts with"| Vention

    %% External middleware association (conceptual)
    ROS2 --- API
    ROS2 --- Action
    ROS2 --- Gantry
    ROS2 --- Motion
    ROS2 --- MujocoAPI
    ROS2 --- Vention

    %% Click Events for Component Mapping
    click Assets "https://github.com/luaiabuelsamen/ventionmotionplanner/tree/main/assets/"
    click Config "https://github.com/luaiabuelsamen/ventionmotionplanner/blob/main/config/demos.yml"
    click API "https://github.com/luaiabuelsamen/ventionmotionplanner/tree/main/src/curobo_api/"
    click Action "https://github.com/luaiabuelsamen/ventionmotionplanner/tree/main/src/curobo_action/"
    click Gantry "https://github.com/luaiabuelsamen/ventionmotionplanner/tree/main/src/gantry/"
    click Motion "https://github.com/luaiabuelsamen/ventionmotionplanner/tree/main/src/motion_plan/"
    click MujocoAPI "https://github.com/luaiabuelsamen/ventionmotionplanner/tree/main/src/mujoco_api/"
    click Vention "https://github.com/luaiabuelsamen/ventionmotionplanner/tree/main/src/vention_curobo/"
    click Launch "https://github.com/luaiabuelsamen/ventionmotionplanner/blob/main/src/curobo_api/launch/curobo.launch.py"

    %% Styles
    classDef config fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef assets fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef ros2Node fill:#ff9999,stroke:#333,stroke-width:2px;
    classDef external fill:#9ecfff,stroke:#333,stroke-width:2px;
    classDef launch fill:#ffe6cc,stroke:#333,stroke-width:2px;
```
