fast lio 运行mid360采集的数据,并保存每一帧的点云PCD和位姿

首先我们看到在map_incremental中存在一个保存每一帧PCD文件的代码,因此想利用改代码。

如何修改呢?

一. 改每一帧无畸变点云的PCD的保存代码

    /**************** save map ****************/
    /* 1. make sure you have enough memories
    /* 2. noted that pcd save will influence the real-time performences **/
    if (pcd_save_en)
    {
        int size = feats_undistort->points.size();
        PointCloudXYZI::Ptr laserCloudWorld( \
                        new PointCloudXYZI(size, 1));

        for (int i = 0; i < size; i++)
        {
            // 原来的程序,直接变换到世界坐标系下
            //RGBpointBodyToWorld(&feats_undistort->points[i], \
             //                   &laserCloudWorld->points[i]);

            // 现在改的程序,直接变换到世界坐标系下
            RGBpointBodyLidarToIMU(&feats_undistort->points[i], \
                               &laserCloudWorld->points[i]);
        }
        *pcl_wait_save += *laserCloudWorld;

        static int scan_wait_num = 0;
        scan_wait_num ++;
        i