kimera-vio-ros编译记录

非常重要!!!使用Eigen3.3.7以上版本,我用的是3.3.9,能解决很多问题

我的系统是ubuntu18.04.5

https://github.com/MIT-SPARK

编译过程:

一、各种依赖

sudo apt-get install ros-melodic-image-geometry ros-melodic-pcl-ros ros-melodic-cv-bridge

sudo apt-get install -y --no-install-recommends apt-utils

sudo apt-get install -y cmake build-essential unzip pkg-config autoconf libboost-all-dev libjpeg-dev libpng-dev libtiff-dev libvtk6-dev libgtk-3-dev libatlas-base-dev gfortran libparmetis-dev python-wstool python-catkin-tools

sudo apt-get install libtbb-dev

二、配置工作空间,下载文件包

mkdir -p ~/catkin_ws/src

cd ~/catkin_ws/

catkin init

catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release

catkin config --merge-devel

echo 'source ~/catkin_ws/devel/setup.bash' >> ~/.bashrc

cd ~/catkin_ws/src

git clone https://github.com/MIT-SPARK/Kimera-VIO-ROS.git

wstool init

wstool merge Kimera-VIO-ROS/install/kimera_vio_ros_https.rosinstall

wstool update
#这里可能出现网速问题,最好是用ti/zi,如何在终端用ti/zi,请看我的博客
#多输几次,直到全部是done,没有error

三、编译

catkin build
#这里可能会出现很多问题,在下面已经列好了,可以自己找

source ~/catkin_ws/devel/setup.bash

四、运行

下载数据集https://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets

roscore

roslaunch kimera_vio_ros kimera_vio_ros_euroc.launch

rviz -d $(rospack find kimera_vio_ros)/rviz/kimera_vio_euroc.rviz

rosbag play --clock /PATH/TO/EUROC_ROSBAG

kimera-vio-ros编译记录_第1张图片

 

 

1、问题一:compile kimera-vio-ros:Error: GTSAM was built against a different version of Eigen(首先eigen版本不能是3.3.4,其次必须大于3.2.5,推荐3.3.7)

作者回复:

kimera-vio-ros编译记录_第2张图片

我的解决方式:

1、从gtsam的github下载,并切换到kimera-vio中版本,单独编译gtsam,并删除kimera中的gtsam(gtsam和opengv最好不要放到catkin_ws里)

sudo apt-get install libtbb-dev
git clone [email protected]:borglab/gtsam.git
cd gtsam
git checkout 0c3e05f375c03c5ff5218e708db416b38f4113c8
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DGTSAM_USE_SYSTEM_EIGEN=OFF -DGTSAM_POSE3_EXPMAP=ON -DGTSAM_ROT3_EXPMAP=ON ..
make -j4
sudo make install

因为opengv与gtsam的没跟要保持一致,因为我们单独安装了gtsam,所以要更改opengv的安装方式

git clone https://github.com/laurentkneip/opengv.git
cd opengv
mkdir build
cd build
cmake .. -DEIGEN_INCLUDE_DIR=/home/tonirv/Code/gtsam/gtsam/3rdparty/Eigen(切换成自己的路径) -DEIGEN_INCLUDE_DIRS=/home/tonirv/Code/gtsam/gtsam/3rdparty/Eigen(切换成自己的路径)
sudo make install

2、opencv相关问题:首先确认自己的版本大于等于3.3.1

 

3、opencv编译问题

kimera-vio-ros编译记录_第3张图片

切换到相应的文件夹,我的是

即:

cd ~/catkin_ws/build/opencv3_catkin/opencv3_contrib_src/modules/xfeatures2d/src/

下载相应文件:

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_lbgm.i > 0ae0675534aa318d9668f2a179c2a052-boostdesc_lbgm.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_256.i > e6dcfa9f647779eb1ce446a8d759b6ea-boostdesc_binboost_256.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_128.i > 98ea99d399965c03d555cef3ea502a0b-boostdesc_binboost_128.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_064.i > 202e1b3e9fec871b04da31f7f016679f-boostdesc_binboost_064.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_hd.i > 324426a24fa56ad9c5b8e3e0b3e5303e-boostdesc_bgm_hd.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_bi.i > 232c966b13651bd0e46a1497b0852191-boostdesc_bgm_bi.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i > 0ea90e7a8f3f7876d450e4149c97c74f-boostdesc_bgm.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_120.i > 151805e03568c9f490a5e3a872777b75-vgg_generated_120.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_64.i > 7126a5d9a8884ebca5aea5d63d677225-vgg_generated_64.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_48.i > e8d0dcd54d1bcfdc29203d011a797179-vgg_generated_48.i

curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_80.i > 7cd47228edec52b6d82f46511af325c5-vgg_generated_80.i

修改文件名和缺失的文件名对应,一般是删除文件开始的一堆序列号

4、opencv没有那个文件或目录

kimera-vio-ros编译记录_第4张图片

找到两个对应文件,填写缺失文件的全路径

5、internal compiler error: 已杀死 (program cc1plus)

kimera-vio-ros编译记录_第5张图片

 

 

 

 

 

 

你可能感兴趣的:(语义SLAM)