# micro-ros/micro_ros_msgs architecture

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

- Interactive diagram: https://gitdiagram.com/micro-ros/micro_ros_msgs
- Repository: https://github.com/micro-ros/micro_ros_msgs

## Overview

##### Project type and purpose
- This is a ROS 2 message‐definition package (“micro_ros_msgs”), an open-source library of .msg definitions used by both the micro-ROS Agent (server) and the micro-ROS RMW client.
- It does not implement business logic or full applications; it simply declares the data types (Entity, Graph, Node) that form the communication contract between micro-ROS endpoints.

##### File structure
- Top level:
- CMakeLists.txt & package.xml – ROS 2 build/declaration files
- msg/ – folder with three .msg definition files
- LICENSE, README.md, CONTRIBUTING.md, CHANGELOG.rst – metadata
- No “src” directory for .cpp/.py code, because this package’s role is purely message definitions.
- The build system (CMake) invokes rosidl generators on the .msg files to create language‐specific message code.

##### README for additional insights
- Confirms that this package is a collection of ROS 2 message definitions.
- Mentions consumption by micro-ROS Agent and micro-ROS RMW (microxrcedds).
- No runtime components within this repository itself.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Repository Metadata"
        MD1["README.md"]:::meta
        MD2["LICENSE"]:::meta
        MD3["CHANGELOG.rst"]:::meta
        MD4["CONTRIBUTING.md"]:::meta
    end

    subgraph "Message Definition Package"
        E["Entity.msg"]:::defs
        G["Graph.msg"]:::defs
        N["Node.msg"]:::defs
    end

    subgraph "Build System"
        CM["CMakeLists.txt"]:::build
        PKG["package.xml"]:::build
    end

    subgraph "Code Generation"
        GEN["Generated Message Code"]:::gen
    end

    subgraph "Runtime Components"
        AG["micro-ROS Agent"]:::runtime
        RMW["micro-ROS RMW Client"]:::runtime
    end

    DDS["DDS/RTPS Middleware"]:::middleware

    E -->|"rosidl code generation"| CM
    G -->|"rosidl code generation"| CM
    N -->|"rosidl code generation"| CM
    PKG -.->|"build declarations"| CM
    CM -->|"generate message stubs"| GEN
    GEN -->|"include generated code"| AG
    GEN -->|"include generated code"| RMW
    AG -->|"publish/subscribe over DDS"| DDS
    DDS -->|"publish/subscribe over DDS"| AG
    RMW -->|"publish/subscribe over DDS"| DDS
    DDS -->|"publish/subscribe over DDS"| RMW

    click MD1 "https://github.com/micro-ros/micro_ros_msgs/blob/kilted/README.md"
    click MD2 "https://github.com/micro-ros/micro_ros_msgs/tree/kilted/LICENSE"
    click MD3 "https://github.com/micro-ros/micro_ros_msgs/blob/kilted/CHANGELOG.rst"
    click MD4 "https://github.com/micro-ros/micro_ros_msgs/blob/kilted/CONTRIBUTING.md"
    click E "https://github.com/micro-ros/micro_ros_msgs/blob/kilted/msg/Entity.msg"
    click G "https://github.com/micro-ros/micro_ros_msgs/blob/kilted/msg/Graph.msg"
    click N "https://github.com/micro-ros/micro_ros_msgs/blob/kilted/msg/Node.msg"
    click CM "https://github.com/micro-ros/micro_ros_msgs/blob/kilted/CMakeLists.txt"
    click PKG "https://github.com/micro-ros/micro_ros_msgs/blob/kilted/package.xml"

    classDef defs fill:#E3F2FD,stroke:#64B5F6
    classDef build fill:#E8F5E9,stroke:#66BB6A
    classDef gen fill:#FFF9C4,stroke:#FFEB3B
    classDef runtime fill:#F5F5F5,stroke:#BDBDBD
    classDef middleware fill:#FFEBEE,stroke:#EF5350
    classDef meta fill:#ECEFF1,stroke:#90A4AE
```
