# inorbit-ai/ros_amr_interop architecture

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

- Interactive diagram: https://gitdiagram.com/inorbit-ai/ros_amr_interop
- Repository: https://github.com/inorbit-ai/ros_amr_interop

## Overview

##### Main Components
- ROS2 Middleware: At the heart of this system is the ROS2 message bus that connects all nodes.
- rmf_inorbit_fleet_adapter: A package that acts as a fleet adapter between Open-RMF and the InOrbit API. This component receives fleet commands and dispatches them to the connected robots.
- vda5050_connector: This package (with both C++ and Python components) provides ROS2 nodes that manage communication with systems adhering to the VDA5050 standard. It includes sub-components such as the MQTT bridge and controller nodes.
- massrobotics_amr_sender_py: A Python-based ROS2 node that receives data from the ROS ecosystem and converts/publishes it to a Mass Robotics Interop-compliant receiver. Its behavior is configurable via YAML.
- vda5050_msgs and vda5050_serializer: These provide standardized message definitions and conversion utilities. They help ensure that the serialization and interpretation of data between ROS nodes and external systems remain consistent.

##### Relationships and Data Flow
- From the ROS2 bus, branch out to the individual ROS nodes for each of the key packages. For instance:

##### Architectural Patterns or Design Principles
- Modularity: Each package is neatly isolated in its own directory, reinforcing separation of concerns (each connector handles a specific interoperability standard).
- Extensibility: The design allows for additional adapters (like new connectors or message formats) to be added without overhauling the core ROS2 system.

##### Relevant Technologies and Libraries
- ROS2: Underlying middleware for communication.
- Python/C++: Different packages are implemented in these languages (massrobotics_amr_sender_py in Python; vda5050_connector includes C++ components).
- YAML for configuration (especially in massrobotics_amr_sender_py).
- Standardization packages (vda5050_msgs and vda5050_serializer) which define message protocols.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Define nodes with color classes

    bus["ROS2 Middleware (Message Bus)"]:::ros

    subgraph "ROS2 Adapter Nodes"
        rmf["rmf_inorbit_fleet_adapter"]:::ros
        vda["vda5050_connector"]:::ros
        mass["massrobotics_amr_sender_py"]:::ros
    end

    subgraph "External Systems"
        api["InOrbit API"]:::ext
        vdaExt["VDA5050 Master Control"]:::ext
        massReceiver["Mass Robotics Receiver"]:::ext
    end

    subgraph "Supporting Libraries"
        vda_msgs["vda5050_msgs"]:::lib
        vda_serializer["vda5050_serializer"]:::lib
    end

    %% Connections from ROS2 Middleware to adapter nodes
    bus -->|"Cmd&Control"| rmf
    bus -->|"Topics/Services"| vda
    bus -->|"AMR_Data"| mass

    %% Connections from adapter nodes to external systems
    rmf -->|"Fleet_Data"| api
    vda -->|"MQTT/JSON"| vdaExt
    mass -->|"Interop_Data"| massReceiver

    %% Dependencies for vda5050_connector
    vda ---|"Uses"| vda_msgs
    vda ---|"Uses"| vda_serializer

    %% Click Events mapping to project files and directories
    click rmf "https://github.com/inorbit-ai/ros_amr_interop/tree/humble-devel/rmf_inorbit_fleet_adapter/"
    click vda "https://github.com/inorbit-ai/ros_amr_interop/tree/humble-devel/vda5050_connector/"
    click mass "https://github.com/inorbit-ai/ros_amr_interop/tree/humble-devel/massrobotics_amr_sender_py/"
    click vda_msgs "https://github.com/inorbit-ai/ros_amr_interop/tree/humble-devel/vda5050_msgs/"
    click vda_serializer "https://github.com/inorbit-ai/ros_amr_interop/tree/humble-devel/vda5050_serializer/"

    %% Styles for different types of components
    classDef ros fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef ext fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef lib fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
```
