# carol-here/ros2-lidar-slam-simulation architecture

> Architecture diagram of the GitHub repository carol-here/ros2-lidar-slam-simulation, 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/carol-here/ros2-lidar-slam-simulation
- Repository: https://github.com/carol-here/ros2-lidar-slam-simulation

## Overview

This ROS 2 project defines a differential-drive robot and launch workflows for displaying it or simulating it in Gazebo. The documented user workflow is to start the simulation, send keyboard velocity commands, use LiDAR and odometry for SLAM mapping, and view the robot and map in RViz. SLAM, teleoperation, and RViz are external ROS tools, not implemented here. The launch files and robot model support the repository-side links; sensor, drive, and mapping data flow is based on the README rather than sampled plugin or SLAM configuration source.

Main entry points: [`launch/gazebo.launch.py`](https://github.com/carol-here/ros2-lidar-slam-simulation/blob/main/launch/gazebo.launch.py) (Gazebo launch), [`launch/display.launch.py`](https://github.com/carol-here/ros2-lidar-slam-simulation/blob/main/launch/display.launch.py) (Display launch), [`urdf/robot.urdf.xacro`](https://github.com/carol-here/ros2-lidar-slam-simulation/blob/main/urdf/robot.urdf.xacro) (Robot description)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launching["Launch workflows"]
  node_gazebo_launch["Gazebo launch<br/>[gazebo.launch.py]"]
  node_display_launch["Display launch<br/>[display.launch.py]"]
end

subgraph group_robot["Robot model"]
  node_xacro_model["Robot description<br/>[robot.urdf.xacro]"]
end

subgraph group_runtime["Simulation and mapping"]
  node_gazebo["Gazebo Classic"]
  node_spawner["Entity spawner"]
  node_state_publisher["Robot state publisher"]
  node_joint_publisher["Joint state publisher"]
  node_drive["Differential drive"]
  node_lidar["LiDAR sensor"]
  node_teleop["Keyboard teleop"]
  node_slam["SLAM Toolbox"]
  node_rviz["RViz2"]
  node_map[("Occupancy map")]
end

node_operator(("Operator"))

node_operator -->|"starts"| node_gazebo_launch
node_operator -->|"starts"| node_display_launch
node_gazebo_launch -->|"loads"| node_xacro_model
node_display_launch -->|"loads"| node_xacro_model
node_gazebo_launch -->|"starts"| node_gazebo
node_gazebo_launch -->|"starts"| node_state_publisher
node_gazebo_launch -->|"starts"| node_spawner
node_gazebo_launch -->|"delays"| node_spawner
node_display_launch -->|"starts"| node_state_publisher
node_display_launch -->|"starts"| node_joint_publisher
node_xacro_model -->|"describes"| node_spawner
node_xacro_model -->|"describes"| node_state_publisher
node_teleop -.->|"publishes /cmd_vel"| node_drive
node_drive -.->|"controls motion"| node_gazebo
node_gazebo -.->|"simulates"| node_lidar
node_lidar -.->|"publishes /scan"| node_slam
node_gazebo -.->|"provides /odom and /tf"| node_slam
node_slam -.->|"builds /map"| node_map
node_map -.->|"visualizes"| node_rviz
node_state_publisher -.->|"publishes /tf"| node_rviz

click node_gazebo_launch "https://github.com/carol-here/ros2-lidar-slam-simulation/blob/main/launch/gazebo.launch.py"
click node_display_launch "https://github.com/carol-here/ros2-lidar-slam-simulation/blob/main/launch/display.launch.py"
click node_xacro_model "https://github.com/carol-here/ros2-lidar-slam-simulation/blob/main/urdf/robot.urdf.xacro"

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_gazebo_launch,node_display_launch toneBlue
class node_xacro_model toneAmber
class node_gazebo,node_spawner,node_state_publisher,node_joint_publisher,node_drive,node_lidar,node_teleop,node_slam,node_rviz,node_map toneMint
class node_operator toneIndigo
```

## Components

### Launch workflows

- [Gazebo launch](https://github.com/carol-here/ros2-lidar-slam-simulation/blob/main/launch/gazebo.launch.py): `launch/gazebo.launch.py`
- [Display launch](https://github.com/carol-here/ros2-lidar-slam-simulation/blob/main/launch/display.launch.py): `launch/display.launch.py`

### Robot model

- [Robot description](https://github.com/carol-here/ros2-lidar-slam-simulation/blob/main/urdf/robot.urdf.xacro): `urdf/robot.urdf.xacro`

### Simulation and mapping

- **Gazebo Classic**
- **Entity spawner**
- **Robot state publisher**
- **Joint state publisher**
- **Differential drive**
- **LiDAR sensor**
- **Keyboard teleop**
- **SLAM Toolbox**
- **RViz2**
- **Occupancy map**

### Other components

- **Operator**

## Connections

- Operator → Gazebo launch: starts
- Operator → Display launch: starts
- Gazebo launch → Robot description: loads
- Display launch → Robot description: loads
- Gazebo launch → Gazebo Classic: starts
- Gazebo launch → Robot state publisher: starts
- Gazebo launch → Entity spawner: starts
- Gazebo launch → Entity spawner: delays
- Display launch → Robot state publisher: starts
- Display launch → Joint state publisher: starts
- Robot description → Entity spawner: describes
- Robot description → Robot state publisher: describes
- Keyboard teleop → Differential drive: publishes /cmd_vel
- Differential drive → Gazebo Classic: controls motion
- Gazebo Classic → LiDAR sensor: simulates
- LiDAR sensor → SLAM Toolbox: publishes /scan
- Gazebo Classic → SLAM Toolbox: provides /odom and /tf
- SLAM Toolbox → Occupancy map: builds /map
- Occupancy map → RViz2: visualizes
- Robot state publisher → RViz2: publishes /tf
