今天在运行LIO-SAM的时候
想着保存PCD地图文件,
但是最后保存的时候终端报错:
terminate called after throwing an instance of 'pcl::IOException'
what(): :[pcl::PCDWriter::writeBinary] Error during open!
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
解决:是保存pcl点云库文件的路径出错。
我打印出saveMapDirectory变量显示:
Save destination:/home/qjf/home/qjf/
slam/laser_SLAM/liosam_ws/output/pcd
可以看到保存地图的路径重复了家目录,
代码中params.yaml文件中保存的路径这样是不对的,所以将savePCDDirectory由
savePCDDirectory: "/home/qjf/slam/laser_SLAM/liosam_ws/output/" # in your home folder, starts and ends with "/". Warning: the code deletes "LOAM" folder then recreates it. See "mapOptimization" for implementation
改为:
savePCDDirectory: "/slam/laser_SLAM/liosam_ws/output/" # in your home folder, starts and ends with "/". Warning: the code deletes "LOAM" folder then recreates it. See "mapOptimization" for implementation
再运行就可以了。