赞
踩
记录一下安装过程:
主打一个困难重重/(ㄒoㄒ)/~~
话不多说,直接上代码!(我遇到的问题写在了后面,如果安装遇到问题可以先看看其中是否有相同的问题,是否有其解决方法。)
首先想感谢一下shadowmimii和1900_两位的博客!
1. C++ Compiler/Vim/Git
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install git
sudo apt-get remove vim-common
sudo apt-get install vim
2. ORB-SLAM3源码
git clone https://github.com/UZ-SLAMLab/ORB_SLAM3.git
3. Eigen3
git clone https://github.com/eigenteam/eigen-git-mirror
cd eigen-git-mirror
mkdir build
cd build
cmake ..
sudo make install
4. Pangolin
git clone https://github.com/stevenlovegrove/Pangolin.git
sudo apt install libgl1-mesa-dev
sudo apt install libglew-dev
sudo apt install cmake
sudo apt install libpython2.7-dev
sudo apt install pkg-config
sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
cd Pangolin
mkdir build
cd build
cmake ..
cmake --build .
5. Opencv
①先下载Opencv,如图所示:
(可以直接在Ubuntu里面的火狐浏览器里下,也可以Windows下完→虚拟机→设置→共享文件夹,链接:https://opencv.org/releases/page/5/)
②解压、安装依赖:
unzip opencv-3.4.3.zip
sudo apt-get update
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libtiff5-dev libswscale-dev libjasper-dev
③编译OpenCV:
cd opencv-3.4.3
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j4
sudo make install
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
然后执行:
sudo gedit /etc/bash.bashrc
在其末尾添加如下两行代码:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
继续在终端执行:
source /etc/bash.bashrc
Linux 进入root管理员权限:
sudo su root
执行:
apt-get install mlocate
sudo updatedb
检测是否OpenCV安装完成:
pkg-config --modversion opencv
6. BoW2 and g2o
ORB-SLAM3的源码包自带DBoW2 and g2o,编译时会自动安装。
7. boost库
https://www.boost.org/→download→boost_1_83_0.tar.gz
将其移到主目录且终端进入相应的地方
解压:
tar -xzvf boost_1_83_0.tar.gz
执行:
sudo ./bootstrap.sh
sudo ./b2 install
8. libssl-dev
sudo apt-get install libssl-dev
⭐ORB-SLAM3接下来的编译安装和运行放后面一节了~
遇到的问题:
Error1:
E: 无法下载 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/dists/xenial/main/binary-i386/Packages 404 Not Found [IP: 101.6.15.130 80]
E: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。
借鉴1 借鉴2 借鉴3
sudo cp /etc/apt/sources.list /etc/apt/sources-bak.list
sudo gedit /etc/apt/sources.list
Error2:
1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial InRelease
由于没有公钥,无法验证下列签名: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32,则执行以下指令【PS:后面那个3B4FE6ACC0B21F32换成缺少的密钥】:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
Error3:
unable to locate libjasper-dev 无法定位这个包libjasper-dev,则执行以下指令:
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff4.dev libswscale-dev libjasper-dev
Error4:
CMake Warning at cmake/OpenCVDownload.cmake:193 (message):
IPPICV: Download failed: 7;“Couldn’t connect to server”
解决方法参考:https://blog.csdn.net/shadowmimii/article/details/129472719
【要下载相应版本的】
Error5:
CMake Warning at cmake/OpenCVDownload.cmake:193 (message):
IPPICV: Download failed: 3;“URL using bad/illegal format or missing URL”,则执行以下指令:
cmake -D WITH_IPP=OFF -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
Error6:
ISO C++17 does not allow dynamic exception specifications
打开cmakelist,将其中的含有 OPENEXR的部分注释掉(如果用不到OPENEXR),再重新make,参考https://blog.csdn.net/weixin_40757930/article/details/124524155
Error7:
Ubuntu空间不足了:借鉴的博客1和博客2
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。