目录
安装依赖
我的ROS版本是melodic,所以需要安装以下几个功能包:
sudo apt-get install -y ros-melodic-navigation
sudo apt-get install -y ros-melodic-robot-localization
sudo apt-get install -y ros-melodic-robot-state-publisher
然后安装GTSAM 4.0.2
可以参考https://github.com/borglab/gtsam的安装说明。
编译lio-sam
mkdir catkin_ws
cd ~/catkin_ws/src
git clone https://github.com/TixiaoShan/LIO-SAM.git
cd ..
catkin_make
运行
roslaunch lio_sam run.launch
rosbag play your-bag.bag
遇到的坑
1.运行时报错,error while loading shared libraries: libmetis.so: cannot open shared object file
解决:sudo cp /usr/local/lib/libmetis.so /usr/lib/
2.安装ros-melodic-robot-localization功能包失败
解决:换源,建议换中科大的源,可参考:ROS Melodic 版本安装+将ROS的源设置为国内的源_dckwin的博客-CSDN博客
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'