本文记录了LSD-SLAM在Ubuntu14.04下的安装过程.
安装环境:

  1. Trusty (Ubuntu 14.04) amd64
  2. ROS Indigo Igloo
  3. ORB-SLAM

文章目录

  • 1. 准备工作
  • 2. ROS Indigo Igloo 的安装和配置
    • 2.1 配置Ubuntu软件中心
    • 2.2 设置sources.list(软件源)
    • 2.3 设置的密钥
    • 2.4 安装
    • 2.5 初始化 rosdep
    • 2.6 设置环境
    • 2.7 安装 rosinstall
    • 2.8 测试 ROS
    • 2.9 创建 ROS
  • 3 ORB-SLAM依赖项的安装
    • 3.1 Boost
    • 3.2 OpenCV
    • 3.3 Eigen3

1. 准备工作

首先,安装若干必备工具:

sudo apt-get install vim git cmake -y

接下来将安装 ROS Indigo Igloo.

2. ROS Indigo Igloo 的安装和配置

下面我将给出 ROS Indigo Igloo 在 Trusty (Ubuntu 14.04) 上的安装和测试过程。
点击这里,查看 ROS 官网的 ROS Indigo Igloo 安装手册。

2.1 配置Ubuntu软件中心

配置Ubuntu要求允许接受"restricted," “universe,” and "multiverse."的软件源,可以根据下面的链接配置:
https://help.ubuntu.com/community/Repositories/Ubuntu

一般地,这是系统默认设置,如下图所示:

ROS Indigo ONLY supports Saucy (Ubuntu13.10) and Trusty (Ubuntu14.04) for debian packages.

2.2 设置sources.list(软件源)

设置你的计算机从packages.ros.org接收软件包。

添加ROS官方软件源:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

一般地,ROS官方源速度很慢或者连接不上,推荐使用清华 TUNA Mirror 。
设置清华大学TUNA源:

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'

所有 Mirrors.

2.3 设置的密钥

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

如果你在连接秘钥服务器时遇到问题,你可以在上面的命令中替换链接为hkp://pgp.mit.edu:80或者hkp://keyserver.ubuntu.com:80

2.4 安装

首先,更新Debian包索引

sudo apt-get update

If you are using Ubuntu Trusty 14.04.2 and experience dependency issues during the ROS installation, you may have to install some additional system dependencies.
 
Do not install these packages if you are using 14.04, it will destroy your X server:

sudo apt-get install xserver-xorg-dev-lts-trusty mesa-common-dev-lts-trusty libxatracker-dev-lts-trusty libopenvg1-mesa-dev-lts-trusty libgles2-mesa-dev-lts-trusty libgles1-mesa-dev-lts-trusty libgl1-mesa-dev-lts-trusty libgbm-dev-lts-trusty libegl1-mesa-dev-lts-trusty

Do not install the above packages if you are using 14.04, it will destroy your X server
Alternatively, try installing just this to fix dependency issues:

sudo apt-get install libgl1-mesa-dev-lts-trusty

For more information on this issue see this answers.ros.org thread or this launchpad issue


X server is an application that manages one or more graphics displays and one or more input devices (keyboard, mouse, etc.) connected to the computer.
 
It works as a server and can run on the local computer or on another computer on the network. Services can communicate with the X server to display graphical interfaces and receive input from the user.
 
It’s worth noting, a common component used with an X server is the Window Manager, an application that manages the resizing and moving of windows and decorative elements of windows such as title bars, minimize, and close buttons.
 
The X server can be started with the ‘startx’ command, or more commonly, from a display manager such as gdm.

  • ~/.xinitrc is a shell script used by xinit, that starts the X server when not using a display manager, to define some application to start automatically in the X server.

  • /etc/X11/xorg.conf is a configuration file used to give the X server information about the hardware components used, but now the X server can avoid using it, because it is capable of autoconfiguring itself.

-在安装之前,请认真阅读上述引用。安装ROS完整版后可能会导致 X server 损坏,在重新启动Ubuntu后出现The system is running in low-graphics mode的错误,导致无法进入Ubuntu桌面。请尝试点击 answers.ros.org thread 或者 launchpad issue 解决问题。

