视觉SLAM | 《视觉SLAM十四讲》依赖库配置

ch2

1、eigen3

eigen3 is a lib comes with the Ubuntu system,so no configuration is required.
view command:

$ sudo updatedb
$ locate eigen3

2、pangolin

install dependency for pangolin

$ sudo apt-get install libglew-dev

compile and install pangolin

$ cd [path of pangoliin]
$ mkdir build
$ cd build 
$ cmake ..
$ make 
$ sudo make install

ch3

an error occurred when running visualizeGeometry

Pangolin X11: Unable to retrieve framebuffer options

solve method :
comment pangilin`s source code l123-l124 in src/display/device/display_x11.cpp

static int visual_attribs[] =
{
GLX_X_RENDERABLE , True,
GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
GLX_RENDER_TYPE , GLX_RGBA_BIT,
GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
GLX_RED_SIZE , 8,
GLX_GREEN_SIZE , 8,
GLX_BLUE_SIZE , 8,
GLX_ALPHA_SIZE , 8,
GLX_DEPTH_SIZE , 24,
GLX_STENCIL_SIZE , 8,
GLX_DOUBLEBUFFER , glx_doublebuffer ? True : False,
//GLX_SAMPLE_BUFFERS , glx_sample_buffers,
//GLX_SAMPLES , glx_sample_buffers > 0 ? glx_samples : 0,
None
};

ch4

1、sophus

while " cmake …" there are some warning,but these warnings have no influence ,so i select to ignore them.

ch5

1、opencv

reference blog :
https://blog.csdn.net/cocoaqin/article/details/78163171
https://blog.csdn.net/Ding_0110M/article/details/88083741

2、 pcl

  1. install Qt:
    //----- download Qt on the official website
    //---- install Qt
$ cd [path of Qt]
$ sudo chmod u+x qt-unified-linux-x64-3.1.1-online.run
$ sudo ./qt-unified-linux-x64-3.1.1-online.run 
//qt-unified-linux-x64-3.1.1-online.run is Qt`s name ,please replace it with the name of your own installation pkg
  1. install VTK
    //----- download VTK on the official website
    //---- compile and install VTK-8.2.0
$ cd [path of VTK]
$ mkdir build
$ cd build 
$ cmake ..
$ make -jx //x means multi-threaded compilation,according to the cpu thread of your computer,which can improve the speed of compile.

3.install PCL
//---- download PCL on github
//---- compile and install PCL

$ cd [path of VTK]
$ mkdir build
$ cd build 
$ cmake ..
$ make -jx //This step will take some time,please be patient

if you encounter some errors ,you may need to install the following libraries:

$ sudo apt-get update     
$ sudo apt-get install git build-essential linux-libc-dev
$ sudo apt-get install cmake cmake-gui 
$ sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev
$ sudo apt-get install mpi-default-dev openmpi-bin openmpi-common  
$ sudo apt-get install libflann1.8 libflann-dev
$ sudo apt-get install libeigen3-dev
$ sudo apt-get install libboost-all-dev
$ sudo apt-get install libqhull* libgtest-dev
$ sudo apt-get install freeglut3-dev pkg-config
$ sudo apt-get install libxmu-dev libxi-dev 
$ sudo apt-get install mono-complete

Reference blog 1blog2blog3

ch6

1、ceres

//---- install dependency for ceres

$ sudo apt-get install liblapack-dev
$ sudo apt-get install libsuitesparse-dev 
$ sudo apt-get install libcxsparse3.1.4
$ sudo apt-get install libgflags-dev
$ sudo apt-get install libgoogle-glog-dev
$ sudo apt-get install libgtest-dev

//---- compile and install

node:view version of dependency for Ubuntu16.04 https://packages.ubuntu.com/
reference blog1blog2.

2、g2o

//---- install dependency for g2o

$ sudo apt-get install libqt4-dev
$ sudo apt-get install qt4-qmake 
$ sudo apt-get install libqglviewer-dev 
$ sudo apt-get install libsuitesparse-dev 
$ sudo apt-get install libcxsparse3.1.4
$ sudo apt-get install  libcholmod3.0.6

//----- compile and install

