# knr-pw/lrt_meldog_ros architecture

> Architecture diagram of the GitHub repository knr-pw/lrt_meldog_ros, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/knr-pw/lrt_meldog_ros
- Repository: https://github.com/knr-pw/lrt_meldog_ros

## Overview

This repository is a ROS 2 quadruped-robot workspace, with robot-description variants and Gazebo/RViz launch support, plus a Moteus motor-calibration tool. The calibration workflow accepts joint and bus IDs, runs motor control alongside a terminal interface, and writes measured positions as Xacro properties. Simulation launch files build robot descriptions and start simulator/control components. The source index confirms the calibration entry point’s module dependencies; only sampled launch files support the simulation links shown here, so unsampled subsystem internals are represented at their existing directories.

Main entry points: [`meldog_calibration/moteus_calibration/moteus_calibration/main.py`](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_calibration/moteus_calibration/moteus_calibration/main.py) (Calibration runner), [`meldog_description/launch/meldog_gazebo.launch.py`](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_description/launch/meldog_gazebo.launch.py) (Full Gazebo launch), [`meldog_leg_description/launch/meldog_leg_gazebo.launch.py`](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_leg_description/launch/meldog_leg_gazebo.launch.py) (Leg Gazebo launch), [`meldog_simple_description/launch/meldog_gazebo_sim_ros2_control.launch.py`](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_simple_description/launch/meldog_gazebo_sim_ros2_control.launch.py) (Simple sim launch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cal["Motor calibration"]
  node_calmain["Calibration runner<br/>[main.py]"]
  node_motors["Moteus controller"]
  node_terminal["Terminal interface"]
  node_offsets["Offset generator"]
end

subgraph group_robot["Robot models"]
  node_fullmodel["Full robot model"]
  node_legmodel["Leg model"]
  node_simplemodel["Simple model"]
end

subgraph group_sim["Simulation"]
  node_fulllaunch["Full Gazebo launch"]
  node_leglaunch["Leg Gazebo launch"]
  node_simplelaunch["Simple sim launch"]
end

node_operator(("Operator"))
node_pi3hat["Pi3Hat motors"]
node_outputfile["Xacro output"]
node_gazebo["Gazebo simulator"]
node_statepub["Robot state publisher"]
node_controllers["ROS controllers"]

node_operator -.->|"starts"| node_calmain
node_calmain -->|"runs"| node_motors
node_calmain -->|"runs"| node_terminal
node_calmain -->|"creates"| node_offsets
node_calmain -->|"reads positions"| node_motors
node_calmain -->|"updates positions"| node_terminal
node_calmain -.->|"sets positions"| node_offsets
node_motors -.->|"commands"| node_pi3hat
node_offsets -->|"writes"| node_outputfile
node_fulllaunch -->|"loads Xacro"| node_fullmodel
node_leglaunch -->|"loads Xacro"| node_legmodel
node_simplelaunch -->|"loads Xacro"| node_simplemodel
node_fulllaunch -->|"starts"| node_gazebo
node_leglaunch -->|"starts"| node_gazebo
node_simplelaunch -->|"starts"| node_gazebo
node_fulllaunch -->|"starts"| node_statepub
node_leglaunch -->|"starts"| node_statepub
node_simplelaunch -->|"starts"| node_statepub
node_fulllaunch -->|"loads"| node_controllers
node_leglaunch -->|"loads"| node_controllers
node_simplelaunch -->|"loads"| node_controllers

click node_calmain "https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_calibration/moteus_calibration/moteus_calibration/main.py"
click node_motors "https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_calibration/moteus_calibration/moteus_calibration/moteus_controller.py"
click node_terminal "https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_calibration/moteus_calibration/moteus_calibration/terminal_interface.py"
click node_offsets "https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_calibration/moteus_calibration/moteus_calibration/urdf_offset_generator.py"
click node_fullmodel "https://github.com/knr-pw/lrt_meldog_ros/tree/main/meldog_description/description"
click node_legmodel "https://github.com/knr-pw/lrt_meldog_ros/tree/main/meldog_leg_description/description"
click node_simplemodel "https://github.com/knr-pw/lrt_meldog_ros/tree/main/meldog_simple_description/description"
click node_fulllaunch "https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_description/launch/meldog_gazebo.launch.py"
click node_leglaunch "https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_leg_description/launch/meldog_leg_gazebo.launch.py"
click node_simplelaunch "https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_simple_description/launch/meldog_gazebo_sim_ros2_control.launch.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_calmain,node_motors,node_terminal,node_offsets toneBlue
class node_fullmodel,node_legmodel,node_simplemodel toneAmber
class node_fulllaunch,node_leglaunch,node_simplelaunch toneMint
class node_operator,node_pi3hat,node_outputfile,node_gazebo,node_statepub,node_controllers toneIndigo
```

## Components

### Motor calibration

- [Calibration runner](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_calibration/moteus_calibration/moteus_calibration/main.py): `meldog_calibration/moteus_calibration/moteus_calibration/main.py`
- [Moteus controller](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_calibration/moteus_calibration/moteus_calibration/moteus_controller.py): `meldog_calibration/moteus_calibration/moteus_calibration/moteus_controller.py`
- [Terminal interface](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_calibration/moteus_calibration/moteus_calibration/terminal_interface.py): `meldog_calibration/moteus_calibration/moteus_calibration/terminal_interface.py`
- [Offset generator](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_calibration/moteus_calibration/moteus_calibration/urdf_offset_generator.py): `meldog_calibration/moteus_calibration/moteus_calibration/urdf_offset_generator.py`

### Robot models

- [Full robot model](https://github.com/knr-pw/lrt_meldog_ros/tree/main/meldog_description/description): `meldog_description/description`
- [Leg model](https://github.com/knr-pw/lrt_meldog_ros/tree/main/meldog_leg_description/description): `meldog_leg_description/description`
- [Simple model](https://github.com/knr-pw/lrt_meldog_ros/tree/main/meldog_simple_description/description): `meldog_simple_description/description`

### Simulation

- [Full Gazebo launch](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_description/launch/meldog_gazebo.launch.py): `meldog_description/launch/meldog_gazebo.launch.py`
- [Leg Gazebo launch](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_leg_description/launch/meldog_leg_gazebo.launch.py): `meldog_leg_description/launch/meldog_leg_gazebo.launch.py`
- [Simple sim launch](https://github.com/knr-pw/lrt_meldog_ros/blob/main/meldog_simple_description/launch/meldog_gazebo_sim_ros2_control.launch.py): `meldog_simple_description/launch/meldog_gazebo_sim_ros2_control.launch.py`

### Other components

- **Operator**
- **Pi3Hat motors**
- **Xacro output**
- **Gazebo simulator**
- **Robot state publisher**
- **ROS controllers**

## Connections

- Operator → Calibration runner: starts
- Calibration runner → Moteus controller: runs (evidence: `meldog_calibration/moteus_calibration/moteus_calibration/main.py`)
- Calibration runner → Terminal interface: runs (evidence: `meldog_calibration/moteus_calibration/moteus_calibration/main.py`)
- Calibration runner → Offset generator: creates (evidence: `meldog_calibration/moteus_calibration/moteus_calibration/main.py`)
- Calibration runner → Moteus controller: reads positions (evidence: `meldog_calibration/moteus_calibration/moteus_calibration/main.py`)
- Calibration runner → Terminal interface: updates positions (evidence: `meldog_calibration/moteus_calibration/moteus_calibration/main.py`)
- Calibration runner → Offset generator: sets positions (evidence: `meldog_calibration/moteus_calibration/moteus_calibration/main.py`)
- Moteus controller → Pi3Hat motors: commands
- Offset generator → Xacro output: writes (evidence: `meldog_calibration/moteus_calibration/moteus_calibration/urdf_offset_generator.py`)
- Full Gazebo launch → Full robot model: loads Xacro (evidence: `meldog_description/launch/meldog_gazebo.launch.py`)
- Leg Gazebo launch → Leg model: loads Xacro (evidence: `meldog_leg_description/launch/meldog_leg_gazebo.launch.py`)
- Simple sim launch → Simple model: loads Xacro (evidence: `meldog_simple_description/launch/meldog_gazebo_sim_ros2_control.launch.py`)
- Full Gazebo launch → Gazebo simulator: starts (evidence: `meldog_description/launch/meldog_gazebo.launch.py`)
- Leg Gazebo launch → Gazebo simulator: starts (evidence: `meldog_leg_description/launch/meldog_leg_gazebo.launch.py`)
- Simple sim launch → Gazebo simulator: starts (evidence: `meldog_simple_description/launch/meldog_gazebo_sim_ros2_control.launch.py`)
- Full Gazebo launch → Robot state publisher: starts (evidence: `meldog_description/launch/meldog_gazebo.launch.py`)
- Leg Gazebo launch → Robot state publisher: starts (evidence: `meldog_leg_description/launch/meldog_leg_gazebo.launch.py`)
- Simple sim launch → Robot state publisher: starts (evidence: `meldog_simple_description/launch/meldog_gazebo_sim_ros2_control.launch.py`)
- Full Gazebo launch → ROS controllers: loads (evidence: `meldog_description/launch/meldog_gazebo.launch.py`)
- Leg Gazebo launch → ROS controllers: loads (evidence: `meldog_leg_description/launch/meldog_leg_gazebo.launch.py`)
- Simple sim launch → ROS controllers: loads (evidence: `meldog_simple_description/launch/meldog_gazebo_sim_ros2_control.launch.py`)