ROS含有多种库和工具。官网提供了4种默认配置的安装供你选择。你也可以依据自己需求进行个性化安装。


  • (1) 桌面完整版
    Desktop-Full Install: (Recommended) : ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception

Indigo uses Gazebo 2 which is the default version of Gazebo on Trusty and is recommended. If you would like to instead use a newer version of Gazebo (5, 6 or 7), refer to these instructions on the Gazebo site. Note that installing a newer version of Gazebo will require you to build dependent packages (such as turtlebot_gazebo) to be built from source. See also Using a specific Gazebo version with ROS.

sudo apt-get install ros-indigo-desktop-full

  • (2) 桌面版
    Desktop Install: ROS, rqt, rviz, and robot-generic libraries
sudo apt-get install ros-indigo-desktop

  • (3) 基础版
    ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
sudo apt-get install ros-indigo-ros-base

  • (4) 个性化安装
    Individual Package: You can also install a specific ROS package (replace underscores with dashes of the package name):
sudo apt-get install ros-indigo-PACKAGE

PACKAGE指包的名称

e.g.

sudo apt-get install ros-indigo-slam-gmapping

搜索可用包:

apt-cache search ros-indigo

我们使用 Desktop-Full Install

sudo apt-get install ros-indigo-desktop-full

2.5 初始化 rosdep

在使用ROS之前,我们需要首先初始化rosdeprosdep帮助你轻松地进行系统依赖项源码的编译和安装,并且它是ROS核心组件运行的必要成分。

sudo rosdep init

rosdep初始化后如下图,写入/etc/ros/rosdep/sources.list.d/20-default.list

更新ROS软件包

rosdep update

2.6 设置环境

使用apt-get方式在 Ubuntu上安装 ROS,在使用前需要激活/opt/ros/indigo/目录下的setup.bash文件来添加 ROS 环境变量。

我们安装的是ROS Indigo Igloo,命令如下:

source /opt/ros/indigo/setup.bash

在每次打开一个新的 shell 时,我们都需要使用上述命令激活setup.bash文件。这样很繁琐。
因此,可以添加 ROS 的环境变量,这样,当我们打开新的shell时,我们的bash会话中会自动添加环境变量。

echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrcsource ~/.bashrc #(使环境变量设置立即生效)

Tips:
使用下面命令可以在不同的 ROS distribution (ROS 发行版)间切换

$ source /opt/ros/<distro>/setup.bash

使用 ROS distribution 的短名称替换 <distro>
 
如果我们想切换到 ROS Kinetic Kame :

$ source /opt/ros/kinetic/setup.bash

2.7 安装 rosinstall

rosinstall是 ROS 包中常用的命令行工具。它可以帮助我们轻松地下载许多 ROS 包源码并建立依赖关系,并且只需要一行命令。

sudo apt-get install python-rosinstall

其他的常用项

sudo apt-get install python-rosinstall-generator python-wstool -y

2.8 测试 ROS

运行 roscore 是使用 ROS 的首要步骤。

roscore

我们可以看到

... logging to ~/.ros/log/9cf88ce4-b14d-11df-8a75-00251148e8cf/roslaunch-machine_name-13039.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://machine_name:33919/
ros_comm version 1.4.7SUMMARY
======PARAMETERS* /rosversion* /rosdistroNODESauto-starting new master
process[master]: started with pid [13054]
ROS_MASTER_URI=http://machine_name:11311/setting /run_id to 9cf88ce4-b14d-11df-8a75-00251148e8cf
process[rosout-1]: started with pid [13067]
started core service [/rosout]

如图所示

说明 ROS 已经成功安装并配置

2.9 创建 ROS

有两种方式创建 ROS 工作空间:catkinrosbuild

  • ROS Groovy 以及更新的版本请使用 catkin
  • ROS Fuerte 以及以前的版本请使用 rosbuild

我们开始创建 catkin workspaces

mkdir -p ~/catkin_ws/srccd ~/catkin_ws/catkin_make

The catkin_make command is a convenience tool for working with catkin workspaces. Running it the first time in your workspace, it will create a CMakeLists.txt link in your ‘src’ folder. Additionally, if you look in your current directory you should now have a ‘build’ and ‘devel’ folder. Inside the ‘devel’ folder you can see that there are now several setup.*sh files. Sourcing any of these files will overlay this workspace on top of your environment. To understand more about this see the general catkin documentation: catkin. Before continuing source your new setup.*sh file:

