共计 3596 个字符,预计需要花费 9 分钟才能阅读完成。
ORB-SLAM2 环境配置
随着 ORB-SLAM2 和 ORB-SLAM3 的流行,越来越多的人踏入到了 SLAM 这个畛域中,本文对 ORB-SLAM2 的配置环境进行介绍。
硬件根底 :内存、硬盘足够
零碎:Ubuntu16.04
接下来介绍 配置过程(老手小白只须要跟着这个步骤一步一步地来即可)
Step1: 因为我应用的虚拟机,因而虚拟机和 Ubuntu 零碎能够轻易从某乎等一些网站进行搜寻,装置即可。
Step2:根底环境依赖
关上 Ubuntu 的命令行,顺次输出以下内容
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install cmake-gui
sudo apt-get install pkg-config
sudo apt-get install python-dev
sudo apt-get install python-numpy
sudo apt-get install git
sudo apt-get install vim cmake
sudo apt-get install git
sudo apt-get install gcc g++
Step3:装置 eigen
(留神上面内容是 一行 输出的,这里空间太小,换行了)
wget https://gitlab.com/libeigen/e…
unzip -O cp936 eigen-3.3.9.zip
cd eigen-3.3.9
mkdir build
cd build
cmake ..
make
sudo make install
Step4:装置 g2o
1.git clone https://github.com/RainerKuem…
2.cd g2o
3.mkdir build
4.cd build
5.cmake ..
6.make
7.sudo make install
Step5: 装置 OctoMap
1.git clone https://github.com/OctoMap/oc…
2.cd octomap
3.mkdir build
4.cd build
5.cmake ..
6.make
7.sudo make install
Step6: 装置 Sophus
git clone https://github.com/strasdat/S…
cd Sophus
mkdir build
cd build
cmake ..
make
sudo make install
Step7: 装置 Pangolin
1 sudo apt install libgl1-mesa-dev
2 sudo apt install libglew-dev
3 sudo apt install libpython2.7-dev
4 sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
5 sudo apt install ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavdevice-dev
6 sudo apt install libdc1394-22-dev libraw1394-dev
7 sudo apt install libjpeg-dev libpng12-dev libtiff5-dev libopenexr-dev
8 git clone https://github.com/zzx2GH/Pan…
9 cd Pangolin
10 mkdir build
11 cd build
12 cmake ..
13 make
14 sudo make install
Step8: 装置 Glog
git clone https://github.com/google/glo…
cd glog
cmake -H. -Bbuild -G “Unix Makefiles”
cmake –build build
cmake –build build –target test
cmake –build build –target install
Step9: 装置 Gflags
git clone https://github.com/gflags/gfl…
cd gflags
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON DBUILD_STATIC_LIBS=ON ..
make
sudo make install
Step10:装置 Ceres
sudo apt-get install libatlas-base-dev liblapack-dev
sudo apt-get install libsuitesparse-dev libcxsparse3.1.4
git clone https://ceres-solver.googleso…
cd ceres-solver
mkdir build
cd build
cmake ..
make
sudo make install
Step11:装置 OpenCV3.4
首先下载包 百度网盘 https://pan.baidu.com/s/1XFsJ… 提取码 slam
(我在 windows 外面把这个下载好,而后用 U 盘考到 Ubuntu 零碎外面)
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev
libjpeg.dev
sudo apt-get install libtiff4.dev libswscale-dev libjasper-dev
tar -zxvf 文件名
cd opencv-3.4.5
mkdir build
cd build
cmake ..
make
sudo make install
sudo vim /etc/ld.so.conf.d/opencv.conf
在关上的空白文件中增加 /usr/local/lib
执行 sudo ldconfig , 使配置的环境变量失效
(配置 .bashrc,开端增加上面两行)
// 关上.bashrc
sudo vim /etc/bash.bashrc
// 增加以下两行内容到.bashrc
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig export
PKG_CONFIG_PATH
source 与 update
source /etc/bash.bashrc
sudo updatedb
测试是否失常装置 (胜利会呈现带“hello opcv”字样的窗口)
cd opencv-3.4.5/samples/cpp/example_cmake
cmake ..
make
./opencv_example
Step12:装置 DBoW3
git clone https://github.com/rmsalinas/…
cd DBoW3
mkdir build
cd build
cmake ..
make
sudo make install
Step13: 装置运行 ORB-SLAM2
git clone https://github.com/raulmur/OR… ORB_SLAM2
cd ORB_SLAM2
chmod +x build.sh
./build.sh
有了 ORB-SLAM2 文件夹当前,还须要以下操作
cd ORB-SLAM2
cd Thirdparty/DBoW2
mkdir build
cd build
cmake ..-DCMAKE_BUILD_TYPE=Release
make -jcd ORB-SLAM2
cd Thirdparty/g2o
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -jcd ORB-SLAM2
(mkdir build) // 这个之前创立过了,省略这步
cd build
cmake ..-DCMAKE_BUILD_TYPE=Release
make -j
通过以上的操作,slam 的环境就差不多配好了,当初差数据集和启动 slam 的代码,上面解说
运行代码:
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUM1.yaml /home/huang/rgbd_dataset_freiburg1_rpy
其中:
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUM1(这个中央的 1 依据前面那个数据集是 1 或者 2 或者 3 来进行批改即可!).yaml /home/huang/rgbd_dataset_freiburg1_rpy(这个中央间接换数据集即可)
数据集下载网站:https://vision.in.tum.de/data…
以上是配置 ORB-SLAM2 的具体教程,欢送 探讨 + 点赞珍藏
日常更新遇到的问题,也欢送大家来帮忙解决!