LOAM的开发测试

播放LOAM的数据集时出现坐标系无法输对的情况:

需要把frame_id多加斜杠,即“//”

"Failed to transform from frame [/velodyne] to frame [velodyne]" - ROS Answers: Open Source Q&A Foruml

不管LOAM还是lego loam,rosbag跑数据集一定要加clock,不然rviz没有结果输出,例如:

rosbag play nsh_indoor_outdoor.bag --clock

Lego loam配置

安装gtsam

sudo add-apt-repository ppa:borglab/gtsam-release-4.0
sudo apt update
sudo apt install libgtsam-dev libgtsam-unstable-dev

参考:

GitHub - TixiaoShan/LIO-SAM: LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping

通过命令行安装的gstam在跑lego loam代码时会出现以下错误:

double free or corruption (out)

通过DEBUG最后查出来代码在

                std::cout << "scan map optimization" << std::endl;
                scan2MapOptimization();

                std::cout << "saveKeyFramesAndFactor" << std::endl;
                saveKeyFramesAndFactor(); //这一行报错

                std::cout << "correctPoses" << std::endl;
                correctPoses();

                std::cout << "final" << std::endl;

                publishTF();
        isam->update(gtSAMgraph, initialEstimate);//这一行报错
        std::cout << "[save]: 44" << std::endl;
        isam->update();

        std::cout << "[save]: 2" << std::endl;
        
        gtSAMgraph.resize(0);
        initialEstimate.clear();

先卸载掉命令行安装的gtsam库

sudo apt autoremove libgtsam-dev libgtsam-unstable-dev

然后下载离线库编译

https://github.com/RobustFieldAutonomyLab/LeGO-LOAM

最后证实也不是这个问题,lio sam的github反馈跟pcl版本相关:

我源码编译pcl 1.10.0,命令行也安装pcl 1.10的版本,可能跟这个有关系,最终证实就是跟装两个pcl有关系。

这个链接记录了编译时遇到的问题:

https://xiaotaoguo.com/p/lego-loam-setup-ubuntu20/
LeGO-LOAM:Ubuntu20.04下的编译与运行_MIKingZCC的博客-CSDN博客

系统安装建议

不要装ubuntu20.04, Ubuntu 20.04只能装ros noetic版本,frame_id需要两个//,太坑。

 lego slam遇到bug:

process[rviz-1]: started with pid [53403]
process[camera_init_to_map-2]: started with pid [53404]
process[base_link_to_camera-3]: started with pid [53405]
process[imageProjection-4]: started with pid [53406]
process[featureAssociation-5]: started with pid [53411]
process[mapOptmization-6]: started with pid [53414]
process[transformFusion-7]: started with pid [53418]
[ INFO] [1652178499.745307477]: ----> Transform Fusion Started.
[ INFO] [1652178499.793706325]: ----> Feature Association Started.
[ INFO] [1652178499.795393705]: ----> Image Projection Started.
[ INFO] [1652178499.809991227]: ----> Map Optimization Started.
double free or corruption (out)
[mapOptmization-6] process has died [pid 53414, exit code -6, cmd /home/zf/ROS_PROJECT/devel/lib/lego_loam/mapOptmization __name:=mapOptmization __log:=/home/zf/.ros/log/91667fca-d045-11ec-be1e-978eca7d9296/mapOptmization-6.log].
log file: /home/zf/.ros/log/91667fca-d045-11ec-be1e-978eca7d9296/mapOptmization-6*.log

你可能感兴趣的:(三维重建,GSLAM,自动驾驶,人工智能,机器学习)