source devel/setup.bash

To make sure your workspace is properly overlayed by the setup script, make sure ROS_PACKAGE_PATH environment variable includes the directory you’re in.

slam1a@slam1a-vm:~/catkin_ws$ echo $ROS_PACKAGE_PATH/home/slam1a/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

出现上述结果,说明我们的 catkin workspaces 已经创建好了,并且 ROS_PACKAGE_PATH也已经配置好了。

接下来的所有工作都在 ~/catkin_ws/src 目录下完成,即在 catkin workspaces

3 ORB-SLAM依赖项的安装

除了 ROS 外,ORB-SLAM 还依赖于其他若干第三方库:BoostOpenCVEigen3g2oDBoW2g2oDBoW2 已经包含在 ORB-SLAM 项目下的 Thirdparty/ 目录下。
下面我们将依次安装其它各第三方库。

3.1 Boost

使用 Boost 管理 ORB-SLAM 多线程。

sudo apt-get install libboost-all-dev

3.2 OpenCV

OpenCV 版本最低要求为2.4.3,建议采用 OpenCV 2.4.13 或者 OpenCV 3.2.0。
从OpenCV 官网 或者 OpenCV GitHub 下载 OpenCV2.4.13。
也可以直接点击这里下载

然后安装依赖项:
安装编译工具

sudo apt-get install build-essential -y

安装依赖包

sudo apt-get install libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -y

安装可选包

sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev -ysudo apt-get install libgtk2.0-dev -ysudo apt-get install pkg-config -y

进入 ~/catkin_ws/src

从GitHub下载opencv2.4.13,这不是一个 git repository,使用wget。
将下载的OpenCV解压~/catkin_ws/src目录下。

cd ~/catkin_ws/srcwget https://github.com/Itseez/opencv/archive/2.4.13.zipunzip 2.4.13.zip

进入OpenCV的目录下。
编译安装OpenCV 2.4.13 源码。

cd opencv-2.4.13/mkdir buildcd buildcmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. makesudo make install

安装完毕。

下面进行测试。
测试实例

//文件名字lena.cpp
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;int main( )
{Mat image;//按照自己的目录,或者将image = imread("lena.png", 1 );if ( !image.data ){printf("No image data \n");return -1;}namedWindow("Display Image", WINDOW_AUTOSIZE );imshow("Display Image", image);waitKey(0);return 0;
}

将上述 lena.cpplena.png 文件放入同一目录下,编译

g++ lena.cpp -o lena.o  `pkg-config --cflags --libs opencv`

运行

./lena.o

效果如下

OpenCVC 已经成功安装。

3.3 Eigen3

最低要求版本为3.1.0。在http://eigen.tuxfamily.org 下载 Eigen3.2.10 压缩文件,并解压。

进入~/catkin_ws/src/

cd ~/catkin_ws/src/
wget https://bitbucket.org/eigen/eigen/get/3.2.10.tar.bz2
tar -xjf 3.2.10.tar.bz2

得到eigen-eigen-b9cd8366d4e8目录,重命名eigen-3.2.10

mv eigen-eigen-b9cd8366d4e8/ eigen-3.2.10

编译安装eigen3.2.10

cd eigen-3.2.10/mkdir buildcd buildcmake ..makesudo make install

Eigen3.2.10 安装完毕

