Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

better_fastlio2

> 编程语言
Open source

Postgraduate Thesis: fast_lio_sam + dynamic removal (T-GRS 2024) + multi-session mapping (ICRA 2022 Kim) + object-level update + online relocalization (ICRA 202

740 stars0 likes1 views
WebsiteGitHub

About

Postgraduate Thesis: fast_lio_sam + dynamic removal (T-GRS 2024) + multi-session mapping (ICRA 2022 Kim) + object-level update + online relocalization (ICRA 202

To be a better FAST-LIO2

0 Introdunction

  • Front_end: FAST-LIO2 + Dynamic Removal + Yolo(Optional)
  • Back_end: Scan Context + GPS(Optional) + GTSAM
  • Application: Joint Pose-graph Optimization using iSAM2, Fast and Robust ICP relocalization

Note

  • The offline dynamic removal module using segmented curved-voxel occupancy descriptor (T-GRS 2024) can be found in repo
  • The modified multi-session mapping module based on LT-Mapping (ICRA 2022) can be found in repo
  • The new version of online relocalization module name LiLoc (ICRA 2025) can be found in repo
  • Some details of sensor platform and application can be found in repo

1 Prerequisites

  • Ubuntu 20.04 and ROS Noetic
  • PCL >= 1.10 (default for Ubuntu 20.04)
  • Eigen >= 3.3.4 (default for Ubuntu 20.04)
  • GTSAM >= 4.0.3 (test on 4.2(a))
  • Livox_ros_driver
  • Darknet_ros

3 Build

3.1 Source Code

bash
cd YOUR_WORKSPACE/src
git clone https://github.com/Yixin-F/better_fastlio2
cd ..
catkin_make

3.2 Docker

…

One problem: if you want to use RViz or Gazebo, exit the container and enter again

bash
docker start better-fast-lio2
docker exec -it better-fast-lio2 /bin/bash

4 How to Use

4.1 LIO Mapping using Livox, Velodyne, Ouster or Robosense

In this section, we developed a more comprehensive FAST-LIO2 version including dynamic removal using SCV-OD (accepted by T-GRS) and YOLO(optional), optimization backend using Scan Context, GPS(optional) and GTSAM. At the same time, we rewritted the mechanism of i-kdtree reconstruction to be suitable for low-power embedded devices. The basic framework is illustrated in the following figure.

You can run it by the following commands.

bash
source ./devel/setup.bash
roslaunch fast_lio_sam mapping_*.launch

For other application, you need to first check the Config/*.yaml about the settings for different LiDAR types, we list parameters here. "-" means that it depends on your own project.

Parameters 中文解释 default(默认值)
lid_topic 雷达话题名称 -
imu_topic IMU话题名称 -
time_sync_en 是否进行时间软同步 false
rootDir 结果保存根路径 -
savePCD 是否保存点云帧PCD true
savePCDDirectory 点云帧PCD保存路径 PCDs/
saveSCD 是否保存点云帧SCD true
saveSCDDirectory 点云帧SCD保存路径 SCDs/
saveLOG 是否保存LOG文件 true
saveLOGDirectory LOG文件保存路径 LOG/
map_save_en 是否保存地图 true
pcd_save_interval -(未使用) -
lidar_type 雷达类型 -
livox_type Livox类型 -
scan_line 雷达线数 -
blind 无效距离范围(m) 1.0
feature_enabled 是否进行特征提取 false
point_filter_num 有效采样点步长 1
scan_rate 扫描频率 -
time_unit 时间单位 -
camera_en 是否使用相机 false
camera_external 相机到IMU外参 -
camera_internal 相机内参 -
acc_cov 线加速度协方差 0.1
gyr_cov 角速度协方差 0.1
b_acc_cov 线加速度偏置协方差 0.001
b_gyr_cov 角速度偏置协方差 0.001
fov_degree 视角范围(deg) 180.0
det_range 最远探测距离(m) 100.0
cube_len i-kdtree维护立方体边长(m) 500
extrinsic_est_en 是否在线标定雷达到IMU外参 false
mappingSurfLeafSize 点云地图下采样分辨率(m) 0.2
keyframeAddingDistThreshold 关键帧平移阈值(m) 1.0
keyframeAddingAngleThreshold 关键帧旋转阈值(rad) 0.2
extrinsic_T 雷达到IMU平移外参 -
extrinsic_R 雷达到IMU旋转外参 -
max_iteration ESEKF最大迭代次数 3
recontructKdTree 是否重建i-kdtree false
kd_step i-kdtree重建步长 50
filter_size_map_min i-kdtree下采样分辨率(m) 0.2
loopClosureEnableFlag 是否开启回环检测 false
loopClosureFrequency 回环检测频率(hz) 1.0
historyKeyframeSearchRadius 有效回环检测搜索半径(m) 10.0
historyKeyframeSearchTimeDiff 有效回环检搜索时差(s) 30.0
historyKeyframeSearchNum 历史帧搜索个数 1
historyKeyframeFitnessScore icp检验阈值 0.2
ground_en 是否进行地面约束 false
tollerance_en 是否使用自由度阈值约束 false
sensor_height 传感器高度(m) -
z_tollerance z轴约束阈值(m) 2.0
rotation_tollerance pitch和roll约束阈值(rad) 0.2
path_en 是否发布位姿轨迹 true
scan_publish_en 是否发布点云 true
dense_publish_en 是否发布稠密点云 true
scan_bodyframe_pub_en 是否发布IMU坐标系下点云 false
globalMapVisualizationSearchRadius i-kdtree搜索距离(m) 10.0
globalMapVisualizationPoseDensity i-kdtree位姿采样步长 1
globalMapVisualizationLeafSize i-kdtree可视化下采样分辨率(m) 0.2
visulize_IkdtreeMap 是否发布i-kdtree true

Note that if you wanna use the dynamic removal module, you have to make the "src/laserMapping.cpp line 2271-2307" effect. But differnet from the origianl dynamic removal method in T-GRS paper, we utilized the voxel center to align consecutive keyframes, which improves the real-time performance but also sacrifices some precision. So, we do not recommend using the Velodyne VLP16 for testing because its scan point cloud is too sparse. This dynamic removal module can be showed by the following figure.

  1. Here we list some important functions in src/laserMapping.cpp as follows:
Function Name 中文解释
imageCallback usb图像回调函数 720x1280
paramSetting usb相机内参与外参设置
BoxCallback yolo目标检测包络框
publish_frame_world_color 彩色点云发布
updatePath 更新里程计轨迹
constraintTransformation 位姿变换限制
getCurPose 获得当前位姿
visualizeLoopClosure 发布回环检测marker
saveFrame 保存关键帧
addOdomFactor 添加激光里程计因子
addLoopFactor 添加回环因子
recontructIKdTree i-kdtree重建
saveKeyFramesAndFactor 关键帧保存、因子添加和因子图优化主函数
correctPoses 更新优化后的位姿
detectLoopClosureDistance 回环检测--近邻搜索
loopFindNearKeyframes 搜索最近关键帧
performLoopClosure 回环检测--scan context,回环检测执行
loopClosureThread 回环检测主函数
SigHandle ctrl+c 终止函数
dump_lio_state_to_log 保存log文件
pointBodyToWorld_ikfom 点云变换到世界坐标系下
pointBodyToWorld 点云变换到世界坐标系下
pointBodyToWorld 点云变换到世界坐标系下
RGBpointBodyToWorld 彩色点云变换到世界坐标系下
RGBpointBodyLidarToIMU 彩色点云变换到IMU坐标系下
points_cache_collect 删除i-kdtree缓存
lasermap_fov_segment FoV视角分割
standard_pcl_cbk 标准pcl点云回调函数
livox_pcl_cbk livox pcl点云回调函数
livox_ros_cbk ros pcl点云回调函数
imu_cbk imu回调函数
LivoxRepubCallback -
map_incremental i-kdtree增量管理
publish_frame_world 发布世界坐标系下点云
publish_frame_body 发布IMU坐标系下点云
publish_effect_world 发布世界坐标系下有效点云
publish_map 发布世界坐标系下i-kdtree点云
publish_effect_world 设置位姿
set_posestamp 发布世界坐标系下有效点云
publish_odometry 发布里程计
publish_path_imu 发布IMU轨迹
publish_path 发布未优化位姿
publish_path_update 发布优化后位姿
CreateFile 创建文件夹
savePoseService 位姿保存服务
saveMapService 地图保存服务
savePoseService 位姿保存服务
saveMap 地图保存触发
publishGlobalMap 发布世界坐标系下关键帧点云
h_share_model 观测更新主函数
main 里程计主函数
  1. Here we list some important functions in include/dynamic-remove/tgrs.cpp as follows:
Function Name 中文解释
mergeClusters 聚类覆盖
findVoxelNeighbors 搜索近邻体素
cluster 聚类主函数
getBoundingBoxOfCloud 获取聚类物体boundingbox
getCloudByVec 使用vector提取点云
recognizePD 识别潜在动态物体主函数
trackPD 跟踪潜在动态物体主函数
saveColorCloud 按照聚类类别保存彩色点云
  1. Here we list some important functions in include/sc-relo/Scancontext.cpp as follows:
Function Name 中文解释
coreImportTest -
rad2deg rad2deg
deg2rad deg2rad
xy2theta xy2theta
circshift 矩阵行平移
eig2stdvec 矩阵转换为vector
distDirectSC sc矩阵距离计算
fastAlignUsingVkey sc矩阵列匹配
distanceBtnScanContext sc矩阵相似度计算
makeScancontext sc生成
makeRingkeyFromScancontext ring生成
makeSectorkeyFromScancontext sector对应
makeAndSaveScancontextAndKeys sc生成主函数
saveScancontextAndKeys sc插入
detectLoopClosureIDBetweenSession multi-session重定位检测主函数
getConstRefRecentSCD sc获取
detectClosestKeyframeID 回环帧ID获取
detectLoopClosureID 回环帧ID获取
saveCurrentSCD scd保存
loadPriorSCD multi-session加载先验scd
relocalize multi-session重定位主函数

After you have run the command, there are several files being generated in the filefold "rootDir/*" as follows:

File Name 中文解释
LOG 日志文件
PCDs PCD格式 关键帧点云
SCDs SCD格式 关键帧Scan Context描述子
globalMap.pcd PCD格式 全局地图
singlesession_posegraph.g2o g2o格式 全局位姿图
trajectory.pcd PCD格式 xyz位姿轨迹
transformations.pcd PCD格式 xyz+rpy位姿轨迹

We show some simple results:

Now, we give some suggestion to improve this special LIO framework: Firstly, change the point-cloud map management mechanism. You can use the sparse method like hash table similar to Faster-LIO.

Secondly, improve the residual calculation method. The point-to-plane registrition during LiDAR measurement, which utilizes generalized patches instead of actual planes may lead to inconsistencies in registration. You can use true planes modeling by uncertainty.

Thirdly, find a better loop closure descript

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++dynamicslam

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言