github地址:
https://github.com/TixiaoShan/LVI-SAM
大佬已经在github上列出了详细的步骤了,但在我电脑上还有几处报错,那么在此提供给大家:
本机ros版本kinetic
安装gtsam
wget -O ~/Downloads/gtsam.zip https://github.com/borglab/gtsam/archive/4.0.2.zip
cd ~/Downloads/ && unzip gtsam.zip -d ~/Downloads/
cd ~/Downloads/gtsam-4.0.2/
mkdir build && cd build
cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ..
sudo make install -j4
安装Ceres
sudo apt-get install -y libgoogle-glog-dev
sudo apt-get install -y libatlas-base-dev
wget -O ~/Downloads/ceres.zip https://github.com/ceres-solver/ceres-solver/archive/1.14.0.zip
cd ~/Downloads/ && unzip ceres.zip -d ~/Downloads/
cd ~/Downloads/ceres-solver-1.14.0
mkdir ceres-bin && cd ceres-bin
cmake ..
sudo make install -j4
下载编译源码
cd ~/catkin_ws/src
git clone https://github.com/TixiaoShan/LVI-SAM.git
cd ..
catkin_make
在我编译的时候报错了,错误如下:
/usr/local/include/gtsam/base/Vector.h:72:1: error: static assertion failed: Error: GTSAM was built against a different version of Eigen
static_assert(
解决方法:
打开/Downloads/gtsam-4.0.2/CMakeLists.txt文件:在300行左右的if前面加上这样一行:
set(GTSAM_USE_SYSTEM_EIGEN ON)
然后编译就应该没有问题了!!
运行launch报错
roslaunch lvi_sam run.launch
这样的话就是缺少依赖了,解决方法如下:
sudo apt-get install ros-kinetic-image-transport
sudo apt-get install ros-kinetic-image-transport-plugins
之后再打开launch我这边就不会报错了!!
但是当我跑bag数据的时候会发现定位出现很大的偏差,目前原因不清楚,只有在/LVI-SAM/launch/include/module_sam.launch中把21行注释了之后会好些,如果各位知道原因也告诉我一下哈:
参考博客:https://blog.csdn.net/moyu123456789/article/details/107058418