Skip to content

Commit a2fde77

Browse files
Add LIO-SAM velocity undistortion and dynamic obstacle filtering guide (#252)
Adds a new state-estimation wiki guide on improving LIO-SAM mapping quality: - LiDAR motion distortion and 6-DOF velocity-based undistortion - Core setup/configuration for the improved LIO-SAM workflow - Post-mapping dynamic obstacle filtering workflow using CloudCompare - Future improvements (GNSS constraints, frame-quality gating, automation via sensor fusion) --------- Co-authored-by: Nevin Valsaraj <5763537+nevalsar@users.noreply.github.com>
1 parent baac146 commit a2fde77

9 files changed

Lines changed: 137 additions & 1 deletion

File tree

_data/navigation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ wiki:
213213
url: /wiki/state-estimation/cartographer-ros-integration/
214214
- title: External Position Estimation using OptiTrack Motion Capture System
215215
url: /wiki/state-estimation/optitrack-motion-capture/
216+
- title: LIO-SAM with Velocity Undistortion & Dynamic Obstacle Filtering
217+
url: /wiki/state-estimation/lio-sam-velocity-undistortion-and-dynamic-filtering/
216218
- title: Running SLAM in Production - A Practitioner's Guide
217219
url: /wiki/state-estimation/running-slam-in-production/
218220
- title: Programming
506 KB
Loading
522 KB
Loading
275 KB
Loading
36.2 KB
Loading
17.6 KB
Loading
1.09 MB
Loading

wiki/state-estimation/index.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ The "State Estimation" section provides a comprehensive understanding of how to
6767
- Implementation details for vertices, edges, and solvers.
6868
- Common applications in robotic perception and mapping.
6969

70+
- **[LIO-SAM with Velocity Undistortion & Dynamic Obstacle Filtering](/wiki/state-estimation/lio-sam-velocity-undistortion-and-dynamic-filtering/)**
71+
Provides a practical guide to improving LIO-SAM mapping with velocity-based motion undistortion and post-mapping dynamic obstacle filtering.
72+
- Overview of LiDAR motion distortion and its impact on map quality.
73+
- Integration of vehicle speed for 6-DOF point cloud undistortion.
74+
- Manual dynamic obstacle removal using CloudCompare.
75+
7076
- **[Running SLAM in Production - A Practitioner's Guide](/wiki/state-estimation/running-slam-in-production/)**
7177
A practitioner-oriented guide to deploying monocular feature-based SLAM, with ORB-SLAM3 as the running example. Covers how to choose between SLAM families, the failure modes a deployed monocular system actually hits in the field, and how to engineer for them.
7278
- When to pick monocular ORB-SLAM3 vs stereo, visual-inertial, direct, or learned methods.
@@ -85,4 +91,5 @@ The "State Estimation" section provides a comprehensive understanding of how to
8591
- [Radar-Camera Sensor Fusion Overview](https://radar-camera-fusion-tutorial.com)
8692
- [Costmap2D ROS Package](http://wiki.ros.org/costmap_2d)
8793
- [Visual Servoing Platform (ViSP)](https://visp.inria.fr/)
88-
- [Search-Based Planning Lab (SBPL)](http://sbpl.net/)
94+
- [Search-Based Planning Lab (SBPL)](http://sbpl.net/)
95+
- [Autoware Distortion Corrector](https://autowarefoundation.github.io/autoware_universe/main/sensing/autoware_pointcloud_preprocessor/docs/distortion-corrector/)
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
# Jekyll 'Front Matter' goes here. Most are set by default, and should NOT be
3+
# overwritten except in special circumstances.
4+
# You should set the date the article was last updated like this:
5+
date: 2026-04-29 # YYYY-MM-DD
6+
# This will be displayed at the bottom of the article
7+
# You should set the article's title:
8+
title: LIO-SAM with Velocity Undistortion & Dynamic Obstacle Filtering
9+
# The 'title' is automatically displayed at the top of the page
10+
# and used in other parts of the site.
11+
---
12+
LIO-SAM is a real-time LiDAR-inertial SLAM framework that estimates a robot’s pose and builds a 3D map by fusing LiDAR, IMU, and optionally GPS data. It uses factor graph optimization to combine scan matching, IMU preintegration, loop closure, and GPS constraints, producing accurate and consistent localization in large-scale environments.
13+
14+
Links:
15+
- [Classic LIO-SAM](https://github.com/TixiaoShan/LIO-SAM)
16+
- [Our Improved LIO-SAM](https://github.com/JoshuaTsai0520/LIO-SAM-Velocity/tree/ros2-velocity)
17+
18+
The detailed explanation of the LIO-SAM algorithm and its configuration settings can be found in the original paper and GitHub repository, so they will not be repeated here. The main purpose of this guide is to introduce the core setup steps and key features of our improved version.
19+
20+
After the point cloud map is built, we will also describe a simple approach for removing dynamic obstacles and outliers from the map. Our goal is to generate a static, clean, and high-quality 3D point cloud map.
21+
22+
## Dependencies
23+
Our improved version is tested with ROS2 Humble on Ubuntu 22.04.
24+
25+
Refer to the [Dependencies](https://github.com/TixiaoShan/LIO-SAM/tree/ros2) in LIO-SAM's github ros2 branch.
26+
27+
Install [ROS2](https://docs.ros.org/en/humble/Installation.html):
28+
```
29+
sudo apt install ros-<ros2-version>-perception-pcl \
30+
ros-<ros2-version>-pcl-msgs \
31+
ros-<ros2-version>-vision-opencv \
32+
ros-<ros2-version>-xacro
33+
```
34+
35+
Install [GTSAM](https://gtsam.org/get_started/):
36+
```
37+
sudo add-apt-repository ppa:borglab/gtsam-release-4.1
38+
sudo apt install libgtsam-dev libgtsam-unstable-dev
39+
```
40+
41+
Use the following script to install [Sophus](https://github.com/strasdat/Sophus.git):
42+
43+
```
44+
bash install_sophus.sh
45+
```
46+
47+
## Installation
48+
Use the following commands to compile the package:
49+
50+
```
51+
git clone https://github.com/JoshuaTsai0520/LIO-SAM-Velocity.git
52+
cd LIO-SAM-Velocity
53+
git checkout ros2-velocity
54+
bash build_lio.sh
55+
```
56+
57+
## Run the package
58+
The source command is already written in the script:
59+
```
60+
bash run_lio.sh
61+
```
62+
63+
Then play bag files:
64+
```
65+
ros2 bag play your-bag
66+
```
67+
68+
## Core Configuration Setup
69+
70+
### Input Topic
71+
- pointCloudTopic (sensor_msgs/msg/PointCloud2)
72+
- imuTopic (sensor_msgs/msg/Imu)
73+
- twistTopic (geometry_msgs/msg/TwistStamped) (Optional)
74+
- gpsTopic (nav_msgs::msg::Odometry) (Optional)
75+
76+
### Distortion Function
77+
- enable_distortion_function: Open if you want to use distortion correction algorithm
78+
- use_imu: Use IMU data in distortion function
79+
- use_velocity: Use velocity data in distortion function
80+
81+
### IMU Settings
82+
- extrinsicTrans: Translation between LiDAR and IMU
83+
- extrinsicRot, extrinsicRPY: Rotation between LiDAR and IMU
84+
85+
### Loop Closure
86+
- loopClosureEnableFlag: Open loop closing
87+
- historyKeyframeFitnessScore: ICP matching threshold, adjust it if loop closing performance is bad
88+
89+
## Distortion Correction Module
90+
LiDAR motion distortion occurs when the sensor or robot moves while a frame is being captured. Since a rotating LiDAR does not measure all points at the same instant, different parts of the point cloud correspond to slightly different sensor poses. This can cause straight walls to appear curved, objects to shift position, and scan matching accuracy to degrade. The rotation distortion video is shown [here](https://drive.google.com/file/d/1KnMkAbJXtDpj2OJxOIoW3D4nRNeQGs_S/view?usp=sharing).
91+
92+
In LIO-SAM, IMU measurements are used to estimate the sensor’s rotational motion during each scan and correct, or “undistort,” the point cloud before mapping. However, translational motion of the sensor is not fully accounted for. When the vehicle moves at high speed, this translation-induced distortion can become significant and may degrade mapping quality.
93+
94+
To address this issue, we integrated vehicle speed information and introduced a 6-DOF motion distortion corrector that accounts for both rotational and translational motion along all axes. A similar approach can be found in [Autoware distortion corrector](https://autowarefoundation.github.io/autoware_universe/main/sensing/autoware_pointcloud_preprocessor/docs/distortion-corrector/) module.
95+
96+
As a result, the quality of the constructed map is significantly improved. Within each LiDAR frame, all points are transformed into a consistent coordinate frame, making the scan more geometrically rigid. The mapping results before and after distortion correction are shown below.
97+
98+
Before distortion correction:
99+
![](/assets/images/state-estimation/Before_Undistortion.png)
100+
After distortion correction:
101+
![](/assets/images/state-estimation/After_Undistortion.png)
102+
103+
## Dynamic Obstacle Filtering
104+
Dynamic obstacle filtering is applied after the initial map is constructed to remove points caused by moving objects, such as vehicles, pedestrians, or cyclists. These dynamic points may appear as ghost artifacts or inconsistent structures in the map because they do not belong to the static environment. By identifying and removing them from the generated point cloud map, the final map becomes cleaner, more reliable, and better suited for localization and navigation.
105+
106+
A simple way to remove these dynamic obstacles is through manual selection. We use CloudCompare to edit and refine point cloud segments in the map. For example, in a map generated by LIO-SAM, many unwanted dynamic obstacles and outliers may remain. In CloudCompare, the Segment tool can be used to select the areas that need to be removed, as shown below:
107+
![](/assets/images/state-estimation/DOF1.png)
108+
109+
After making the selection, click Segment Out and then Confirm to separate that portion of the point cloud. However, the segmented part may still contain both dynamic obstacles and static points, such as the ground. Therefore, you should apply the Segment tool again to further isolate the dynamic objects:
110+
![](/assets/images/state-estimation/DOF2.png)
111+
112+
After the second segmentation, you can obtain a static section with the dynamic points removed:
113+
![](/assets/images/state-estimation/DOF3.png)
114+
115+
After applying multiple segmentation steps across the map, merge all remaining static point cloud segments into a single file. This produces a high-quality static map with dynamic obstacles removed:
116+
![](/assets/images/state-estimation/DOF4.png)
117+
The white points represent the filtered dynamic obstacles, while the colored points represent the remaining static map.
118+
119+
## Future Work
120+
Several improvements can be added in future work. First, GNSS measurements can be integrated as an elevation drift constraint during mapping. This would help reduce vertical drift and improve map consistency, especially in large-scale outdoor environments.
121+
122+
Second, better visualization tools can be developed to make the mapping and filtering results easier to inspect. Clear visualization of trajectory quality, point cloud alignment, removed dynamic objects, and map consistency would help with debugging and evaluation.
123+
124+
Third, scan matching results can be evaluated before each frame is added to the map. Frames with poor matching quality, large residual errors, or unstable pose estimates could be discarded to prevent them from degrading the final map.
125+
126+
Finally, dynamic object removal can be automated using LiDAR-camera sensor fusion and object detection. Camera-based detection can identify dynamic objects such as vehicles and pedestrians, while LiDAR points associated with those objects can be removed from the point cloud map automatically. This would reduce manual editing and improve the scalability of the mapping pipeline.
127+

0 commit comments

Comments
 (0)