文章目录
前言
ORB-SLAM3直接按照官网的教程进行编译会有一些错误报出,在此总结编译orb-slam3的整体流程以及中间遇到的一些问题。
编译环境
Ubuntu 18.04 LTS
OpenCV 3.4.5(之前是3.2.0但有问题,重装新的版本)
Pangolin
OpenGL
Glew
Eigen3
DBoW2 and g2o
配置环境
1. C++11
检查G++版本,查看是否支持C++11
一般g++版本大于4.7即可
g++ -v
2. Pangolon
地址:https://github.com/stevenlovegrove/Pangolin
先安装OpenGL,Glew
### 编译orb-slam3发现pangolin编译错误排查的环境问题
sudo apt install pkg-config
sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
sudo apt-get install doxygen
######################################################
sudo apt install libgl1-mesa-dev
sudo apt install libglew-dev
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ..
cmake --build . --target pangolin_doc
sudo make install
3.Eigen3
需要最少3.1.0
Eigen是用于线性代数的C ++模板库:矩阵,向量,数值解算器和相关算法。这里使用命令行安装。
sudo apt install libeigen3-dev
//若默认安装的是/usr/local/include/eigen3/Eigen 下,将Eigen文件夹拷贝一份到/usr/local/include 下
sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include
4.DBoW2 and g2o
虽然orb-slam3项目中自带,但还是先源码编译了一遍,对后面的编译五影响。
- 下载编译 DBoW2
git clone https://github.com/dorian3d/DBoW2.git DBoW2
cd DBoW2
mkdir build
cd build
cmake ..
make
sudo make install
- 下载编译 g2o
git clone https://github.com/RainerKuemmerle/g2o.git g2o
cd g2o
mkdir build
cd build
cmake