【M-LOAM学习】

M-LOAM(INITIALIZATION)

Article Analysis

  1. Scan-Based Motion Estimation

通过在consecutive frame (each LiDAR)(因为omp parallel)中寻找correspondences然后通过最小化所有考虑feature之间residual error的transformation between frame to frame
针对于一个LASER在Kframe的相邻两次scan,分别考虑planar feature 以及 corner feature
planar feature
请添加图片描述
其点到平面的距离公式通过点的坐标和法向量表示为:
在这里插入图片描述
具体分析如下:
请添加图片描述
最终构建的edge residual 如下:

请添加图片描述
请添加图片描述
M-LOAM在initialization的outstanding feature为:提供了状态的额外约束,同时残差表示为向量,能够✖协方差阵
最终的函数构造为:
请添加图片描述
在获取增量运动的点云后,选择使用将点转换到最后一帧数据来对点云进行畸变校正,也就是在[tk-1,tk]获得的增量点云数据,如果进行畸变校正 需要转移到tk-1时刻进行畸变校正,这也就需要从current time到tk-1time的rotation matrix 以及translation 这里针对于[tk-1,tk],采用线性插值插值处于该时段每个时刻出现的ti

在这里插入图片描述

  1. Calibration of Multi-LiDAR System
    初始化外部参数通过对齐两个传感器的运动序列进行外参初始化
    在外参校准的过程中使用手眼标定方法手眼标定
    手眼标定选择两部法实现 这里(tlib与Rlib是待求的)请添加图片描述
  2. 旋转初始化(Rotation Initialization):
    通过运用quaternion四元数重写上式。转成线性方程是为了更好的实现多个时间段四元数线性叠加的过程
    (需要足够的运动激励)这里如果运动约束充分 那么对应的3-DoF的rotation是可观测的,那么对应的Qk的0空间对应的秩为1,因为3DoF可以观测 所以 对应的能观性矩阵的秩数为3(如果存在多轴退化的情况 那么导致多个维度的运动信息不可观测 那么就会出现Qk秩大于1的情况(多维度不可观测))
    零空间对应着维度的不可观测性
    运动退化 导致维度不可观测
    请添加图片描述
    多轴的位姿退化 使得Qk的零空间代表的不可观测性维度增加,导致Qk的秩大于1
  3. 平移初始化(Translation Initialization):
    通过rotational calibration校正完成,根据手眼标定基于已经标定的旋转矩阵来标定平移变量(translation)。本文中因为仅仅考虑二维平面 所以 在z方向的平移tz不可观测(在后续精化标定中涉及)

INITIALIZATION代码分析

初始化步骤的开始:void Estimator::process()
根据在Measurement Processing阶段得到的feature set实现初始化
首先判断if(ESTIMATE_EXTRINSIC == 2)(2 Have no prior about extrinsic parameters. We will initialize and optimize around them)
按照论文中的方式:实现手眼标定实现参数初始化
这里巧妙的运用了**#pragma omp parallel for num_threads(NUM_OF_LASER)通过为每个laser数据处理标定分配多线程独立实现EXTRINSIC初始估计。
请添加图片描述通过函数
trackCloud**实现点云追踪
第一步:提取上一帧经过校正的点云插入到kdtree方便寻找最近邻点

    PointICloudPtr corner_points_last = boost::make_shared<PointICloud>(prev_cloud_feature.find("corner_points_less_sharp")->second);PointICloudPtr surf_points_last = boost::make_shared<PointICloud>(prev_cloud_feature.find("surf_points_less_flat")->second);kdtree_corner_last->setInputCloud(corner_points_last);kdtree_surf_last->setInputCloud(surf_points_last);

第二步:获取当前current time的特征点对应的点云数据

 PointICloudPtr corner_points_sharp = boost::make_shared<PointICloud>(cur_cloud_feature.find("corner_points_sharp")->second);PointICloudPtr surf_points_flat = boost::make_shared<PointICloud>(cur_cloud_feature.find("surf_points_flat")->second);

第三步:通过非线性最小二乘通过最小化planar facto and corner factor实现initial motion estimation (state)(帧到帧的姿态估计)

f_extract_.matchCornerFromScan(kdtree_corner_last, *corner_points_last, *corner_points_sharp, pose_local, corner_scan_features); 

实现基于scan扫描线的corner feature matching
matchCornerFromScan用来从扫描线中匹配角点特征

