# nguyenhuuddinh/nchk_robotfirefighting_ros architecture

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

- Interactive diagram: https://gitdiagram.com/nguyenhuuddinh/nchk_robotfirefighting_ros
- Repository: https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros

## Overview

This ROS 2 workspace forms the runtime stack for a fire-response mobile robot: operators or autonomy supply velocity commands, a Pi-side safety gate forwards fresh commands or STOP, and the ESP32 receives them through micro-ROS. Sensors and odometry feed scan/TF data for SLAM; robot description supplies the sensor frame tree, while the dashboard exposes a browser-facing bridge. The graph reflects launch declarations and sampled node behavior; dashboard internals, mapping outputs, and several ESP32 capabilities are documented but their implementation is not present in sampled source.

Main entry points: [`ros2_ws/src/fire_robot_bringup/launch/robot.launch.py`](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/robot.launch.py) (Robot launch), [`ros2_ws/src/fire_robot_safety/fire_robot_safety/safety_watchdog.py`](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_safety/fire_robot_safety/safety_watchdog.py) (Safety watchdog), [`ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py`](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py) (Sensor launch), [`ros2_ws/src/fire_robot_bringup/launch/micro_ros.launch.py`](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/micro_ros.launch.py) (micro-ROS agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Robot bringup"]
  node_robot_launch["Robot launch<br/>[robot.launch.py]"]
  node_sensors_launch["Sensor launch<br/>[sensors.launch.py]"]
  node_micro_launch["micro-ROS launch"]
  node_description_launch["Description launch"]
  node_safety_launch["Safety launch<br/>[safety.launch.py]"]
  node_dashboard_launch["Dashboard launch"]
end

subgraph group_sensing["Sensing and frames"]
  node_lidar["Camsense lidar<br/>[sensors.launch.py]"]
  node_scan_relay["Scan QoS relay<br/>[scan_qos_relay.py]"]
  node_usb_camera["USB camera<br/>[sensors.launch.py]"]
  node_odom_tf["Odometry TF"]
  node_robot_description["Robot URDF"]
  node_state_publisher["State publisher"]
end

subgraph group_control["Command safety"]
  node_safety_gate["Safety watchdog<br/>[safety_watchdog.py]"]
end

subgraph group_mapping["Mapping"]
  node_slam_launch["SLAM launch<br/>[slam.launch.py]"]
  node_slam_toolbox["SLAM Toolbox<br/>[slam.launch.py]"]
  node_slam_config["Mapper config"]
  node_scan_consumer["SLAM scan input<br/>[slam.launch.py]"]
end

subgraph group_interfaces["External interfaces"]
  node_micro_agent["micro-ROS agent"]
  node_esp32{{"ESP32-S3 robot"}}
  node_dashboard["Web dashboard"]
end

node_operator(("Operator / autonomy"))
node_browser(("Browser client"))

node_operator -->|"starts stack"| node_robot_launch
node_robot_launch -->|"includes"| node_sensors_launch
node_robot_launch -->|"includes"| node_micro_launch
node_robot_launch -->|"includes"| node_description_launch
node_robot_launch -->|"includes"| node_safety_launch
node_robot_launch -->|"includes"| node_dashboard_launch
node_sensors_launch -->|"starts"| node_lidar
node_sensors_launch -->|"starts"| node_scan_relay
node_sensors_launch -.->|"optionally starts"| node_usb_camera
node_lidar -->|"publishes scans"| node_scan_relay
node_scan_relay -->|"relays scans"| node_scan_consumer
node_micro_launch -->|"starts"| node_micro_agent
node_micro_agent -->|"bridges serial"| node_esp32
node_operator -->|"sends velocity"| node_safety_gate
node_safety_launch -->|"starts"| node_safety_gate
node_safety_gate -->|"publishes /cmd_vel"| node_micro_agent
node_micro_agent -->|"delivers /odom"| node_safety_gate
node_safety_gate -->|"commands via agent"| node_esp32
node_esp32 -->|"publishes /odom"| node_odom_tf
node_odom_tf -->|"broadcasts TF"| node_scan_consumer
node_description_launch -->|"starts"| node_state_publisher
node_state_publisher -->|"loads model"| node_robot_description
node_state_publisher -->|"publishes frame tree"| node_scan_consumer
node_slam_launch -->|"starts"| node_slam_toolbox
node_slam_launch -->|"loads parameters"| node_slam_config
node_scan_consumer -->|"provides scan"| node_slam_toolbox
node_dashboard_launch -->|"starts bridge"| node_dashboard
node_browser -->|"connects WebSocket"| node_dashboard

click node_robot_launch "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/robot.launch.py"
click node_sensors_launch "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py"
click node_micro_launch "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/micro_ros.launch.py"
click node_description_launch "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_description/launch/description.launch.py"
click node_safety_launch "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_safety/launch/safety.launch.py"
click node_dashboard_launch "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/dashboard.launch.py"
click node_lidar "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py"
click node_scan_relay "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/fire_robot_bringup/scan_qos_relay.py"
click node_usb_camera "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py"
click node_micro_agent "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/micro_ros.launch.py"
click node_safety_gate "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_safety/fire_robot_safety/safety_watchdog.py"
click node_odom_tf "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/fire_robot_bringup/odom_to_tf_broadcaster.py"
click node_robot_description "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_description/urdf/fire_robot.urdf.xacro"
click node_state_publisher "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_description/launch/description.launch.py"
click node_slam_launch "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_navigation/launch/slam.launch.py"
click node_slam_toolbox "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_navigation/launch/slam.launch.py"
click node_slam_config "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_navigation/config/mapper_params_online_async.yaml"
click node_dashboard "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/dashboard.launch.py"
click node_scan_consumer "https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_navigation/launch/slam.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_robot_launch,node_sensors_launch,node_micro_launch,node_description_launch,node_safety_launch,node_dashboard_launch,node_browser toneBlue
class node_lidar,node_scan_relay,node_usb_camera,node_odom_tf,node_robot_description,node_state_publisher toneAmber
class node_safety_gate toneMint
class node_slam_launch,node_slam_toolbox,node_slam_config,node_scan_consumer toneRose
class node_micro_agent,node_esp32,node_dashboard,node_operator toneIndigo
```

## Components

### Robot bringup

- [Robot launch](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/robot.launch.py): `ros2_ws/src/fire_robot_bringup/launch/robot.launch.py`
- [Sensor launch](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py): `ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py`
- [micro-ROS launch](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/micro_ros.launch.py): `ros2_ws/src/fire_robot_bringup/launch/micro_ros.launch.py`
- [Description launch](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_description/launch/description.launch.py): `ros2_ws/src/fire_robot_description/launch/description.launch.py`
- [Safety launch](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_safety/launch/safety.launch.py): `ros2_ws/src/fire_robot_safety/launch/safety.launch.py`
- [Dashboard launch](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/dashboard.launch.py): `ros2_ws/src/fire_robot_bringup/launch/dashboard.launch.py`

### Sensing and frames

- [Camsense lidar](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py): `ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py`
- [Scan QoS relay](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/fire_robot_bringup/scan_qos_relay.py): `ros2_ws/src/fire_robot_bringup/fire_robot_bringup/scan_qos_relay.py`
- [USB camera](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py): `ros2_ws/src/fire_robot_bringup/launch/sensors.launch.py`
- [Odometry TF](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/fire_robot_bringup/odom_to_tf_broadcaster.py): `ros2_ws/src/fire_robot_bringup/fire_robot_bringup/odom_to_tf_broadcaster.py`
- [Robot URDF](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_description/urdf/fire_robot.urdf.xacro): `ros2_ws/src/fire_robot_description/urdf/fire_robot.urdf.xacro`
- [State publisher](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_description/launch/description.launch.py): `ros2_ws/src/fire_robot_description/launch/description.launch.py`

### Command safety

- [Safety watchdog](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_safety/fire_robot_safety/safety_watchdog.py): `ros2_ws/src/fire_robot_safety/fire_robot_safety/safety_watchdog.py`

### Mapping

- [SLAM launch](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_navigation/launch/slam.launch.py): `ros2_ws/src/fire_robot_navigation/launch/slam.launch.py`
- [SLAM Toolbox](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_navigation/launch/slam.launch.py): `ros2_ws/src/fire_robot_navigation/launch/slam.launch.py`
- [Mapper config](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_navigation/config/mapper_params_online_async.yaml): `ros2_ws/src/fire_robot_navigation/config/mapper_params_online_async.yaml`
- [SLAM scan input](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_navigation/launch/slam.launch.py): `ros2_ws/src/fire_robot_navigation/launch/slam.launch.py`

### External interfaces

- [micro-ROS agent](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/micro_ros.launch.py): `ros2_ws/src/fire_robot_bringup/launch/micro_ros.launch.py`
- **ESP32-S3 robot**
- [Web dashboard](https://github.com/nguyenhuuddinh/nchk_robotfirefighting_ros/blob/main/ros2_ws/src/fire_robot_bringup/launch/dashboard.launch.py): `ros2_ws/src/fire_robot_bringup/launch/dashboard.launch.py`

### Other components

- **Operator / autonomy**
- **Browser client**

## Connections

- Operator / autonomy → Robot launch: starts stack
- Robot launch → Sensor launch: includes
- Robot launch → micro-ROS launch: includes
- Robot launch → Description launch: includes
- Robot launch → Safety launch: includes
- Robot launch → Dashboard launch: includes
- Sensor launch → Camsense lidar: starts
- Sensor launch → Scan QoS relay: starts
- Sensor launch → USB camera: optionally starts
- Camsense lidar → Scan QoS relay: publishes scans
- Scan QoS relay → SLAM scan input: relays scans
- micro-ROS launch → micro-ROS agent: starts
- micro-ROS agent → ESP32-S3 robot: bridges serial
- Operator / autonomy → Safety watchdog: sends velocity
- Safety launch → Safety watchdog: starts
- Safety watchdog → micro-ROS agent: publishes /cmd_vel
- micro-ROS agent → Safety watchdog: delivers /odom
- Safety watchdog → ESP32-S3 robot: commands via agent
- ESP32-S3 robot → Odometry TF: publishes /odom
- Odometry TF → SLAM scan input: broadcasts TF
- Description launch → State publisher: starts
- State publisher → Robot URDF: loads model
- State publisher → SLAM scan input: publishes frame tree
- SLAM launch → SLAM Toolbox: starts
- SLAM launch → Mapper config: loads parameters
- SLAM scan input → SLAM Toolbox: provides scan
- Dashboard launch → Web dashboard: starts bridge
- Browser client → Web dashboard: connects WebSocket