【SLAM】Ubuntu14.04下配置LSD-SLAM相关推荐

  1. apache2+支持php7,Ubuntu14.04下配置PHP7.0+Apache2+Mysql5.7

    Apache 步骤一:安装apache ronyao@ubuntu:~$ sudo apt install apache2 安装好后,在浏览器上输入localhost(服务器端,请输入你的IP地址), ...

  2. Ubuntu14.04下配置固定IP

    实验室需要构建静态网站作为个人知识管理工具,每个人要求都有属于自己的静态网站进行知识积累和交流.但是实验室的路由有时候会关闭,重启后给每台机器重新分配ip,因此为了方便访问每台主机,需要设置静态ip. ...

  3. Ubuntu14.04下配置并使用MTK flash tool

    前言   由于从事的工作需要经常对手机进行刷机操作,而MTK提供的flash tool基本都是在Windows下运行的,很多工作又是在linux下完成的,要涉及到大量的android源码编译.生成刷机 ...

  4. Ubuntu14.04下配置SSH以支持远程putty登录

    ------------------------------------ 版权信息 ------------------------------------ 此文链接: http://blog.csd ...

  5. Ubuntu14.04下配置OpenGL及测试代码

    ubuntu14.04 64位下,默认是没有安装OpenGL相关依赖库的,若安装,则依次执行如下几条命令即可: $ sudo apt-get update $ sudo apt-get install ...

  6. ubuntu14.04下安装cudnn5.1.3,opencv3.0,编译caffe及配置matlab和python接口过程记录

    已有条件: ubuntu14.04+cuda7.5+anaconda2(即python2.7)+matlabR2014a 上述已经装好了,开始搭建caffe环境. 1. 装cudnn5.1.3,参照: ...

  7. ubuntu 14.04 java_Ubuntu14.04下配置Java环境

    Java环境配置网上已经有很多资料了,不过大多不适合初学者,Linux菜鸟更是不知所措了...Ubuntu14.04下配置Java环境,具体方案如下: Oracle官网上下载"jdk-8-l ...

  8. Ubuntu14.04下Neo4j图数据库官网安装部署步骤(图文详解)(博主推荐)

    不多说,直接上干货! 说在前面的话  首先,查看下你的操作系统的版本. root@zhouls-virtual-machine:~# cat /etc/issue Ubuntu 14.04.4 LTS ...

  9. Linux(Ubuntu14.04)下安装Anaconda和Spyder

    Linux(Ubuntu14.04)下安装Anaconda是为了安装python所需要的各种库以及他们的环境配置. Spyder是使用python的IDE 安装python和pip 一般linux系统 ...

最新文章

  1. ajax同步,异步简单的介绍
  2. mysql查询大量数据报错_mysql 查询大量数据报错
  3. 从《在小吃店遇见凯恩斯》初识经济
  4. java api接口怎么写_Java 如何设计 API 接口,实现统一格式返回?
  5. mvc源码解读(10)-ParameterDescriptor方法Action方法的参数描述对象
  6. Python 安装pythoncom库和pyHook
  7. TensorFlow实现流行的机器学习算法教程
  8. Aurora-------在 MSOffice 内输入 LaTeX 公式的很好用插件
  9. WPF中查找指定类型的父控件
  10. 微服务 第八章 SpringBoot多数据源的配置(通过Spring Data JPA 的方式)
  11. ubuntu E: Could not get lock /var/lib/dpkg/lock - open
  12. atitit.无线网卡 不能搜索到WiFi 无线路由信号的解决不能上网
  13. 100-网络编程——第五章流式套接字
  14. Intellij IDEA 设置字体加粗
  15. Postman强大的接口的前置、后置处理教程
  16. DDD领域驱动设计:四层架构应用
  17. c语言用if分解三位数,c语言if语句练习题.doc
  18. 塑形管理小程序开发(二)-原型图绘制
  19. 二叉树由遍历确定一棵树
  20. GD32库中常用的位操作REGIDX_BIT(regidx, bitpos)

热门文章

  1. 代码随想录算法训练营第三十二天_第八章_贪心算法 | 122.买卖股票的最佳时机II、55. 跳跃游戏、45.跳跃游戏II
  2. Spring Cloud Alibaba全家桶(三)——微服务负载均衡器Ribbon与LoadBalancer
  3. 餐厅管理系统(SpringBoot Mybatis Mysql)
  4. PAP与CHAP区别
  5. 最近帮别人改论文格式心得体会一:如何让页眉或者页脚或者页码不一样
  6. windows系统更改谷歌浏览器安装位置
  7. hadamard积 matlab_matlab如何自己编程得到hadamard矩阵?
  8. 单目标应用:基于麻雀搜索算法优化灰色神经网络(grey neural network)的数据预测(提供MATLAB代码)
  9. 考勤打卡定位问题解决办法------公网ip
  10. Radiation Diagram