# jjjau03/moveo_roboticarm_ros2 architecture

> Architecture diagram of the GitHub repository jjjau03/moveo_roboticarm_ros2, 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/jjjau03/moveo_roboticarm_ros2
- Repository: https://github.com/jjjau03/moveo_roboticarm_ros2

## Overview

##### Main Components
- Robot Description: Represented by the “moveo_description” package. This component contains URDF/Xacro models, meshes (STL files), and RViz configurations. It is the source of the robot’s geometry and physical layout.
- Motion Planning: Represented by the “moveo_moveit_config” package. This includes MoveIt2 configuration files, kinematics, controllers, and launch files for interfacing with MoveIt’s planning pipeline.
- System Bringup: Represented by the “moveo_bringup” package. This module includes launch files that initialize the ROS2 environment for the robotic arm (and possibly integrate hardware or simulation interfaces).
- Hardware/Embedded Control: Represented by “moveo_arduino”, which includes CMake files, package configuration, Python scripts (e.g., gripper_controller.py and stepper_controller.py), and Arduino sketches (gripper.ino). Although these files suggest low-level control logic, they form an essential layer for interacting with the physical device or its simulation counterpart.
- Simulation & Visualization: Illustrated by separate launch files in both “moveo_description” (Gazebo simulation launch files) and “moveo_moveit_config” (RViz and demo launch scripts) packages. These provide the simulated environment and visualization for testing movements.

##### Relationships and Interactions
- The MoveIt2 configuration is tightly coupled with the Robot Description since it uses the URDF/Xacro to determine the kinematics and geometry of the arm.
- The System Bringup package acts as a mediator that sets up the ROS2 environment including network communication, ROS2 nodes for controlling the robot (both simulated and actual via Arduino scripts).
- The Hardware/Embedded Control component communicates with the ROS2 system via ROS topics, services, or custom scripts. It is connected to both simulation and real hardware layers (i.e., the Arduino platform for handling the gripper and stepper motor).
- The simulation tools (Gazebo and RViz) interact with the ROS2 environment to allow for visualizing the robot’s state and planning/execution feedback via MoveIt2.

##### Architectural Patterns and Key Design Principles
- Modular Package Architecture: The project is split into several packages that each manage a distinct area of functionality (description, control, bringup, motion planning).
- Separation of Concerns: The physical description, control logic, motion planning, and simulation/visualization are all separated, allowing focused development and troubleshooting.
- ROS2 and MoveIt2 Integration: The system leverages ROS2 nodes and launch files distributed across packages. The clear separation between simulation (Gazebo, RViz) and actual hardware/embedded code (Arduino-related components) underscores the decoupled design.
- Using a docker or devcontainer environment (evidenced by the .devcontainer folder) for consistent development and deployment.

##### Relevant Technologies
- ROS2 (with specific mention of the mandatory version based on the README)
- MoveIt2 for motion planning and trajectory execution.
- Gazebo for simulation environments.
- RViz for real-time visualization.
- Arduino (and accompanying Python scripts) for direct hardware control.
- CMake and package.xml structure which highlights the ROS2 package management.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Middleware["ROS2 Middleware"]:::middleware

    subgraph "System Bringup"
        Bringup["moveo_bringup (System Initialization)"]:::bringup
        BLaunch["Bringup Launch File"]:::bringupDetail
        Bringup --- BLaunch
    end

    subgraph "Robot Description"
        Description["moveo_description (Robot Model & Simulation)"]:::robot
        URDF["URDF/Xacro Models"]:::robotDetail
        Meshes["Meshes"]:::robotDetail
        RViz["RViz Visualizations"]:::robotDetail
        Description --- URDF
        Description --- Meshes
        Description --- RViz
    end

    subgraph "Motion Planning"
        MoveIt["moveo_moveit_config (Motion Planning & Visualization)"]:::planning
        MConfig["MoveIt2 Config Files"]:::planningDetail
        MLaunch["Planning & RViz Launch Files"]:::planningDetail
        MoveIt --- MConfig
        MoveIt --- MLaunch
    end

    subgraph "Hardware/Embedded Control"
        Arduino["moveo_arduino (Hardware Control & Embedded Scripts)"]:::hardware
        AScripts["Arduino Python Scripts"]:::hardwareDetail
        ASketch["Arduino Sketches"]:::hardwareDetail
        Arduino --- AScripts
        Arduino --- ASketch
    end

    %% Global Connections
    Middleware -->|"initializes"| Bringup
    Bringup -->|"launches"| Description
    Bringup -->|"launches"| MoveIt
    Bringup -->|"connects"| Arduino
    Description -->|"providesURDF"| MoveIt
    MoveIt -->|"sendsCommands"| Arduino

    %% Click Events
    click URDF "https://github.com/jjjau03/moveo_roboticarm_ros2/tree/main/src/moveo_description/urdf"
    click Meshes "https://github.com/jjjau03/moveo_roboticarm_ros2/tree/main/src/moveo_description/meshes"
    click RViz "https://github.com/jjjau03/moveo_roboticarm_ros2/tree/main/src/moveo_description/rviz"
    click MConfig "https://github.com/jjjau03/moveo_roboticarm_ros2/tree/main/src/moveo_moveit_config/config"
    click MLaunch "https://github.com/jjjau03/moveo_roboticarm_ros2/tree/main/src/moveo_moveit_config/launch"
    click BLaunch "https://github.com/jjjau03/moveo_roboticarm_ros2/tree/main/src/moveo_bringup/launch"
    click AScripts "https://github.com/jjjau03/moveo_roboticarm_ros2/tree/main/src/moveo_arduino/scripts"
    click ASketch "https://github.com/jjjau03/moveo_roboticarm_ros2/tree/main/src/moveo_arduino/src"

    %% Styles
    classDef middleware fill:#ffcc00,stroke:#333,stroke-width:2px
    classDef bringup fill:#ffb7b2,stroke:#333,stroke-width:2px
    classDef bringupDetail fill:#ffc0cb,stroke:#333,stroke-width:1px
    classDef robot fill:#a9d0f5,stroke:#333,stroke-width:2px
    classDef robotDetail fill:#cceeff,stroke:#333,stroke-width:1px
    classDef planning fill:#a8e6cf,stroke:#333,stroke-width:2px
    classDef planningDetail fill:#d0f0c0,stroke:#333,stroke-width:1px
    classDef hardware fill:#dcedc1,stroke:#333,stroke-width:2px
    classDef hardwareDetail fill:#e8f5e9,stroke:#333,stroke-width:1px
```
