# enginksz/lio_sam_gazebo_ros2 architecture

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

- Interactive diagram: https://gitdiagram.com/enginksz/lio_sam_gazebo_ros2
- Repository: https://github.com/enginksz/lio_sam_gazebo_ros2

## Overview

This repository combines a Gazebo robot simulation with a ROS 2 LIO-SAM localization and mapping stack. The documented workflow is to launch LIO-SAM and the robot simulation in separate terminals; the simulation launch also starts robot control and state publishing. LIO-SAM’s distinct stages include point-cloud projection, feature extraction, IMU preintegration, and map optimization, with shared parameter and point-cloud utilities. Source excerpts show these stages and simulation launch composition, but do not establish the ROS topic connections between them, so those links are omitted.

Main entry points: [`src/robot_gazebo/launch/robot_sim.launch.py`](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_gazebo/launch/robot_sim.launch.py) (Simulation launch), [`src/LIO-SAM-ros2/include/lio_sam/utility.hpp`](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/include/lio_sam/utility.hpp) (Shared utilities), [`src/LIO-SAM-ros2/src/imageProjection.cpp`](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/imageProjection.cpp) (Cloud projection), [`src/LIO-SAM-ros2/src/featureExtraction.cpp`](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/featureExtraction.cpp) (Feature extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sim["Robot simulation"]
  node_sim_launch["Simulation launch"]
  node_world["Outdoor world<br/>[outdoor.world]"]
end

subgraph group_lio["LIO-SAM processing"]
  node_lio_launch["LIO-SAM launch<br/>[run.launch.py]"]
  node_projection["Cloud projection"]
  node_features["Feature extraction"]
  node_imu["IMU preintegration"]
  node_mapping["Map optimization<br/>[mapOptmization.cpp]"]
  node_utility["Shared utilities<br/>[utility.hpp]"]
  node_cloud_info["CloudInfo message<br/>[CloudInfo.msg]"]
  node_map_service["SaveMap service<br/>[SaveMap.srv]"]
end

subgraph group_robot["Robot model and control"]
  node_robot_control_launch["Control launch"]
  node_control["Robot control<br/>[robot_control.py]"]
  node_state_launch["State publisher launch"]
  node_robot_model["Robot description<br/>[robot.urdf.xacro]"]
end

subgraph group_sensors["Simulation sensors"]
  node_lidar_plugin["Velodyne laser plugin"]
  node_lidar_model["Velodyne model assets"]
end

node_operator(("Operator"))

node_operator -->|"launches"| node_lio_launch
node_operator -->|"launches"| node_sim_launch
node_sim_launch -->|"loads"| node_world
node_sim_launch -->|"includes"| node_robot_control_launch
node_robot_control_launch -->|"starts"| node_control
node_sim_launch -->|"includes"| node_state_launch
node_features -->|"uses"| node_utility
node_projection -->|"uses"| node_utility
node_imu -->|"uses"| node_utility
node_mapping -->|"uses"| node_utility
node_features -->|"uses message"| node_cloud_info
node_projection -->|"uses message"| node_cloud_info
node_mapping -->|"uses service"| node_map_service

click node_lio_launch "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/launch/run.launch.py"
click node_projection "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/imageProjection.cpp"
click node_features "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/featureExtraction.cpp"
click node_imu "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/imuPreintegration.cpp"
click node_mapping "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/mapOptmization.cpp"
click node_utility "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/include/lio_sam/utility.hpp"
click node_cloud_info "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/msg/CloudInfo.msg"
click node_map_service "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/srv/SaveMap.srv"
click node_sim_launch "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_gazebo/launch/robot_sim.launch.py"
click node_world "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_gazebo/worlds/outdoor.world"
click node_robot_control_launch "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_control/launch/robot_control.launch.py"
click node_control "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_control/scripts/robot_control.py"
click node_state_launch "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_gazebo/launch/robot_state_publisher.launch.py"
click node_robot_model "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_description/robot/robot.urdf.xacro"
click node_lidar_plugin "https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/velodyne_simulator/velodyne_gazebo_plugins/src/GazeboRosVelodyneLaser.cpp"
click node_lidar_model "https://github.com/enginksz/lio_sam_gazebo_ros2/tree/master/src/robot_gazebo/models/velodyne_description"

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_sim_launch,node_world toneBlue
class node_lio_launch,node_projection,node_features,node_imu,node_mapping,node_utility,node_cloud_info,node_map_service toneAmber
class node_robot_control_launch,node_control,node_state_launch,node_robot_model toneMint
class node_lidar_plugin,node_lidar_model toneRose
class node_operator toneIndigo
```

## Components

### Robot simulation

- [Simulation launch](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_gazebo/launch/robot_sim.launch.py): `src/robot_gazebo/launch/robot_sim.launch.py`
- [Outdoor world](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_gazebo/worlds/outdoor.world): `src/robot_gazebo/worlds/outdoor.world`

### LIO-SAM processing

- [LIO-SAM launch](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/launch/run.launch.py): `src/LIO-SAM-ros2/launch/run.launch.py`
- [Cloud projection](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/imageProjection.cpp): `src/LIO-SAM-ros2/src/imageProjection.cpp`
- [Feature extraction](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/featureExtraction.cpp): `src/LIO-SAM-ros2/src/featureExtraction.cpp`
- [IMU preintegration](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/imuPreintegration.cpp): `src/LIO-SAM-ros2/src/imuPreintegration.cpp`
- [Map optimization](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/src/mapOptmization.cpp): `src/LIO-SAM-ros2/src/mapOptmization.cpp`
- [Shared utilities](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/include/lio_sam/utility.hpp): `src/LIO-SAM-ros2/include/lio_sam/utility.hpp`
- [CloudInfo message](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/msg/CloudInfo.msg): `src/LIO-SAM-ros2/msg/CloudInfo.msg`
- [SaveMap service](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/LIO-SAM-ros2/srv/SaveMap.srv): `src/LIO-SAM-ros2/srv/SaveMap.srv`

### Robot model and control

- [Control launch](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_control/launch/robot_control.launch.py): `src/robot_control/launch/robot_control.launch.py`
- [Robot control](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_control/scripts/robot_control.py): `src/robot_control/scripts/robot_control.py`
- [State publisher launch](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_gazebo/launch/robot_state_publisher.launch.py): `src/robot_gazebo/launch/robot_state_publisher.launch.py`
- [Robot description](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/robot_description/robot/robot.urdf.xacro): `src/robot_description/robot/robot.urdf.xacro`

### Simulation sensors

- [Velodyne laser plugin](https://github.com/enginksz/lio_sam_gazebo_ros2/blob/master/src/velodyne_simulator/velodyne_gazebo_plugins/src/GazeboRosVelodyneLaser.cpp): `src/velodyne_simulator/velodyne_gazebo_plugins/src/GazeboRosVelodyneLaser.cpp`
- [Velodyne model assets](https://github.com/enginksz/lio_sam_gazebo_ros2/tree/master/src/robot_gazebo/models/velodyne_description): `src/robot_gazebo/models/velodyne_description`

### Other components

- **Operator**

## Connections

- Operator → LIO-SAM launch: launches (evidence: `README.md`)
- Operator → Simulation launch: launches (evidence: `README.md`)
- Simulation launch → Outdoor world: loads (evidence: `src/robot_gazebo/launch/robot_sim.launch.py`)
- Simulation launch → Control launch: includes (evidence: `src/robot_gazebo/launch/robot_sim.launch.py`)
- Control launch → Robot control: starts (evidence: `src/robot_control/launch/robot_control.launch.py`)
- Simulation launch → State publisher launch: includes (evidence: `src/robot_gazebo/launch/robot_sim.launch.py`)
- Feature extraction → Shared utilities: uses (evidence: `src/LIO-SAM-ros2/src/featureExtraction.cpp`)
- Cloud projection → Shared utilities: uses (evidence: `src/LIO-SAM-ros2/src/imageProjection.cpp`)
- IMU preintegration → Shared utilities: uses (evidence: `src/LIO-SAM-ros2/src/imuPreintegration.cpp`)
- Map optimization → Shared utilities: uses (evidence: `src/LIO-SAM-ros2/src/mapOptmization.cpp`)
- Feature extraction → CloudInfo message: uses message (evidence: `src/LIO-SAM-ros2/src/featureExtraction.cpp`)
- Cloud projection → CloudInfo message: uses message (evidence: `src/LIO-SAM-ros2/src/imageProjection.cpp`)
- Map optimization → SaveMap service: uses service (evidence: `src/LIO-SAM-ros2/src/mapOptmization.cpp`)
