1,在github上下载ORB-SLAM3.(或者在码云上下载)
git clone https://github.com/UZ-SLAMLab/ORB_SLAM3.git
2,此时可以在ORB-SLAM3文件夹中打开README.md
# 2. Prerequisites
We have tested the library in **Ubuntu 16.04** and **18.04**, but it should be easy to compile in other platforms. A powerful computer (e.g. i7) will ensure real-time performance and provide more stable and accurate results.
.
.
.
.
## Python
Required to calculate the alignment of the trajectory with the ground truth. **Required Numpy module**.
* (win) http://www.python.org/downloads/windows
* (deb) `sudo apt install libpython2.7-dev`
* (mac) preinstalled with osx
在整个的系统的前提条件(#2)中可以看到系统包含的第三方库:Pangolin,OpenCV,Eigen3,Python,DBoW2 and g2o
其中DBoW2 and g2o在系统的Thirdparty中已经存在,所以不需要另外下载,eigen和python已经集成在ubuntu中只需在终端中下载就可以了。此时,需要下载Pangolin和Opencv。
3,编译环境
(1 ) Pangolin:本质上是图形界面,展示系统的运行状态
git clone https://github.com/stevenlovegrove/Pangolin.git
sudo apt install libglew-dev cmake libpython2.7-dev pkg-config libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
cd Pangolin
mkdir build
cd build
cmake ..
make -j4
sudo make install
(2) Opencv的安装可以参考我的上一篇文章
(3) Eigen3是一个矩阵处理库,ORB-SLAM3中要求Eigen的版本在3.1.0以上,在ubuntu16使用apt安装满足条件。
sudo apt-get install libeigen3-dev
(4) python的支持,其中主要是为了ORB-SLAM3中满足数据处理和运行结果展示。
sudo apt install libpython2.7-dev
至此需要安装的第三方库安装完成。
4,编译ORB-SLAM3(非ROS版)
cd ORB_SLAM3
chmod +x build.sh
./build.sh
其中出现错误:在cmakelists.txt文件中报错,找不到eigen 3.1.0 。这是因为在文件的47行处为“find_package(Eigen3 3.1.0 REQUIRED) ”,在ubuntu16上安装的是3.4.9版本,所以不同,在此处可以将3.1.0删除就可以修复错误。之后,编译g2o时也会出现同样的错误,也是采用同样的方式解决问题。
完成后再运行./build.sh。出现错误:error: openssl/md5.h: No such file or directory
解决方法是:
sudo apt-get install libssl-dev
此时重新编译就可以得到编译结果了。