流程:将corner_points_sharp(current time)的角点特征通过TransformToStart函数,转换到tk-1帧坐标系中,与corner_points_last上一帧经过校正的角点特征存放如kdtree_corner_from_scan中(这里在trackCloud函数里面已经实现了将prev_cloud_feature存放入kdtree_corner_last),然后通过nearestKSearch函数寻找投影点point_sel的最近邻点因为是edge factor 所以最终需要找到两个nearest factor,通过判断** if (min_point_ind2 >= 0) 如果存在两个nearest point 那么存储两个点的系数到coeff**,保存feature(idx_,point_,coeffs_)三类信息。

void FeatureExtract::matchCornerFromScan(const typename pcl::KdTreeFLANN<PointType>::Ptr &kdtree_corner_from_scan,const typename pcl::PointCloud<PointType> &cloud_scan,const typename pcl::PointCloud<PointType> &cloud_data,const Pose &pose_local,std::vector<PointPlaneFeature> &features)
{if (!pcl::traits::has_field<PointType, pcl::fields::intensity>::value){std::cerr << "[FeatureExtract] Point does not have intensity field!" << std::endl;exit(EXIT_FAILURE);}
/*f_extract_.matchCornerFromScan(kdtree_corner_last, *corner_points_last, *corner_points_sharp, pose_local, corner_scan_features); */size_t cloud_size = cloud_data.points.size();/*corner feature size */features.resize(cloud_size);size_t cloud_cnt = 0;PointType point_sel;std::vector<int> point_search_ind;std::vector<float> point_search_sqdis;for (size_t i = 0; i < cloud_data.points.size(); i++){// not consider distortion/*转换到tk-1 frame to search the corrected cloud point*/TransformToStart(cloud_data.points[i], point_sel, pose_local, false, SCAN_PERIOD);/*from last corner set to find the nearest correspondent for the corner projection*/kdtree_corner_from_scan->nearestKSearch(point_sel, 1, point_search_ind, point_search_sqdis);int closest_point_ind = -1, min_point_ind2 = -1;if (point_search_sqdis[0] < DISTANCE_SQ_THRESHOLD)/*通过DISTANCE_SQ_THRESHOLD判断最近邻是否满足距离要求限制*/{closest_point_ind = point_search_ind[0];/*最近扫描点的索引*/int closest_point_scan_id = int(cloud_scan.points[closest_point_ind].intensity);/*找对应的投影点的最近邻点的最近点 形成edge feature*/float min_point_sqdis2 = DISTANCE_SQ_THRESHOLD;// search in the direction of increasing scan linefor (int j = closest_point_ind + 1; j < (int)cloud_scan.points.size(); j++){// if in the same scan line, continueif (int(cloud_scan.points[j].intensity) <= closest_point_scan_id)continue;// if not in nearby scans, end the loopif (int(cloud_scan.points[j].intensity) > (closest_point_scan_id + NEARBY_SCAN))break;float point_sqdis = sqrSum(cloud_scan.points[j].x - point_sel.x,cloud_scan.points[j].y - point_sel.y,cloud_scan.points[j].z - point_sel.z);if (point_sqdis < min_point_sqdis2){// find nearer pointmin_point_sqdis2 = point_sqdis;min_point_ind2 = j;}}// search in the direction of decreasing scan linefor (int j = closest_point_ind - 1; j >= 0; j--){// if in the same scan line, continueif (int(cloud_scan.points[j].intensity) >= closest_point_scan_id)continue;// if not in nearby scans, end the loopif (int(cloud_scan.points[j].intensity) < (closest_point_scan_id - NEARBY_SCAN))break;float point_sqdis = sqrSum(cloud_scan.points[j].x - point_sel.x,cloud_scan.points[j].y - point_sel.y,cloud_scan.points[j].z - point_sel.z);if (point_sqdis < min_point_sqdis2){// find nearer pointmin_point_sqdis2 = point_sqdis;min_point_ind2 = j;}}}if (min_point_ind2 >= 0) // both closest_point_ind and min_point_ind2 is valid{Eigen::Matrix<double, 6, 1> coeff;coeff(0) = cloud_scan.points[closest_point_ind].x,coeff(1) = cloud_scan.points[closest_point_ind].y,coeff(2) = cloud_scan.points[closest_point_ind].z;coeff(3) = cloud_scan.points[min_point_ind2].x,coeff(4) = cloud_scan.points[min_point_ind2].y,coeff(5) = cloud_scan.points[min_point_ind2].z;PointPlaneFeature feature;feature.idx_ = i;feature.point_ = Eigen::Vector3d{cloud_data.points[i].x, cloud_data.points[i].y, cloud_data.points[i].z};feature.coeffs_ = coeff;/*corner feature 对应的corner correspondent point {x,y,z}*/features[cloud_cnt] = feature;cloud_cnt++;}}features.resize(cloud_cnt);
}

通过**f_extract_.matchSurfFromScan(kdtree_surf_last, *surf_points_last, *surf_points_flat, pose_local, surf_scan_features);**提取面特征(surf feature from scan)

void FeatureExtract::matchSurfFromScan(const typename pcl::KdTreeFLANN<PointType>::Ptr &kdtree_surf_from_scan,const typename pcl::PointCloud<PointType> &cloud_scan,const typename pcl::PointCloud<PointType> &cloud_data,const Pose &pose_local,std::vector<PointPlaneFeature> &features)
{if (!pcl::traits::has_field<PointType, pcl::fields::intensity>::value){std::cerr << "[FeatureExtract] Point does not have intensity field!" << std::endl;exit(EXIT_FAILURE);}features.clear();PointType point_sel;std::vector<int> point_search_ind;std::vector<float> point_search_sqdis;for (size_t i = 0; i < cloud_data.points.size(); i++){// not consider distortion/*线投影到初始坐标系*/TransformToStart(cloud_data.points[i], point_sel, pose_local, false, SCAN_PERIOD);/*然后通过最近邻搜索具有corner feature 最近邻的cloud point*/kdtree_surf_from_scan->nearestKSearch(point_sel, 1, point_search_ind, point_search_sqdis);/*因为是surf point 所以选择3个不共线的点 作为 平面点来分析*//*规定 min_point_ind3 在相邻的扫描线上 而min_point_ind2 与closest_point_ind要么在同扫描线要么在相邻扫描线上*/int closest_point_ind = -1, min_point_ind2 = -1, min_point_ind3 = -1;if (point_search_sqdis[0] < DISTANCE_SQ_THRESHOLD){closest_point_ind = point_search_ind[0];/*最近点的id*/// get closest point's scan IDint closest_point_scan_id = int(cloud_scan.points[closest_point_ind].intensity);float min_point_sqdis2 = DISTANCE_SQ_THRESHOLD, min_point_sqdis3 = DISTANCE_SQ_THRESHOLD;
#pragma region 在最近点的扫描线增加以及减少的方向上搜索该closest_point_ind的相邻点// search in the direction of increasing scan linefor (int j = closest_point_ind + 1; j < (int)cloud_scan.points.size(); j++){// if not in nearby scans, end the loopif (int(cloud_scan.points[j].intensity) > (closest_point_scan_id + NEARBY_SCAN))break;float point_sqdis = sqrSum(cloud_scan.points[j].x - point_sel.x,cloud_scan.points[j].y - point_sel.y,cloud_scan.points[j].z - point_sel.z);// if in the same or lower scan lineif (int(cloud_scan.points[j].intensity) <= closest_point_scan_id && point_sqdis < min_point_sqdis2){min_point_sqdis2 = point_sqdis;min_point_ind2 = j;}// if in the higher scan lineelse if (int(cloud_scan.points[j].intensity) > closest_point_scan_id && point_sqdis < min_point_sqdis3){min_point_sqdis3 = point_sqdis;min_point_ind3 = j;}}// search in the direction of decreasing scan linefor (int j = closest_point_ind - 1; j >= 0; j--){// if not in nearby scans, end the loopif (int(cloud_scan.points[j].intensity) < (closest_point_scan_id - NEARBY_SCAN))break;float point_sqdis = sqrSum(cloud_scan.points[j].x - point_sel.x,cloud_scan.points[j].y - point_sel.y,cloud_scan.points[j].z - point_sel.z);// if in the same or higher scan lineif (int(cloud_scan.points[j].intensity) >= closest_point_scan_id && point_sqdis < min_point_sqdis2){min_point_sqdis2 = point_sqdis;min_point_ind2 = j;}else if (int(cloud_scan.points[j].intensity) < closest_point_scan_id && point_sqdis < min_point_sqdis3){// find nearer pointmin_point_sqdis3 = point_sqdis;min_point_ind3 = j;}}
#pragma endregionif (min_point_ind2 >= 0 && min_point_ind3 >= 0){Eigen::Vector3f last_point_j(cloud_scan.points[closest_point_ind].x,cloud_scan.points[closest_point_ind].y,cloud_scan.points[closest_point_ind].z);Eigen::Vector3f last_point_l(cloud_scan.points[min_point_ind2].x,cloud_scan.points[min_point_ind2].y,cloud_scan.points[min_point_ind2].z);Eigen::Vector3f last_point_m(cloud_scan.points[min_point_ind3].x,cloud_scan.points[min_point_ind3].y,cloud_scan.points[min_point_ind3].z);Eigen::Vector3f w = (last_point_j - last_point_l).cross(last_point_j - last_point_m);/*平面的法向量*/w.normalize();/*法向量变成单位向量*/float negative_OA_dot_norm = -w.dot(last_point_j);/*D的normalize值*/float pd2 = -(w.x() * point_sel.x + w.y() * point_sel.y + w.z() * point_sel.z + negative_OA_dot_norm); // distance float s = 1 - 0.9f * fabs(pd2) / sqrt(sqrSum(point_sel.x, point_sel.y, point_sel.z));Eigen::Vector4d coeff(w.x(), w.y(), w.z(), negative_OA_dot_norm);PointPlaneFeature feature;feature.idx_ = i;feature.point_ = Eigen::Vector3d{cloud_data.points[i].x, cloud_data.points[i].y, cloud_data.points[i].z};feature.coeffs_ = coeff;feature.type_ = 's';features.push_back(feature);}}}
}

判断线特征以及面特征的数量总和是否满足大于10个特征数量
如果特征数量总和大于10 那么 通过LidarScanPlaneNormFactor创建plane feature
通过LidarScanEdgeFactorVector创建corner_scan_features的corner feature
请添加图片描述
对于planefeature的AddResidualBlock其通过重载Ealuate实现(自己实现计算jacobians矩阵)

    bool Evaluate(double const *const *param, double *residuals, double **jacobians) const{Eigen::Quaterniond q_last_curr(param[0][6], param[0][3], param[0][4], param[0][5]);Eigen::Vector3d t_last_curr(param[0][0], param[0][1], param[0][2]);/*插值*/q_last_curr = Eigen::Quaterniond::Identity().slerp(s_, q_last_curr);/*四元数相对姿态的球面插值*/t_last_curr = s_ * t_last_curr;/*在matchCornerFromScan中计算的feature向量*/Eigen::Vector3d w(coeff_(0), coeff_(1), coeff_(2));double d = coeff_(3);double a = w.dot(q_last_curr * point_ + t_last_curr) + d;/*对应点到面的距离*/residuals[0] = a;/*残差*/if (jacobians){Eigen::Matrix3d R = q_last_curr.toRotationMatrix();if (jacobians[0]){Eigen::Map<Eigen::Matrix<double, 1, 7, Eigen::RowMajor>> jacobian_pose(jacobians[0]);Eigen::Matrix<double, 1, 6> jaco; // [dy/dt, dy/dR, 1]jaco.setZero();jaco.leftCols<3>() = w.transpose();jaco.rightCols<3>() = -w.transpose() * R * Utility::skewSymmetric(point_);jacobian_pose.setZero();jacobian_pose.leftCols<6>() = jaco;}}return true;}

对于EdgeFactor加入重载evaluate构建残差 最终 在论文中明确了edge residual 不再充当scalars标量 而是represented as a vector 能够allowing us to multiply a 3*3 covariance matrix 但是貌似代码中并没有类似的实例列举??

    bool Evaluate(double const *const *param, double *residuals, double **jacobians) const{/*set q_last_curr and t_last_curr as the states*/Eigen::Quaterniond q_last_curr(param[0][6], param[0][3], param[0][4], param[0][5]);Eigen::Vector3d t_last_curr(param[0][0], param[0][1], param[0][2]);/*数据插值*/q_last_curr = Eigen::Quaterniond::Identity().slerp(s_, q_last_curr);t_last_curr = s_ * t_last_curr;/*last point a and last point b and last point (projection to the tk-1)*/Eigen::Vector3d lpa(coeff_(0), coeff_(1), coeff_(2));Eigen::Vector3d lpb(coeff_(3), coeff_(4), coeff_(5));Eigen::Vector3d lp = q_last_curr * point_ + t_last_curr;Eigen::Vector3d nu = (lp - lpa).cross(lp - lpb);/*四边形面积*/Eigen::Vector3d de = lpa - lpb;/*四边形底边长*/residuals[0] = nu.x() / de.norm();/*高对应的向量(距离的投影)*/residuals[1] = nu.y() / de.norm();residuals[2] = nu.z() / de.norm();/*edge residual represented as vectors allowing us to multiply a 3*3 covariance matrix*/// residuals[0] = nu.norm / de.norm();if (jacobians){Eigen::Matrix3d R = q_last_curr.toRotationMatrix();if (jacobians[0]){Eigen::Map<Eigen::Matrix<double, 3, 7, Eigen::RowMajor>> jacobian_pose(jacobians[0]);Eigen::Matrix<double, 3, 6> jaco; // [dy/dt, dy/dq, 1]double  eta = 1.0 / de.norm();jaco.leftCols<3>() = -eta * Utility::skewSymmetric(lpa - lpb);jaco.rightCols<3>() = eta * Utility::skewSymmetric(lpa - lpb) * R * Utility::skewSymmetric(point_);jacobian_pose.setZero();jacobian_pose.leftCols<6>() = jaco;}}return true;}

**摄制完成相应的edge factor 以及 surf factor后 执行optimization **

       // step 3: optimizationTicToc t_solver;ceres::Solver::Options options;options.linear_solver_type = ceres::DENSE_SCHUR;options.max_num_iterations = 4;// options.max_solver_time_in_seconds = 0.005;options.minimizer_progress_to_stdout = false;// options.check_gradients = false;// options.gradient_check_relative_precision = 1e-4;ceres::Solver::Summary summary;ceres::Solve(options, &problem, &summary);// std::cout << summary.BriefReport() << std::endl;// std::cout << summary.FullReport() << std::endl;// printf("solver time %f ms \n", t_solver.toc());

至此:pose_laser_cur_对于帧与帧之间的特征匹配优化实现完成
然后通过pose_prev_cur获取优化后的位姿 然后返回帧与帧之间匹配的优化位姿
(达到当前增量位姿优化更新的目的)更新的是增量位姿

 Pose pose_prev_cur(Eigen::Quaterniond(para_pose[6], para_pose[3], para_pose[4], para_pose[5]), Eigen::Vector3d(para_pose[0], para_pose[1], para_pose[2]));return pose_prev_cur;

通过pose_laser_cur_将IDX_REF;主雷达的quaternion以及 transformation的优化增量姿态传递给Qs_与Ts_
经过帧与帧之间的特征匹配实现的增量位姿优化

    Qs_[cir_buf_cnt_] = pose_laser_cur_[IDX_REF].q_;Ts_[cir_buf_cnt_] = pose_laser_cur_[IDX_REF].t_;Header_[cir_buf_cnt_].stamp = ros::Time(cur_feature_.first);

针对于当前帧的特征 实现体素滤波器对滤波进行降采样

for (size_t n = 0; n < NUM_OF_LASER; n++){/*针对于corner point feature 实现down size 降采样 */PointICloud &corner_points = cur_feature_.second[n]["corner_points_less_sharp"];down_size_filter_corner_.setInputCloud(boost::make_shared<PointICloud>(corner_points));down_size_filter_corner_.filter(corner_points_stack_[n][cir_buf_cnt_]);corner_points_stack_size_[n][cir_buf_cnt_] = corner_points_stack_[n][cir_buf_cnt_].size();/*第N个雷达点云的corner point size */
/*同理 对surf point 面点实现降采样*/PointICloud &surf_points = cur_feature_.second[n]["surf_points_less_flat"];/*surf feature*/down_size_filter_surf_.setInputCloud(boost::make_shared<PointICloud>(surf_points));/*input cloud feature*/down_size_filter_surf_.filter(surf_points_stack_[n][cir_buf_cnt_]);/*down size filter 降采样*/surf_points_stack_size_[n][cir_buf_cnt_] = surf_points_stack_[n][cir_buf_cnt_].size();/**/}

因为需要自动标定外参 所以 solver_flag_一直设置为初始化 执行case:INITIAL,通过slideWindow()函数不断的将基于帧与帧之间的优化位姿 通过滑动窗口 实现数据存入

case INITIAL:/*set initial*/{printf("[INITIAL]\n");/*将Q T surf_point corner_point push into the */slideWindow();/*是不是实现了两次连续的插入first*/if (cir_buf_cnt_ < WINDOW_SIZE){cir_buf_cnt_++;if (cir_buf_cnt_ == WINDOW_SIZE){slideWindow(); /*等到窗口尺寸的时候 仍然进行一次滑动窗口 将第一个重复的数据进行剔除*/}}

然后根据雷达的数量执行针对于当前优化位姿的特征点信息降采样,然后通过判断solver_flag_实现对于当前帧对应的特征数据 作为下一个帧的特征数据的输入实现插入,请添加图片描述通过滑动窗口,存入corner feature ,surf feature 以及Qs_和Ts_的增量优化位姿后 在对帧到帧匹配用到的弱面点以及弱角点信息进行存储这些信息来自于未被降采样的cur_feature_数据存储器

    prev_time_ = cur_time_;prev_feature_.first = prev_time_;prev_feature_.second.clear();prev_feature_.second.resize(NUM_OF_LASER);for (size_t n = 0; n < NUM_OF_LASER; n++){prev_feature_.second[n].insert(make_pair("corner_points_less_sharp", cur_feature_.second[n].find("corner_points_less_sharp")->second));prev_feature_.second[n].insert(make_pair("surf_points_less_flat", cur_feature_.second[n].find("surf_points_less_flat")->second));}

对于经过一系列运动后==cloud point已经存在由于LiDAR旋转切片扫描而引入的运动畸变,对应的处理策略是:在解算完成增量运动信息后,我们将这些cloud point 信息transforming into the last frame 然后进行correct **
请添加图片描述
这里实现为:
首先通过
pose_laser_cur存储获取当前的rotation quaternion以及trasformation information 然后pose_undist用来存储经过帧与帧之间的优化位姿匹配得到的增量位姿信息**
通过pose_undist[IDX_REF] = pose_laser_prev_.inverse() * pose_laser_cur;将增量位姿从body对应的坐标系转换到主雷达对应的laser坐标系,下面的for 循环同样实现将每个雷达测量得到的incremental motion信息转换到主雷达对应的坐标系中的增量 然后到主雷达坐标系中的投影==,最后通过**undistortMeasurements(pose_undist);将当前帧对应的cloud point 点云信息 transform成为[tk-1,tk]对应的last (start time tk-1)**最终实现畸变校正

/*如果存在运动畸变*/if (DISTORTION){/*对应当前点的位姿*/Pose pose_laser_cur = Pose(Qs_[cir_buf_cnt_ - 1], Ts_[cir_buf_cnt_ - 1]);/*当前的pose*/std::vector<Pose> pose_undist = pose_rlt_;/*pose_rlt_存储优化后的增量雷达信息*/pose_undist[IDX_REF] = pose_laser_prev_.inverse() * pose_laser_cur;for (size_t n = 0; n < NUM_OF_LASER; n++){/*body 2 laser frame*/Pose pose_ext(qbl_[n], tbl_[n]);/*pose extrinsic parameter*//*pose_ext.inverse() -> laser 2 body frame* pose_rlt_ in body frame* pose_ext -> body 2 laser frame* finally :pose_undist is in laser frame* */pose_undist[n] = pose_ext.inverse() * pose_rlt_[IDX_REF] * pose_ext;/*转变为在雷达坐标系表示的运动增量(incremental motion)在laser 坐标系的投影(in laser projection)*/}undistortMeasurements(pose_undist);pose_laser_prev_ = pose_laser_cur;}

请添加图片描述
请添加图片描述首先在每次执行完成motion estimation and obtain the optimized incremental motion information基于帧到帧的匹配后通过initial_extrinsics_.addPose(pose_rlt_) 向initial_extrinsics_中增加外部运动信息 直到满足所需要的足够的运动movement后 执行calibrating extrinsic param
执行的
addPose函数 主要是:通过调用checkScrewMotion函数检查主雷达与辅雷达之间运动存在的点云运动畸变,返回满足小于rotation 以及 transformation 畸变阈值的优化pose state通过pq_pose_.push()将满足条件的增量pose state 数据 存储到pq_pose_中

这里设置有一个小技巧:pq_pose_.size()来代表插入的满足条件的增量点云pose_laser的索引
请添加图片描述请添加图片描述

同样,只有在满足if (initial_extrinsics_.addPose(pose_rlt_) && (cir_buf_cnt_ == WINDOW_SIZE))的时候,这保证了在具有sufficient optimized relative movement 实现 calibrating extrinsic parameter
下面对于达到sufficient movement后进行calibrating extrinsic param(外参校正基于手眼标定,对应Artical Analysis的第二部分 2. Calibration of Multi-LiDAR System)
针对于每一个辅助雷达基于手眼标定进行外部参数标定 返回标定结果到calib_result
并输出标定后的外参矩阵QBL[n] = calib_result.q_; TBL[n] = calib_result.t_;

                for (size_t n = 0; n < NUM_OF_LASER; n++){if (initial_extrinsics_.cov_rot_state_[n]) continue;Pose calib_result;/*calibrate the rotation*/if (initial_extrinsics_.calibExRotation(IDX_REF, n, calib_result)){/*calibrate the translation*/if (initial_extrinsics_.calibExTranslation(IDX_REF, n, calib_result)){/*输出多个传感器雷达校正完成后的初始参数(initial extrinsic of laser)* 其中包括* quaternion body to laser* translation body to laser** */std::cout << common::YELLOW << "Initial extrinsic of laser_" << n << ": " << calib_result << common::RESET << std::endl;qbl_[n] = calib_result.q_;tbl_[n] = calib_result.t_;// tdbl_[n] = calib_result.td_;QBL[n] = calib_result.q_;TBL[n] = calib_result.t_;// TDBL[n] = calib_result.td_;}}}

最后判断是否所有的雷达全部完成了rotation以及translation的外参估计 如果全部完成 那么
最终将ESTIMATE_EXTRINSIC改成1

if ((initial_extrinsics_.full_cov_rot_state_) && (initial_extrinsics_.full_cov_pos_state_)){std::cout << common::YELLOW << "All initial extrinsic rotation calib success" << common::RESET << std::endl;ESTIMATE_EXTRINSIC = 1;initial_extrinsics_.saveStatistics();}

**注意在基于corner feature 构建MLE问题的时候 涉及了CHECK_JACOBIAN **
反对称矩阵
向量求导
向量求导

请添加图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/147389.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

(done) 声音信号处理基础知识(7) (Understanding Time Domain Audio Features)

参考&#xff1a;https://www.youtube.com/watch?vSRrQ_v-OOSg&t1s 时域特征包括&#xff1a; 1.幅度包络 2.均方根能量 3.过零率 振幅包络的定义&#xff1a;一个 frame 里&#xff0c;所有采样点中最大的振幅值 一个形象的关于振幅包络的可视化解释如下&#xff1a;…

MateBook 16s 2023在Deepin下开启性能模式,调节风扇转速到最大,全网首发!

方法 在Deepin下按住Fnp快捷键&#xff0c;开启性能模式。 验证 首先去debian下载acpi-call-dkms https://packages.debian.org/sid/all/acpi-call-dkms/download 然后使用root用户执行&#xff1a; apt install --simulate ./acpi-call-dkms_1.2.2-2.1_all.deb apt inst…

C++入门——(类的默认成员函数)析构函数

文章目录 一、析构函数二、析构函数的特点总结 一、析构函数 析构函数与构造函数功能相反&#xff0c;析构函数不是完成对对象本⾝的销毁&#xff0c;⽐如局部对象是存在栈帧的&#xff0c;函数结束栈帧销毁&#xff0c;他就释放了&#xff0c;不需要我们管&#xff0c;C规定对…

【ChatGPT】提示词助力广告文案、PPT制作与书籍推荐的高效新模式

博客主页&#xff1a; [小ᶻZ࿆] 本文专栏: AIGC | ChatGPT 文章目录 &#x1f4af;前言&#x1f4af;高效广告推销文案提示词使用方法 &#x1f4af;AI自动生成PPT全流程提示词使用方法 &#x1f4af;精选书籍推荐爆款文案提示词使用方法 &#x1f4af;小结 &#x1f4af;…

第一个NDK项目

新建项目 选择Native C的项目&#xff0c;我这里给项目的命名是NDKTest。 目录分析 新增了一个cpp目录&#xff0c;里面有一个CMakeLists和.cpp文件。 CMakeLists 文件是用来配置C编译过程的。 # Sets the minimum CMake version required for this project. cmake_minimum_…

【解密 Kotlin 扩展函数】命名参数和默认值(十三)

导读大纲 1.0.1 命名参数1.0.2 默认参数值 上一节讲述如何自定义 joinToString 函数来代替集合的默认字符串表示 文末遗留下几个待优化问题–传送门 1.0.1 命名参数 我们要解决的第一个问题涉及函数调用的可读性 例如,请看下面的joinToString调用: joinToString(collection,&…

循环中用sleep

echo <pre>;for ($i0;$i<10000000;$i){var_dump($i);} 没有用sleep,快速消耗cpu和内存 使用sleep后效果 echo <pre>;for ($i0;$i<10000000;$i){var_dump($i);usleep(1000);//php 暂停0.001秒} 总结&#xff1a;sleep能释放资源(cpu和内存)&#xff0c;但是运…

2025校招内推-招联金融

【投递方式】 直接扫下方二维码&#xff0c;或点击内推官网https://wecruit.hotjob.cn/SU61025e262f9d247b98e0a2c2/mc/position/campus&#xff0c;使用内推码 igcefb 投递&#xff09; 【招聘岗位】 后台开发 前端开发 数据开发 数据运营 算法开发 技术运维 软件测试 产品策…

LeetCode 面试经典150题 191.位1的个数

Java中的算术右移和逻辑右移的区别 题目&#xff1a;编写一个函数&#xff0c;获取一个正整数的二进制形式并返回其二进制表达式中设置位的个数&#xff08;也被称为汉明重量&#xff09;。 设置位的个数即二进制中1的个数。 思路&#xff1a;方法一&#xff1a;因为正数的原…

【永磁同步电机(PMSM)】 4. 同步旋转坐标系仿真模型

【永磁同步电机&#xff08;PMSM&#xff09;】 4. 同步旋转坐标系仿真模型 1. Clarke 变换的模型与仿真1.1 Clarke 变换1.2 Clarke 变换的仿真模型 2. Park 变换的模型与仿真2.1 Park 变换2.2 Park 变换的仿真模型 3. Simscape标准库变换模块3.1 abc to Alpha-Beta-Zero 模块3…

java反射基础知识

1.java的反射机制 Java 反射机制是在运行状态中&#xff0c;对于任意一个类&#xff0c;都能够知道这个类的所有属性和方法&#xff1b;对于任意一个对象&#xff0c;都能够调用它的任意方法和属性&#xff1b;这种动态获取信息以及动态调用对象方法的功能称为 Java 语言的反射…

学生管理系统1.0版本

学生管理系统1.0版本有5个功能&#xff0c;即添加学生、删除学生、修改学生、查看全部学生、退出系统。 里面对添加重复学号、删除和修改不存在的学号等问题都有相应的解决办法。 代码区&#xff1a; Student.java package student;//快捷键Altinsert public class Student …

Machine Learning Specialization 学习笔记(4)

文章目录 前言一、模型评估训练集常规训练集线性回归逻辑回归 交叉验证集 偏差与方差正则化 学习曲线数据集的添加&#xff08;数据增强&#xff09;迁移学习精确率与召回率 二、决策树基本概念决策树的工作原理决策树的优点决策树的缺点决策树算法的变体决策树在Python中的实现…

Shell 脚本学习

Shell学习 Shell 脚本 Shell 是一个用 C 语言编写的程序&#xff0c;它是用户使用 Linux 的桥梁。Shell 既是一种命令语言&#xff0c;又是一种程序设计语言。 Shell 是指一种应用程序&#xff0c;这个应用程序提供了一个界面&#xff0c;用户通过这个界面访问操作系统内核的服…

xxl-job使用总结

xxl-job从入门到入土 xxl-job介绍 xxl-job是一个分布式任务调度平台&#xff0c;其核心设计目标是开发迅速、学习简单、轻量级、易扩展。xxl-job支持调度中心集群和执行器集群。 xxl-job开源项目 xxl-job使用 xxl-job整合SpringBoot 引入xxl-job的依赖 <dependency>…

ArcGIS核密度分析(栅格处理范围与掩膜分析)

多时候我们在进行栅格分析的时候&#xff0c;处理的结果不能完全覆盖我们需要的范围。 比如&#xff0c;我们对点数据进行密度分析、栅格插值等。比如下图 为什么会如此呢&#xff1f; 那是因为在做这个密度分析或者栅格插值的时候&#xff0c;默认是以点的四至范围来生成的&am…

LeetCode 热题 100 回顾9

干货分享&#xff0c;感谢您的阅读&#xff01;原文见&#xff1a;LeetCode 热题 100 回顾_力code热题100-CSDN博客 一、哈希部分 1.两数之和 &#xff08;简单&#xff09; 题目描述 给定一个整数数组 nums 和一个整数目标值 target&#xff0c;请你在该数组中找出 和为目标…

算法之逻辑斯蒂回归(Logistic regression)

简介&#xff1a;个人学习分享&#xff0c;如有错误&#xff0c;欢迎批评指正。 逻辑斯蒂回归&#xff08;Logistic Regression&#xff09;是统计学中一种广泛应用于二分类问题的算法。它的主要目标是预测二分类问题中的事件发生的概率。尽管名字里有“回归”&#xff0c;但逻…

2024已然过半,AI技术卷到哪儿了?

可以说&#xff0c;科技的发展真的是日新月异&#xff0c;2024年年初&#xff0c;大模型Sora的出现&#xff0c;改变了短视频行业的演变方向&#xff0c;使得AI技术不再只是停留在文生文&#xff0c;文生图阶段&#xff0c;而是发展到了文生视频领域。2024年5月&#xff0c;回忆…

Java笔试面试题AI答之设计模式(5)

文章目录 21. 简述Java什么是适配器模式 ?适配器模式的主要组成部分包括&#xff1a;适配器模式的实现方式主要有两种&#xff1a;适配器模式的优点&#xff1a;适配器模式的缺点&#xff1a;示例说明&#xff1a; 22. 请用Java代码实现适配器模式的案例 &#xff1f; 21. 简述…