Postgraduate Thesis: fast_lio_sam + dynamic removal (T-GRS 2024) + multi-session mapping (ICRA 2022 Kim) + object-level update + online relocalization (ICRA 202
Postgraduate Thesis: fast_lio_sam + dynamic removal (T-GRS 2024) + multi-session mapping (ICRA 2022 Kim) + object-level update + online relocalization (ICRA 202
cd YOUR_WORKSPACE/src
git clone https://github.com/Yixin-F/better_fastlio2
cd ..
catkin_make…One problem: if you want to use RViz or Gazebo, exit the container and enter again
docker start better-fast-lio2
docker exec -it better-fast-lio2 /bin/bashIn 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.
source ./devel/setup.bash
roslaunch fast_lio_sam mapping_*.launchFor 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.
| Function Name | 中文解释 |
|---|---|
| mergeClusters | 聚类覆盖 |
| findVoxelNeighbors | 搜索近邻体素 |
| cluster | 聚类主函数 |
| getBoundingBoxOfCloud | 获取聚类物体boundingbox |
| getCloudByVec | 使用vector提取点云 |
| recognizePD | 识别潜在动态物体主函数 |
| trackPD | 跟踪潜在动态物体主函数 |
| saveColorCloud | 按照聚类类别保存彩色点云 |
| 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
No open issues yet, or sync has not completed.