1 安装LeGO-LOAM
LeGO-LOAM需要依赖 ROS 环境 和 gtsam
遇到github下载慢的情况,可以从gitee导入仓库下载
1.1安装依赖项
wget wget -O ~/software/gtsam.zip https://github.com/borglab/gtsam/archive/4.0.0-alpha2.zip
cd ~/software && unzip gtsam.zip -d ~/software/
cd ~/software/gtsam-4.0.0-alpha2/
mkdir build && cd build
cmake ..
sudo make install
1.2安装下载编译源码
cd ~/catkin_ws/src
git clone https://github.com/RobustFieldAutonomyLab/LeGO-LOAM.git
cd ..
catkin_make -j1
2 编译报错
***:In function ‘void pcl_conversions::toPCL(const Header&, pcl::PCLHeader&)’:
***:error: cannot bind non-const lvalue reference of type 'uint64_t &{aka long unsigned int&}' to an rvalue of type 'uint64_t {aka long usigned int}'
toPCL(header.stamp,pcl_header.stamp);
2.1解决方法
从github找到相似问题,从下面评论可以得到
安装Point Cloud Library 1.8.1
2.2解决方法(不确定是否正确只是编译通过)
80:const std::uint64_t & pcl_stamp 改为std::uint64_t pcl_stamp
3运行LeGO-LOAM
3.1运行demo
启动LeGO-LOAM
roslaunch lego_loam run.launch
运行参考作者的bag
rosbag play lego-loam-demo-2017-06-08-15-49-45_0.bag --clock --topic /velodyne_points /imu/data
参考网站
参考网站:开源自主导航小车MickX4(八)LeGo-LOAM 室外3D建图
参考网站:https://github.com/ros-perception/perception_pcl/issues/376
参考网站:https://github.com/ros-perception/ar_track_alvar/issues/88