代码:
https://github.com/TixiaoShan/LIO-SAM
针对每个人手头的不同的雷达或者IMU等,只需要在utility.h和params.yaml两个文件中进行主要的修改,在imageProjection.cpp中区分了velodyne和Ouster的雷达,也需要根据实际情况进行部分代码的注释与取消注释。
lidar、IMU:
System architecture:
1. params.yaml
params.yaml文件是对于每个人不同的传感器等修改配置的主要部分。
# Topics
pointCloudTopic: "points_raw" # Point cloud data 点云话题 根据自己的修改
imuTopic: "imu_raw" # IMU data
odomTopic: "odometry/imu" # IMU pre-preintegration odometry, same frequency as IMU
gpsTopic: "odometry/gpsz" # GPS odometry topic from navsat, see module_navsat.launch file
# Frames 坐标系这块根据自己发的改 大部分可以默认用这个配置
lidarFrame: "base_link"
baselinkFrame: "base_link"
odometryFrame: "odom"
mapFrame: "map"
# GPS Settings
# LIO-SAM里将GPS作为一种非必要的约束 想用这个进行优化前确认信号状态足够好
useImuHeadingInitialization: true # if using GPS data, set to "true"
useGpsElevation: false # if GPS elevation is bad, set to "false"
#算法判读是否加入GPS Factor的条件就是对协方差矩阵与阈值的对比 如果GPS信号好可以改下阈值让GPS多参与进来
gpsCovThreshold: 2.0 # m^2, threshold for using GPS data
poseCovThreshold: 25.0 # m^2, threshold for using GPS data
# Export settings
#保存点云地图 这个比较好用 不用单独开终端
savePCD: false # https://github.com/TixiaoShan/LIO-SAM/issues/3
savePCDDirectory: "/Downloads/LOAM/" # in your home folder, starts and ends with "/". Warning: the code deletes "LOAM" folder then recreates it. See "mapOptimization" for implementation
# Sensor Settings
# 雷达的参数这块很重要 否则影响后续点云处理
# 作者给出的是velo和Ouster的雷达配置
# 其他雷达 需要单独根据雷达的参数改一下配置
# timeField这个参数比较搞 如果不是velo或ouster的雷达可能就没有这个field会有一些问题,这里先默认
N_SCAN: 16 # number of lidar channel (i.e., 16, 32, 64, 128)
Horizon_SCAN: 1800 # lidar horizontal resolution (Velodyne:1800, Ouster:512,1024,2048)
timeField: "time" # point timestamp field, Velodyne - "time", Ouster - "t"
downsampleRate: 1 # default: 1. Downsample your data if too many points. i.e., 16 = 64 / 4, 16 = 16 / 1
# IMU Settings 作者的IMU的参数 如果追求更好的效果 建议用自己的传感器参数代替
imuAccNoise: 3.9939570888238808e-03
imuGyrNoise: 1.5636343949698187e-03
imuAccBiasN