# ericsii/fast_lio_ros2 architecture

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

- Interactive diagram: https://gitdiagram.com/ericsii/fast_lio_ros2
- Repository: https://github.com/ericsii/fast_lio_ros2

## Overview

FAST-LIO is a ROS 2 LiDAR–inertial odometry and incremental mapping package. Its runtime entry point, `fastlio_mapping`, receives LiDAR and IMU data, preprocesses point clouds, combines inertial propagation with scan-to-map updates, and maintains a map for odometry and visualization. The README also documents sensor/configuration support and saving maps through `/map_save`. The sampled code confirms the entry point, preprocessing, filter implementation, and PCD writing; finer callback wiring and published topics are not fully visible in the excerpts.

Main entry points: [`src/laserMapping.cpp`](https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/laserMapping.cpp) (Mapping node), [`launch/mapping.launch.py`](https://github.com/ericsii/fast_lio_ros2/blob/ros2/launch/mapping.launch.py) (Mapping launch), [`include/IKFoM_toolkit/esekfom/esekfom.hpp`](https://github.com/ericsii/fast_lio_ros2/blob/ros2/include/IKFoM_toolkit/esekfom/esekfom.hpp) (Iterated EKF), [`include/ikd-Tree`](https://github.com/ericsii/fast_lio_ros2/tree/ros2/include/ikd-Tree) (Incremental KD-tree)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["ROS Runtime"]
  node_mapping_launch["Mapping launch<br/>[mapping.launch.py]"]
  node_mapping_node["Mapping node<br/>[laserMapping.cpp]"]
end

subgraph group_estimation["Odometry Estimation"]
  node_preprocess["Cloud preprocessing<br/>[preprocess.cpp]"]
  node_imu_process["IMU processing<br/>[IMU_Processing.hpp]"]
  node_ekf["Iterated EKF<br/>[esekfom.hpp]"]
  node_manifolds["Manifold state"]
  node_state_helpers["State utilities<br/>[common_lib.h]"]
end

subgraph group_mapping["Incremental Mapping"]
  node_ikdtree["Incremental KD-tree"]
  node_map_state[("Point-cloud map<br/>[laserMapping.cpp]")]
end

subgraph group_interfaces["Configuration and Output"]
  node_sensor_configs["Sensor configs"]
  node_pose6d["Pose message<br/>[Pose6D.msg]"]
  node_map_save["PCD map saving<br/>[laserMapping.cpp]"]
  node_rviz["RViz"]
end

node_lidar(("LiDAR"))
node_imu(("IMU"))
node_ros_launch(("ROS launch"))
node_rviz_user(("RViz user"))
node_pcd_file["PCD map file"]
node_ros_topics(("ROS outputs"))
node_livox_driver["Livox driver"]

node_ros_launch -->|"starts"| node_mapping_launch
node_mapping_launch -->|"launches"| node_mapping_node
node_mapping_launch -->|"selects"| node_sensor_configs
node_sensor_configs -->|"configures"| node_mapping_node
node_lidar -->|"publishes scans"| node_mapping_node
node_imu -->|"publishes measurements"| node_mapping_node
node_livox_driver -.->|"provides data"| node_lidar
node_mapping_node -->|"processes clouds"| node_preprocess
node_mapping_node -->|"processes IMU"| node_imu_process
node_mapping_node -->|"updates state"| node_ekf
node_ekf -->|"uses state representation"| node_manifolds
node_mapping_node -->|"uses state utilities"| node_state_helpers
node_mapping_node -->|"searches and updates"| node_ikdtree
node_mapping_node -->|"maintains"| node_map_state
node_ikdtree -->|"indexes points"| node_map_state
node_mapping_node -->|"publishes pose type"| node_pose6d
node_mapping_node -->|"publishes results"| node_ros_topics
node_mapping_launch -.->|"optionally launches"| node_rviz
node_rviz_user -->|"views"| node_rviz
node_mapping_node -->|"handles save"| node_map_save
node_map_save -->|"writes PCD"| node_pcd_file

click node_mapping_launch "https://github.com/ericsii/fast_lio_ros2/blob/ros2/launch/mapping.launch.py"
click node_mapping_node "https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/laserMapping.cpp"
click node_preprocess "https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/preprocess.cpp"
click node_imu_process "https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/IMU_Processing.hpp"
click node_ekf "https://github.com/ericsii/fast_lio_ros2/blob/ros2/include/IKFoM_toolkit/esekfom/esekfom.hpp"
click node_manifolds "https://github.com/ericsii/fast_lio_ros2/tree/ros2/include/IKFoM_toolkit/mtk"
click node_state_helpers "https://github.com/ericsii/fast_lio_ros2/blob/ros2/include/common_lib.h"
click node_ikdtree "https://github.com/ericsii/fast_lio_ros2/tree/ros2/include/ikd-Tree"
click node_map_state "https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/laserMapping.cpp"
click node_sensor_configs "https://github.com/ericsii/fast_lio_ros2/tree/ros2/config"
click node_pose6d "https://github.com/ericsii/fast_lio_ros2/blob/ros2/msg/Pose6D.msg"
click node_map_save "https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/laserMapping.cpp"
click node_rviz "https://github.com/ericsii/fast_lio_ros2/tree/ros2/rviz"

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_mapping_launch,node_mapping_node,node_rviz_user toneBlue
class node_preprocess,node_imu_process,node_ekf,node_manifolds,node_state_helpers toneAmber
class node_ikdtree,node_map_state toneMint
class node_sensor_configs,node_pose6d,node_map_save,node_rviz toneRose
class node_lidar,node_imu,node_ros_launch,node_pcd_file,node_ros_topics,node_livox_driver toneIndigo
```

## Components

### ROS Runtime

- [Mapping launch](https://github.com/ericsii/fast_lio_ros2/blob/ros2/launch/mapping.launch.py): `launch/mapping.launch.py`
- [Mapping node](https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/laserMapping.cpp): `src/laserMapping.cpp`

### Odometry Estimation

- [Cloud preprocessing](https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/preprocess.cpp): `src/preprocess.cpp`
- [IMU processing](https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/IMU_Processing.hpp): `src/IMU_Processing.hpp`
- [Iterated EKF](https://github.com/ericsii/fast_lio_ros2/blob/ros2/include/IKFoM_toolkit/esekfom/esekfom.hpp): `include/IKFoM_toolkit/esekfom/esekfom.hpp`
- [Manifold state](https://github.com/ericsii/fast_lio_ros2/tree/ros2/include/IKFoM_toolkit/mtk): `include/IKFoM_toolkit/mtk`
- [State utilities](https://github.com/ericsii/fast_lio_ros2/blob/ros2/include/common_lib.h): `include/common_lib.h`

### Incremental Mapping

- [Incremental KD-tree](https://github.com/ericsii/fast_lio_ros2/tree/ros2/include/ikd-Tree): `include/ikd-Tree`
- [Point-cloud map](https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/laserMapping.cpp): `src/laserMapping.cpp`

### Configuration and Output

- [Sensor configs](https://github.com/ericsii/fast_lio_ros2/tree/ros2/config): `config`
- [Pose message](https://github.com/ericsii/fast_lio_ros2/blob/ros2/msg/Pose6D.msg): `msg/Pose6D.msg`
- [PCD map saving](https://github.com/ericsii/fast_lio_ros2/blob/ros2/src/laserMapping.cpp): `src/laserMapping.cpp`
- [RViz](https://github.com/ericsii/fast_lio_ros2/tree/ros2/rviz): `rviz`

### Other components

- **LiDAR**
- **IMU**
- **ROS launch**
- **RViz user**
- **PCD map file**
- **ROS outputs**
- **Livox driver**

## Connections

- ROS launch → Mapping launch: starts
- Mapping launch → Mapping node: launches
- Mapping launch → Sensor configs: selects
- Sensor configs → Mapping node: configures
- LiDAR → Mapping node: publishes scans
- IMU → Mapping node: publishes measurements
- Livox driver → LiDAR: provides data
- Mapping node → Cloud preprocessing: processes clouds
- Mapping node → IMU processing: processes IMU
- Mapping node → Iterated EKF: updates state
- Iterated EKF → Manifold state: uses state representation
- Mapping node → State utilities: uses state utilities
- Mapping node → Incremental KD-tree: searches and updates
- Mapping node → Point-cloud map: maintains
- Incremental KD-tree → Point-cloud map: indexes points
- Mapping node → Pose message: publishes pose type
- Mapping node → ROS outputs: publishes results
- Mapping launch → RViz: optionally launches
- RViz user → RViz: views
- Mapping node → PCD map saving: handles save
- PCD map saving → PCD map file: writes PCD