ch10

问题1:

在编译 g2o_custombundle 时出现一下问题
g2o/solvers/cholmod/linear_solver_cholmod.h: 没有那个文件或目录

分析原因:
在安装g2o库时,缺少指定的依赖项。
解决方案:
1)卸载g2o库

sudo rm -r /usr/local/include/g2o	//删除g2o的头文件,位于/usr/local/include/g2o下
sudo rm -r /usr/local/lib/libg2o*	//删除g2o的库文件,位于/usr/local/lib下
sudo rm -r /usr/local/bin/g2o*	//删除g2o的可执行文件,位于/usr/local/bin下
sudo rm -r /usr/local/lib/cmake/文件名 //g2o在cmake中不存在相关文件  别的库可能会存在 记录一下供参考

参考blog1
2)安装依赖项

在这里插入代码片
sudo apt-get install cmake libeigen3-dev libsuitesparse-dev libqt4-dev qt4-qmake libqglviewer-dev

参考blog2
3)重新编译g2o
/××××××××××××××××××××××××××××××××××××××××××××××××××××××××××/

参考博客:
视觉SLAM笔记(53) g2o 操作后端优化
深入理解图优化与g2o:g2o篇

ch11

**问题1:**在 cmake … 时

 Could not find a package configuration file provided by "GTSAM" with any of
  the following names:

    GTSAMConfig.cmake
    gtsam-config.cmake

  Add the installation prefix of "GTSAM" to CMAKE_PREFIX_PATH or set
  "GTSAM_DIR" to a directory containing one of the above files.  If "GTSAM"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
See also "/home/tdt/slambook/ch11/build/CMakeFiles/CMakeOutput.log".

分析原因:系统未配置 GTSAM 库
解决方案:安装 GTSAM 库

//----1、到官网下载安装包官网有详细的介绍。

node1:注意对BOOST和CMake有版本要求(我下载的是最新版本 GTSAM 3.2.1 Release)

Prerequisites:
    BOOST version 1.43 or higher (install through Linux repositories or MacPorts)
    CMake (http://www.cmake.org/) 2.6 or higher

==>查看自己系统的BOOST版本

    $ dpkg -S /usr/include/boost/version.hpp

node2: 针对外网下载速度较慢的问题,可以考虑在win系统下复制下载链接在迅雷下载。

//-----2、编译安装

    $ mkdir build
    $ cd build
    $ cmake ..
    $ make 
    $ sudo make install

node1: cmake …时会出现一个warning,对编译没有影响,就没有深究原因。

CMake Warning at CMakeLists.txt:436 (message):
   MKL was not found - this is ok, but note that MKL yields better
   performance.  Set GTSAM_WITH_EIGEN_MKL to 'Off' to disable this warning.

node2:make 时出现错误

/usr/include/boost/serialization/detail/stack_constructor.hpp:54:9: error: ‘load_construct_data_adl’ is not a member of ‘boost::serialization’
         boost::serialization::load_construct_data_adl(

解决方法:

在这里插入代码片在
				gtsam/inference/Ordering.cpp
               usr/include/boost/serialization/detail/stack_constructor.hpp
文件中,添加
#include <boost/serialization/serialization.hpp>

usr/include/boost/serialization/detail/stack_constructor.hpp 文件是只读文件在修改时,先进入root权限

// usr/include/boost/serialization/detail 目录下
	$ sudo su 
	$ gedit stack_constructor.hpp
//修改后保存即可

/××××××××××××××××××××××××××××××××××××××××××××××××××××××××××/

问题2:
https://blog.csdn.net/xiaocainiaodeboke/article/details/52851617

ch13

配置octomap:
依赖项:
sudo apt-get install doxygen
下载链接:
https://github.com/OctoMap/octomap
编译、安装即可

err 运行octomap_mapping.cpp 时:段错误

vector<Eigen::Isometry3d> poses;         // 相机位姿
//修改为
vector<Eigen::Isometry3d, Eigen::aligned_allocator<Eigen::Isometry3d>> poses;

参考[blog]:
https://blog.csdn.net/luanfei3717/article/details/80268597?utm_source=blogxgwz6

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值