# robotics-mechatronics-uma/rescue-dt architecture

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

- Interactive diagram: https://gitdiagram.com/robotics-mechatronics-uma/rescue-dt
- Repository: https://github.com/robotics-mechatronics-uma/rescue-dt

## Overview

RESCUE-DT is a ROS 2–Unity digital-twin system for search-and-rescue robotics. Its documented workflow is teleoperation and robot/sensor data over ROS 2, bridged through a TCP endpoint to Unity for simulation and real-time visualization. The repository tree contains ROS packages and the endpoint, but not the Unity project or the documented UAV, human-agent, and rover Unity scripts; those capabilities are therefore represented as one external Unity system. Relationships among endpoint internals follow the shown excerpts and SOURCE INDEX; links based only on the README are identified by its documented integration statements.

Main entry points: [`ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py`](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py) (TCP endpoint server), [`ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/client.py`](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/client.py) (Client protocol), [`ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/communication.py`](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/communication.py) (ROS communication base), [`ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/unity_service.py`](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/unity_service.py) (Unity-backed service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Robot control"]
  node_keyboard["Keyboard teleop"]
  node_teleopnode["Teleop node<br/>[teleop_node.py]"]
  node_roscommand{{"ROS command topics"}}
end

subgraph group_sensing["ROS sensing"]
  node_camera["Camera subscriber"]
  node_lidar["Lidar subscriber"]
  node_gps["GPS subscriber<br/>[gps_subscriber.py]"]
  node_imu["IMU subscriber<br/>[imu_subscriber.py]"]
  node_odometry["Odometry subscriber"]
  node_sensortopics{{"Sensor ROS topics"}}
end

subgraph group_bridge["ROS TCP bridge"]
  node_server["TCP endpoint server<br/>[server.py]"]
  node_client["Client protocol<br/>[client.py]"]
  node_sender["TCP sender<br/>[tcp_sender.py]"]
  node_comm["ROS communication base<br/>[communication.py]"]
  node_publisher["ROS publisher<br/>[publisher.py]"]
  node_subscriber["ROS subscriber<br/>[subscriber.py]"]
  node_service["ROS service client<br/>[service.py]"]
  node_unityservice["Unity-backed service<br/>[unity_service.py]"]
  node_exceptions["Protocol exceptions<br/>[exceptions.py]"]
end

subgraph group_twin["Digital twin"]
  node_unity["Unity digital twin"]
end

node_operator(("Operator"))

node_operator -->|"provides input"| node_keyboard
node_keyboard -.->|"publishes commands"| node_roscommand
node_teleopnode -.->|"controls robot"| node_roscommand
node_camera -->|"publishes data"| node_sensortopics
node_lidar -->|"publishes data"| node_sensortopics
node_gps -->|"publishes data"| node_sensortopics
node_imu -->|"publishes data"| node_sensortopics
node_odometry -->|"publishes data"| node_sensortopics
node_sensortopics -->|"bridges topics"| node_server
node_roscommand -->|"bridges topics"| node_server
node_server -->|"creates handlers"| node_client
node_server -->|"configures sender"| node_sender
node_server -->|"registers publisher"| node_publisher
node_server -->|"registers subscriber"| node_subscriber
node_server -->|"registers service"| node_service
node_server -->|"registers service"| node_unityservice
node_client -->|"raises errors"| node_exceptions
node_sender -->|"serializes messages"| node_client
node_publisher -->|"extends base"| node_comm
node_subscriber -->|"extends base"| node_comm
node_service -->|"extends base"| node_comm
node_unityservice -->|"extends base"| node_comm
node_unityservice -->|"uses protocol"| node_client
node_server -->|"exchanges TCP data"| node_unity

click node_keyboard "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/teleop_twist_keyboard/lib/python3.10/site-packages/teleop_twist_keyboard/teleop_twist_keyboard.py"
click node_teleopnode "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/teleop_pkg/lib/python3.10/site-packages/teleop_pkg/teleop_node.py"
click node_camera "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/camera_subscriber/lib/python3.10/site-packages/camera_subscriber/camera_subscriber.py"
click node_lidar "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/lidar_subscriber/lib/python3.10/site-packages/lidar_subscriber/lidar_subscriber.py"
click node_gps "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/fixposition_pkg/lib/python3.10/site-packages/fixposition_pkg/gps_subscriber.py"
click node_imu "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/fixposition_pkg/lib/python3.10/site-packages/fixposition_pkg/imu_subscriber.py"
click node_odometry "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/fixposition_pkg/lib/python3.10/site-packages/fixposition_pkg/odometry_subscriber.py"
click node_server "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py"
click node_client "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/client.py"
click node_sender "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/tcp_sender.py"
click node_comm "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/communication.py"
click node_publisher "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/publisher.py"
click node_subscriber "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/subscriber.py"
click node_service "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/service.py"
click node_unityservice "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/unity_service.py"
click node_exceptions "https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/exceptions.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_keyboard,node_teleopnode,node_roscommand toneBlue
class node_camera,node_lidar,node_gps,node_imu,node_odometry,node_sensortopics toneAmber
class node_server,node_client,node_sender,node_comm,node_publisher,node_subscriber,node_service,node_unityservice,node_exceptions toneMint
class node_unity toneRose
class node_operator toneIndigo
```

## Components

### Robot control

- [Keyboard teleop](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/teleop_twist_keyboard/lib/python3.10/site-packages/teleop_twist_keyboard/teleop_twist_keyboard.py): `ros2_ws/install/teleop_twist_keyboard/lib/python3.10/site-packages/teleop_twist_keyboard/teleop_twist_keyboard.py`
- [Teleop node](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/teleop_pkg/lib/python3.10/site-packages/teleop_pkg/teleop_node.py): `ros2_ws/install/teleop_pkg/lib/python3.10/site-packages/teleop_pkg/teleop_node.py`
- **ROS command topics**

### ROS sensing

- [Camera subscriber](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/camera_subscriber/lib/python3.10/site-packages/camera_subscriber/camera_subscriber.py): `ros2_ws/install/camera_subscriber/lib/python3.10/site-packages/camera_subscriber/camera_subscriber.py`
- [Lidar subscriber](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/lidar_subscriber/lib/python3.10/site-packages/lidar_subscriber/lidar_subscriber.py): `ros2_ws/install/lidar_subscriber/lib/python3.10/site-packages/lidar_subscriber/lidar_subscriber.py`
- [GPS subscriber](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/fixposition_pkg/lib/python3.10/site-packages/fixposition_pkg/gps_subscriber.py): `ros2_ws/install/fixposition_pkg/lib/python3.10/site-packages/fixposition_pkg/gps_subscriber.py`
- [IMU subscriber](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/fixposition_pkg/lib/python3.10/site-packages/fixposition_pkg/imu_subscriber.py): `ros2_ws/install/fixposition_pkg/lib/python3.10/site-packages/fixposition_pkg/imu_subscriber.py`
- [Odometry subscriber](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/install/fixposition_pkg/lib/python3.10/site-packages/fixposition_pkg/odometry_subscriber.py): `ros2_ws/install/fixposition_pkg/lib/python3.10/site-packages/fixposition_pkg/odometry_subscriber.py`
- **Sensor ROS topics**

### ROS TCP bridge

- [TCP endpoint server](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py): `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py`
- [Client protocol](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/client.py): `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/client.py`
- [TCP sender](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/tcp_sender.py): `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/tcp_sender.py`
- [ROS communication base](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/communication.py): `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/communication.py`
- [ROS publisher](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/publisher.py): `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/publisher.py`
- [ROS subscriber](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/subscriber.py): `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/subscriber.py`
- [ROS service client](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/service.py): `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/service.py`
- [Unity-backed service](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/unity_service.py): `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/unity_service.py`
- [Protocol exceptions](https://github.com/robotics-mechatronics-uma/rescue-dt/blob/main/ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/exceptions.py): `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/exceptions.py`

### Digital twin

- **Unity digital twin**

### Other components

- **Operator**

## Connections

- Operator → Keyboard teleop: provides input
- Keyboard teleop → ROS command topics: publishes commands
- Teleop node → ROS command topics: controls robot
- Camera subscriber → Sensor ROS topics: publishes data
- Lidar subscriber → Sensor ROS topics: publishes data
- GPS subscriber → Sensor ROS topics: publishes data
- IMU subscriber → Sensor ROS topics: publishes data
- Odometry subscriber → Sensor ROS topics: publishes data
- Sensor ROS topics → TCP endpoint server: bridges topics
- ROS command topics → TCP endpoint server: bridges topics
- TCP endpoint server → Client protocol: creates handlers (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py`)
- TCP endpoint server → TCP sender: configures sender (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py`)
- TCP endpoint server → ROS publisher: registers publisher (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py`)
- TCP endpoint server → ROS subscriber: registers subscriber (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py`)
- TCP endpoint server → ROS service client: registers service (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py`)
- TCP endpoint server → Unity-backed service: registers service (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/server.py`)
- Client protocol → Protocol exceptions: raises errors (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/client.py`)
- TCP sender → Client protocol: serializes messages (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/tcp_sender.py`)
- ROS publisher → ROS communication base: extends base (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/publisher.py`)
- ROS subscriber → ROS communication base: extends base (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/subscriber.py`)
- ROS service client → ROS communication base: extends base (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/service.py`)
- Unity-backed service → ROS communication base: extends base (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/unity_service.py`)
- Unity-backed service → Client protocol: uses protocol (evidence: `ros2_ws/src/ROS-TCP-Endpoint-main-ros2/ros_tcp_endpoint/unity_service.py`)
- TCP endpoint server → Unity digital twin: exchanges TCP data
