ubuntu18.04搭建SLAM环境

之前跟着高翔学习SLAM一书写了一篇虚拟机安装linux系统(ubuntu1404)、配置SLAM库的教程:https://blog.csdn.net/stjuliet/article/details/85263852
最近更换了双系统(ubuntu1804),由于系统版本问题,在配置SLAM库中的过程中出现了一些问题,在此记录解决方案。

本文主要参考:https://www.codetd.com/article/2740272

1 IDE-Kdevelop

sudo apt-get update
sudo apt-get install kdevelop
sudo apt install konsole

2 Eigen

sudo apt-get install libeigen3-dev

3 Pangolin

sudo apt-get install libglew-dev libboost-dev libboost-thread-dev libboost-filesystem-dev
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake -DCPP11_NO_BOOST= 1 ..
make
sudo make install

4 Sophus

git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff
mkdir build
cd build
cmake ..
make

在ubuntu18.04下会出现“unit_complex_.real() = 1.; unit_complex_.imag() = 0. ;"的错误
解决方法:在sophus/so2.cpp文件中,将
unit_complex_.real() = 1. ;
unit_complex_.imag() = 0. ;
改为
unit_complex_.real(1.) ;
unit_complex_.imag(0.) ;
然后重新编译

5 OpenCV(Contrib)

OpenCV下载地址:
https://opencv.org/releases.html
OpenCV-Contrib下载地址:
https://github.com/opencv/opencv_contrib/releases

sudo apt-get install build-essential libgtk2.0-dev libvtk6-dev libjpeg-dev libtiff5-dev libopenexr-dev libtbb-dev
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev

以下为安装contrib所需的依赖项:
sudo apt-get install git cmake pkg-config libjpeg8-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libatlas-base-dev gfortran

///

cd opencv3.4.3
mkdir build
cd build

cmake配置:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/home/stjuliet/opencv_contrib-3.4.3/modules ..

make
sudo make install

安装后配置:
sudo gedit /etc/ld.so.conf.d/opencv.conf
在打开的文件末尾添加:/usr/local/lib
使得上面的配置生效:
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
更新:
sudo updatedb

6 PCL

sudo apt-get install libpcl-dev pcl-tools

7 Ceres

sudo apt-get install liblapack-dev libsuitesparse-dev libgflags-dev libgoogle-glog-dev libgtest-dev
git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver
mkdir build
cd build
cmake ..
make
sudo make install

8 g2o

sudo apt-get install libsuitesparse-dev qtdeclarative5-dev qt5-qmake libqglviewer-headers
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build
cd build
cmake ..
make
sudo make install

运行时编译出错问题的解决方案:https://blog.csdn.net/robinhjwy/article/details/78084210

Juliet 于 2019.3

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值