ORB SLAM2在Ubuntu 16.04上的运行配置
http://www.mamicode.com/info-detail-1773781.html
安装依赖
安装OpenGL
1. 安装opengl Library
$sudo apt-get install libgl1-mesa-dev
2. 安装opengl utility
$sudo apt-get install libglu1-mesa-dev
3. 安装opengl utility toolkit
$sudo apt-get install freeglut3-dev
安装GLEW
$sudo apt-get install libglew-dev
安装boost
$sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
安装编译基础库
$sudo apt-get install build-essential
安装Pangolin
1. 下载链接:https://github.com/stevenlovegrove/Pangolin
注:可以使用git进行clone,也可以直接download zip
2. 编译安装步骤
$cd Pangolin
$mkdir build
$cd build
$cmake ..
$make
$sudo make install
$make doc (生成文档)
安装OpenCV
必选依赖:sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
可选依赖:sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
源码下载链接:http://opencv.org/downloads.html (选择2.4.xx,3.x.xx版本都可以,新版本的ORBSLAM2已经支持OpenCV3.xx.xx)
编译安装步骤(以OpenCV2.4.xx为例):
$cd opencv-2.4.xx
$mkdir build
$cd build
$cmake ..
$make
$sudo make install
安装Eigen3
源码下载地址:http://eigen.tuxfamily.org/index.php?title=Main_Page
安装依赖:sudo apt-get install libxmu-dev libxi-dev
编译安装步骤:
$cd eigen
$mkdir build
$cd build
$cmake ..
$make
$sudo make install
安装BLAS and LAPACK库
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev
编译ORB SLAM2
1. 下载源码
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
2. 编译
$cd ORB_SLAM2
$chmod +x build.sh
$./build.sh
3. 16.04上编译错误解决
1) OpenCV找不到
错误信息:
Configuring and building Thirdparty/DBoW2 ...
mkdir: cannot create directory ‘build’: File exists
-- OpenCV ARCH:
-- OpenCV RUNTIME:
-- OpenCV STATIC: OFF
CMake Warning at /home/melanie/tools/opencv-2.4.13/cmake/OpenCVConfig.cmake:163 (message):
Found OpenCV Windows Pack but it has not binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
CMakeLists.txt:27 (find_package)
CMake Error at CMakeLists.txt:27 (find_package):
Found package configuration file:
/home/melanie/tools/opencv-2.4.13/cmake/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
-- Configuring incomplete, errors occurred!
See also "/home/melanie/source/SmartCar/ORM_SLAM2/ORB_SLAM2/Thirdparty/DBoW2/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.
解决方案:
因为我的OpenCV用源码编译安装的路径默认是/usr/local/share/OpenCV/,所以在这里手动给cmake指定OpenCV的路径
修改build.sh如下:
cd Thirdparty/DBoW2
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=/usr/local/share/OpenCV/
make
2)强制类型转换问题
错误信息:
/home/melanie/tools/eigen/Eigen/src/Core/AssignEvaluator.h:817:3: error: static assertion failed: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY
EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename ActualDstTypeCleaned::Scalar,typename Src::Scalar);
^
CMakeFiles/ORB_SLAM2.dir/build.make:350: recipe for target ‘CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o‘ failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o] Error 1
CMakeFiles/Makefile2:178: recipe for target ‘CMakeFiles/ORB_SLAM2.dir/all‘ failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target ‘all‘ failed
make: *** [all] Error 2
解决方案:
打开Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h,将以下代码
template <typename MatrixType>
class LinearSolverEigen: public LinearSolver<MatrixType>
{
public:
typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
typedef Eigen::Triplet<double> Triplet;
typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;
修改为:
template <typename MatrixType>
class LinearSolverEigen: public LinearSolver<MatrixType>
{
public:
typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
typedef Eigen::Triplet<double> Triplet;
typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, int> PermutationMatrix;
3)usleep未定义:
错误信息:
/home/melanie/source/SmartCar/ORM_SLAM2/ORB_SLAM2/src/Viewer.cc:159:28: error: ‘usleep’ was not declared in this scope
usleep(3000);
^
CMakeFiles/ORB_SLAM2.dir/build.make:494: recipe for target ‘CMakeFiles/ORB_SLAM2.dir/src/Viewer.cc.o‘ failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/Viewer.cc.o] Error 1
CMakeFiles/Makefile2:178: recipe for target ‘CMakeFiles/ORB_SLAM2.dir/all‘ failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target ‘all‘ failed
make: *** [all] Error 2
解决方案:
在source文件的开头增加include
#include <unistd.h>
需要增加unistd.h的文件有:
Examples/Monocular/mono_euroc.cc
Examples/Monocular/mono_kitti.cc
Examples/Monocular/mono_tum.cc
Examples/RGB-D/rgbd_tum.cc
Examples/Stereo/stereo_euroc.cc
Examples/Stereo/stereo_kitti.cc
src/LocalMapping.cc
src/LoopClosing.cc
src/System.cc
src/Tracking.cc
src/Viewer.cc
4) CUDA错误
安装了CUDA的机器编译的时候会出现CUDA相关错误,修改build.sh如下:
cd Thirdparty/DBoW2
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=/usr/local/share/OpenCV/ -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF
make -j
......
echo "Configuring and building ORB_SLAM2 ..."
mkdir build
cd build
-cmake .. -DCMAKE_BUILD_TYPE=Release
+cmake .. -DCMAKE_BUILD_TYPE=Release -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF
make -j
ORB SLAM2在Ubuntu 16.04上的运行配置的更多相关文章
- Ubuntu 16.04上安装并配置Postfix作为只发送SMTP服务器
如果大家已经在使用第三方邮件服务方案发送并收取邮件,则无需运行自己的邮件服务器.然而,如果大家管理一套云服务器,且其中安装的应用需要发送邮件通知,那么运行一套本地只发送SMTP服务器则更为理想. 如何 ...
- Ubuntu 16.04上thunderbird配置163邮箱出现“配置无法被验证-请查看用户名或密码是否正确?”
在Ubuntu 16.04 上用thunderbird配置163免费邮箱时出现的提示信息如图1: 图1 提示信息 网上有不少方法都说是将接收和发出的主机名分别改为 imap.ym.163.com 和 ...
- 如何在Ubuntu 16.04上安装配置Redis
如何在Ubuntu 16.04上安装配置Redis Redis是一个内存中的键值存储,以其灵活性,性能和广泛的语言支持而闻名.在本指南中,我们将演示如何在Ubuntu 16.04服务器上安装和配置Re ...
- 在 Ubuntu 16.04上安装 vsFTPd
在 Ubuntu 16.04上安装 vsFTPd Ubuntu vsFTPd 关于 vsFTPd vsFTPd 代表 Very Secure File Transfer Protocol Daemon ...
- (译)综合指南:通过Ubuntu 16.04上从Source构建来安装支持GPU的Caffe2
(译)综合指南:通过Ubuntu 16.04上从Source构建来安装支持GPU的Caffe2 译者注: 原文来自:https://tech.amikelive.com/node-706/compre ...
- [eShopOnContainers 学习系列] - 03 - 在远程 Ubuntu 16.04 上配置开发环境
直接把 md 粘出来了,博客园的富文本编辑器换成 markdown,没啥效果呀 ,先凑合吧.实在不行换地方 # 在远程 Ubuntu 16.04 上配置开发环境 ## 零.因 为什么要用这么麻烦的 ...
- 在 Ubuntu 16.04 上安装 Eclipse Oxygen
2017 年 6 月 28 日,Eclipse 社区(the Eclipse Community)发布了 Eclipse Oxygen.本文记录了我在 Ubuntu 16.04 上安装 Eclipse ...
- Ubuntu 16.04上安装SkyEye及测试
说明一下,在Ubuntu 16.04上安装SkyEye方法不是原创,是来自互联网,仅供学习参考. 一.检查支持软件包 gcc,make,vim(optional),ssh,subversionbinu ...
- 如何在Ubuntu 16.04上安装Apache Web服务器
转载自:https://www.howtoing.com/how-to-install-the-apache-web-server-on-ubuntu-16-04 介绍 Apache HTTP服务器是 ...
随机推荐
- Can you find it?(数组+二分hdu2141)
Can you find it? Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/10000 K (Java/Others ...
- POJ1222(SummerTrainingDay01-E)
EXTENDED LIGHTS OUT Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 11078 Accepted: 7 ...
- python-装饰器模式
源码地址:https://github.com/weilanhanf/PythonDesignPatterns 说明: 有时为了给某个对象而不是给整个类添加一个功能,使用继承机制是添加功能的一个有效途 ...
- JavaScript字符串和字符数组
字符串 字符串与字符数组: 字符串:var a = 'ddd'; 字符数组:var arr = 'f','o','o' 相同点: 1.都是类数组 2.都有length属性 3.都有indexOf()和 ...
- windows下安装composer方法
composer是一个新崛起的PHP的依赖管理工具.官方安装方法见: 此处假定: (1)php安装目录为C:/php5.4 (2)php 安装目录已经加入PATH环境变量(这样就可以在命令行直接输入“ ...
- JavaSE——网络编程基础知识
计算机网络的分类: 局域网(LAN) 指在一个较小地理范围内的各种计算机网络设备互联在一起的通信网络,可以包括一个或多个子网,通常局限在几千米的范围之内. 城域网(MAN) 主要由城域范围内的各个局域 ...
- Android 2018最新的三方库
文章出处https://blog.csdn.net/qq_32368129/article/details/78749880 1.MaterialStepperView 它是用Material Des ...
- Windows10系统的Linux子系统中安装MySQL数据库心得
后端开发童鞋们, 自己开发机用的是Windows系统电脑(台式机或笔记本), 而开发的程序和使用的数据库等要运行在Linux服务器上, 这种情况有木有? 提前声明: 本文并不讨论操作系统的比较, 以及 ...
- 机器学习实战(Machine Learning in Action)学习笔记————05.Logistic回归
机器学习实战(Machine Learning in Action)学习笔记————05.Logistic回归 关键字:Logistic回归.python.源码解析.测试作者:米仓山下时间:2018- ...
- Azure 虚拟机代理概述
Azure 虚拟机代理(AM 代理)是受保护的轻型过程,用于管理 VM 与 Azure 结构控制器的交互. VM 代理有一个主要角色,目的是启用和执行 Azure 虚拟机扩展. VM 扩展可用于对虚拟 ...