SLAM十四讲第二版环境配置
作者:互联网
SLAM十四讲第二版环境配置
1.源码下载路径
https://githup.com/gaoxiang12/slambook2
2.三方库安装
2.1 Eigen3
sudo apt-get install libeigen3-dev
2.2 Sophus
(1)首先安装fmt
注意:不要用git下载,会报bug
下载链接:https://fmt.dev/8.1.1/index.html
cd fmt
mkdir build
cd build
cmake ..
make
sudo make install
(2)然后安装Sophus
git clone https://github.com/strasdat/Sophus.git
cd Sophus/
mkdir build
cd build
cmake ..
make
sudo make install
(3)相关bug
解决办法:
(1) CMakeLists.txt文件中添加
find_package(OpenCV REQUIRED)
set( CMAKE_CXX_FLAGS "-std=c++14" )
target_link_libraries(trajectoryError ${Sophus_LIBRARIES} fmt)
(2)执行
sudo ldconfig
2.3 Opencv
(1)下载opencv源码
https://github.com/opencv/opencv/archive/3.4.15.zip
# 安装依赖项
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff5.dev libswscale-dev libjasper-dev
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module
# 配置并编译
mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j
sudo make install
2.4 Pangolin
(1)安装依赖
sudo apt-get install libglew-dev
sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
(2)
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build && cd build
cmake ..
make
sudo make install
2.5 Ceres
(1)安装依赖
sudo apt install -y liblapack-dev libsuitesparse-dev libcxsparse3.1.4 libgflags-dev libgoogle-glog-dev libgtest-dev
(2)
git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j
sudo make install
2.6 G2o
(1)安装依赖
sudo apt install -y qt5-qmake qt5-default libqglviewer-dev libsuitesparse-dev libcxsparse3.1.4 libcholmod3.0.6
(2)
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
2.7 PCL
sudo apt-get install libpcl-dev pcl-tools
2.8 DBow3
git clone https://github.com/rmsalinas/DBow3.git
cd DBow3
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j2
sudo make install
注意:十四讲第11章的代码中,使用 DBow3 的方法有错,应将CMakeLists.txt中的:
set( DBoW3_LIBS "/usr/local/lib/libDBoW3.a" )
改成
set( DBoW3_LIBS "/usr/local/lib/libDBoW3.so" )
标签:配置,make,sudo,dev,cd,SLAM,build,install,十四 来源: https://www.cnblogs.com/brillant-ordinary/p/16473417.html