LeGO-LOAM分析之配置(四)

转载地址:https://zhuanlan.zhihu.com/p/386449627
这一章我们主要看下LeGO-LOAM的配置文件,有哪些参数,以及这些参数的作用是什么?

激光雷达配置

激光雷达原始点云topic和imu的输入topic

extern const string pointCloudTopic = "/velodyne_points";
extern const string imuTopic = "/imu/data";

点云保存目录,以及是否采用ring(velodyne支持,其它目前不清楚)

// Save pcd
extern const string fileDirectory = "/tmp/";

// Using velodyne cloud "ring" channel for image projection (other lidar may have different name for this channel, change "PointXYZIR" below)
extern const bool useCloudRing = true; // if true, ang_res_y and ang_bottom are not used

支持的lidar,论文中使用的是velodyne 16线雷达,如果是其它lidar需要适配这些参数。

// VLP-16
extern const int N_SCAN = 16;     //  线数
extern const int Horizon_SCAN = 1800;  // 旋转一周采样次数
extern const float ang_res_x = 0.2;     // 水平分辨率
extern const float ang_res_y = 2.0;     // 垂直分辨率
extern const float ang_bottom = 15.0+0.1;   // lidar 底部线束的角度偏移
extern const int groundScanInd = 7;         // lidar 判定为地面的线数
// HDL-32E
// extern const int N_SCAN = 32;
// extern const int Horizon_SCAN = 1800;
// extern const float ang_res_x = 360.0/float(Horizon_SCAN);
// extern const float ang_res_y = 41.33/float(N_SCAN-1);
// extern const float ang_bottom = 30.67;
// extern const int groundScanInd = 20;

// VLS-128
// extern const int N_SCAN = 128;
// extern const int Horizon_SCAN = 1800;
// extern const float ang_res_x = 0.2;
// extern const float ang_res_y = 0.3;
// extern const float ang_bottom = 25.0;
// extern const int groundScanInd = 10;

// Ouster users may need to uncomment line 159 in imageProjection.cpp
// Usage of Ouster imu data is not fully supported yet (LeGO-LOAM needs 9-DOF IMU), please just publish point cloud data
// Ouster OS1-16
// extern const int N_SCAN = 16;
// extern const int Horizon_SCAN = 1024;
// extern const float ang_res_x = 360.0/float(Horizon_SCAN);
// extern const float ang_res_y = 33.2/float(N_SCAN-1);
// extern const float ang_bottom = 16.6+0.1;
// extern const int groundScanInd = 7;

// Ouster OS1-64
// extern const int N_SCAN = 64;
// extern const int Horizon_SCAN = 1024;
// extern const float ang_res_x = 360.0/float(Horizon_SCAN);
// extern const float ang_res_y = 33.2/float(N_SCAN-1);
// extern const float ang_bottom = 16.6+0.1;
// extern const int groundScanInd = 15;

接下来我们在详细分析下算法相关的参数。

// 是否需要回环检测
extern const bool loopClosureEnableFlag = false;
// 建图时间间隔(周期)
extern const double mappingProcessInterval = 0.3;
// imu扫描频率
extern const float scanPeriod = 0.1;
// 系统延迟
extern const int systemDelay = 0;
// imu缓存大小
extern const int imuQueLength = 200;
// 过滤小于1m之内的点云
extern const float sensorMinimumRange = 1.0;
// ?
extern const float sensorMountAngle = 0.0;
// 点云分割每个方向的角度大小
extern const float segmentTheta = 60.0/180.0*M_PI; // decrese this value may improve accuracy
// 点云分割有效点和有效线的大小
extern const int segmentValidPointNum = 5;
extern const int segmentValidLineNum = 3;
// 水平方向最小分辨率弧度
extern const float segmentAlphaX = ang_res_x / 180.0 * M_PI;
// 垂直方向最小分辨率弧度
extern const float segmentAlphaY = ang_res_y / 180.0 * M_PI;
// 线特征数量
extern const int edgeFeatureNum = 2;
// 面特征数量
extern const int surfFeatureNum = 4;
// 没有使用到的参数
extern const int sectionsTotal = 6;
// 曲率阈值
extern const float edgeThreshold = 0.1;
extern const float surfThreshold = 0.1;
// 特征查找半径
extern const float nearestFeatureSearchSqDist = 25;

// Mapping Params
// 点云地图搜索半径
extern const float surroundingKeyframeSearchRadius = 50.0; // key frame that is within n meters from current pose will be considerd for scan-to-map optimization (when loop closure disabled)
// 点云地图搜索大小
extern const int   surroundingKeyframeSearchNum = 50; // submap size (when loop closure enabled)
// history key frames (history submap for loop closure)
// 回环检测首尾距离
extern const float historyKeyframeSearchRadius = 7.0; // key frame that is within n meters from current pose will be considerd for loop closure
// 回环点云查找范围[-25, 25]
extern const int   historyKeyframeSearchNum = 25; // 2n+1 number of hostory key frames will be fused into a submap for loop closure
// icp匹配分数,平均距离小于0.3
extern const float historyKeyframeFitnessScore = 0.3; // the smaller the better alignment
// 可视化点云范围
extern const float globalMapVisualizationSearchRadius = 500.0; // key frames with in n meters will be visualized

注册新的点云类型

注册新的点云格式到pointcloud,这样就可以使用"pcl::PointCloud"而不会提示类型找不到了。

/*
    * A point cloud type that has "ring" channel
    */
struct PointXYZIR
{
    PCL_ADD_POINT4D
    PCL_ADD_INTENSITY;
    uint16_t ring;
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
} EIGEN_ALIGN16;

POINT_CLOUD_REGISTER_POINT_STRUCT (PointXYZIR,  
                                   (float, x, x) (float, y, y)
                                   (float, z, z) (float, intensity, intensity)
                                   (uint16_t, ring, ring)
)

/*
    * A point cloud type that has 6D pose info ([x,y,z,roll,pitch,yaw] intensity is time stamp)
    */
struct PointXYZIRPYT
{
    PCL_ADD_POINT4D
    PCL_ADD_INTENSITY;
    float roll;
    float pitch;
    float yaw;
    double time;
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
} EIGEN_ALIGN16;

POINT_CLOUD_REGISTER_POINT_STRUCT (PointXYZIRPYT,
                                   (float, x, x) (float, y, y)
                                   (float, z, z) (float, intensity, intensity)
                                   (float, roll, roll) (float, pitch, pitch) (float, yaw, yaw)
                                   (double, time, time)
)

typedef PointXYZIRPYT  PointTypePose;

总结

LeGO-loam主要是要关注lidar的参数,以及换成其它品牌lidar之后的适配。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值