1. 官网下载源码:GitHub - UZ-SLAMLab/ORB_SLAM3: ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM
2. 根据官网下载依赖:
(1)eigen3:Eigen
解压后进入源码目录进行编译:
mkdir build
cd build
cmake ..
sudo make install
#安装后,头文件安装在/usr/local/include/eigen3/Eigen
#移动头文件
sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include
(2)Pangolin:https://github.com/stevenlovegrove/Pangolin
按提示安装:
./scripts/install_prerequisites.sh --dry-run recommended
./scripts/install_prerequisites.sh -m apt all
mkdir build && cd build
cmake ..
sudo make -j4
sudo make install
验证: 运行:./build/examples/HelloPangolin/HelloPangolin
若成功显示:
(3)opencv:Releases - OpenCV
1.从官网下载所需要的opencv版本:
2.解压后:
mkdir build
cmake ..
make -j8
sudo make install
在编译过错中遇到错误:error: ‘sleep_for’ is not a member of ‘std::this_thread’
解决办法参考:【ubutun安装opencv4.5.0报错细解]:error: ‘sleep_for’ is not a member of ‘std::this_thread’_ubuntu opencv 报错-CSDN博客
解决:找到.. / opencv / modules / gapi / test /路径下找到gapi_async_test.cpp
在文件中添加#include <thread>头文件,并保存重新make
(4)DBOW和g2o:
都是执行:
mkdir build
cd build
cmake ..
make -j8
(5)orb-slam3编译:
mkdir build
cd build
cmake ..
make -j8
然后运行即可:./Examples/Monocular/mono_euroc ./Vocabulary/ORBvoc.txt ./Examples/Monocular/EuRoC.yaml ../Dataset/V1_01_easy ./Examples/Monocular/EuRoC_TimeStamps/V101.txt