ubuntu1604 ROS下实时双目ORB-SLAM的环境搭建
-
-
本文主要记录本萌新从零开始搭建ORB-SLAM环境的一个过程,因为第一次装双系统,本来就遇到了很多的问题。来来回回装了好多天才弄好,中间遇到的主要问题和步骤参考放在下边,可能帮助到别人的话就倍感荣幸了。
-
第一步安装ubuntu1604双系统
-
-
这个网上教程很多主要过程就是去镜像网站下载ubuntu系统镜像,我使用的是1604LTS版本,然后使用ultraiso软件进行系统盘的创建,把电脑的硬盘压缩一部分空间(50GB以上吧,因为后期扩容可能比较麻烦,还要挂载什么的0.0 大佬的话随意),然后进入bios启动盘正常安装就好了,注意安装时不要选择安装其他插件之类的,还有就是要选择ubuntu与windows并存。
-
-
-
开机第一件事一定是更换数据源
-
sudo gedit /etc/apt/sources.list 将数据源替换为下面清华镜像数据源,然后保存
-
-
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse# 预发布软件源,不建议启用# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse-
apt-get update 进行软件更新
-
安装一些依赖库
安装 cmakesudo apt-get install cmake安装 google-glog + gflagssudo apt-get install libgoogle-glog-dev安装 BLAS & LAPACKsudo apt-get install libatlas-base-dev安装 SuiteSparse and CXSparsesudo apt-get install libsuitesparse-dev安装Pangolin 需先安装三个依赖Glew:sudo apt-get install libglew-devBoost:sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-devPython2 / Python3:sudo apt-get install libpython2.7-dev正式安装Pangolingit clone https://github.com/stevenlovegrove/Pangolin.gitcd Pangolinmkdir buildcd buildcmake -DCPP11_NO_BOOST=1 ..make -j-
opencv3.4.3需配置
-
我是按照这篇文章安装的 https://www.jianshu.com/p/f646448da265 有效 ,make的过程很漫长,耐心喝杯茶吧~
-
opencv依赖sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff4.dev libswscale-dev libjasper-dev-
ROS安装
需要注意的是ROS环境搭建时,最好使用镜像,否则会很慢-
安装Eigen
sudo apt-get install libeigen3-devsudo updatedb我先是按照上边方法安装的,在编译时候遇到Sophus无法编译的问题,原因是 Sophus需要Eigen3.3.0 以上版本,而默认安装的是3.2.9 坑啊!下面这个方法完美解决ubuntu16.04通过sudo apt-get install libeigen3-dev下载的是3.2.9版本,而目前很多的软件包都需要eigen3.3.0及以上的版本,因此需要升级eigen3,下载地址为:http://eigen.tuxfamily.org/index.php?title=Main_Page,本文下载的是eigen3.3.5版本,下载完成进入到eigen目录下,安装步骤:mkdir buildcd buildcmake …sudo make installsudo ldconfig -v-
安装Sophus(这个当时纠结了好久,查了很多资料)
-
Sophus分为模板库和非模板库,如果安装后报找不到se.h 或是 so.h头文件 ,则需要安装非模板库
-
安装Sophus模板类
-
-
# 安装本身是十分简单的git clone https://gitee.com/lookinz/Sophus.gitcd [ path-to-sophus ]mkdir buildcd buildcmake ..makesudo make install-
-
-
安装Sophus非模板类
-
推荐大家在git下不下来的时候使用码云gitee的库,
-
下载超级快,谁用谁知道
-
-
-
git clone https://gitee.com/lookinz/Sophus.git // 首先下载代码仓库cd Sophusgit checkout a621ffcd [ path-to-sophus ]mkdir buildcd buildcmake ..makesudo make install-
Vi-Slam demo测试
-
-
至此,ORB-SLAM的环境已经搭建完成,附一个我录的测试双目实时ORB-SLAM算法的视频演示,
-
-
前人栽树后人乘凉,愿天下每一个报错都有解决方案,感谢****~
-