PL-SLAM配置过程及采坑记录

PL-SLAM配置过程

总的来说,PL-SLAM所需要的的依赖项还是挺多的,配置过程比较麻烦,下面先列一下所需要的的依赖项

  1. OpenCV 3+
  2. Eigen3
  3. Boost
  4. g2o
  5. YAML
  6. wxWidgets
  7. MRPT
  8. stvo-pl

总的来说有9个。其中3Boost、5YAML和6wxWidgets比较容易,正常情况下一句指令在线安装就可以;1Opencv和2Eigen只要本满足要求就可以,基本也没有什么问题,只不过下载和编译的时间比较长。

难点就在4g2o、7MRPT和8stvo-pl。

1. g2o的安装

首先需要注意的是:
g2o最好不要用最新的版本,否则在最后pl-slam编译的时候会报错。
在这里插入图片描述

建议使用高翔博士的版本:https://github.com/gaoxiang12/slambook/blob/master/3rdparty/g2o.tar.gz
使用方法:
参考:Ubuntu16.04安装视觉SLAM环境(g2o)
1.1 下载g2o源码

git clone https://github.com/RainerKuemmerle/g2o.git

1.2 安装依赖库(有些可能之前安装过,以防万一都执行一遍):

sudo apt-get install libcholmod3.0.6
sudo apt-get install libsuitesparse-dev
sudo apt-get install freeglut3 freeglut3-dev freeglut3-dbg
sudo apt-get install libqglviewer2 libqglviewer-dev libqglviewer-doc
sudo apt-get install libeigen3-dev libeigen3-doc

1.3 编译,进入下载好的g2o文件夹

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

2. MRPT的安装

强调一点: mrpt、stvo-pl和pl-slam三个工程最好放在同一个文件夹下,否则最后修改路径比较麻烦

$ sudo apt-get install build-essential pkg-config libdc1394-22-dev libjpeg-dev libsuitesparse-dev libftdi-dev freeglut3-dev zlib1g-dev libusb-1.0-0-dev libudev-dev libfreenect-dev  libavformat-dev libswscale-dev libassimp-dev libgtest-dev libpcap-dev
//进入MRPT码包
$ mkdir build
$ cd build 
$ cmake ..
$ make -j8//电脑配置不好的可以使用j4,性能好的可以使用j12
$ sudo make install

cmake的结果图
cmake ..make -j8
在这里插入图片描述sudo make install
在这里插入图片描述

3. stvo-pl安装配置

github地址
将包解压完成后,在build文件夹下有个build.sh文件,直接执行:

./build.sh

会提示权限不够,执行:sudo chmod 777 build.sh解决。

附安装过程截图:

4. PL-SLAM

运行PL-SLAM时首先需要修改对应的文件,然后编译。这个过程比较坎坷。

  1. 增加了cmake_modules文件夹,内含FindG2O.CMake
  2. CMakList.txt:54、67行地址注意是否需要修改(提示缺少.h文件).
  3. ~/src/slamConfig.cpp内vocabulary_p和vocabulary_l 地址修改.
  4. /config/config/config_kitti.yamlvocabulary_p和vocabulary_l 地址修改.

期间重新下载了g2o并编译,然后遇到cmake_module的问题。根据自己的多次采坑,总结出来一个简单有效的方法,只需要将g2o文件夹下的cmake_module文件夹复制到pl-slam文件夹下就好,不需要修改文件里的路径参数。
先上一幅PL-SLAM编译成功的截图。2020.10.7 上午10.20分
在这里插入图片描述

感谢:实测 | Stereo PL-SLAM安装运行以及错误解决
运行

Options:
-c Config file
-o Offset (number of frames to skip in the dataset directory
-n Number of frames to process the sequence
-s Parameter to skip s-1 frames (default 1)
A full command would be:
./plslam_dataset kitti/00 -c ../config/config_kitti.yaml -o 100 -s 2 -n 1000

Euroc数据集运行

./plslam_dataset mav0 -c ../config/config/config_euroc.yaml -o 100 -s 1

在运行之前需要将config/config/config_euroc.yaml文件、pl-slam/src/slamConfig.cpp文件中的vocabulary_p 和 vocabulary_l 路径换成自己的路径。
在这里插入图片描述

其中,以上三个文件是对voc.tar.gz解压之后生成的。
但是,以上路径都修改之后,我的运行还是报错。
在这里插入图片描述再运行,提示wxWidgets找不到,好了,去安装wxWidgets。12.57分
https://blog.csdn.net/xs1102/article/details/80757404
在这里插入图片描述
wxWidgets下载链接

./configure --with-opengl --enable-debug --enable-unicode && make && make install

在这里插入图片描述执行提示的指令

git submodule update --init 3rdparty/catch

需要在线下载一些东西,网速贼慢。

完成后再执行

./configure --with-opengl --enable-debug --enable-unicode && make && make install

经过好久的等待之后,却还是报错。顿时头大了。
在这里插入图片描述
没办法,直接执行

sudo apt-get install libwxgtk2.8-dev

但是提示无法定位包,之前就是因为没法安装所以才下载然后编译的,参考
Ubuntu 16.04 libwxgtk2.8-dev报错
在这里插入图片描述
安装成功,但是运行PL-SLAM还是报错。无奈之下,重新编译mrpt。
mrpt编译安装完成后,再运行,就运行成功了,呈上结果图。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

5. 出现的问题及解决办法:

5.1 找不到-lg2o_ext_csparse

在这里插入图片描述
按照博客上说的,执行以下代码即可解决:

cd /usr/local/lib
sudo ln -sv libg2o_csparse_extension.so libg2o_ext_csparse.so
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
http://www.iri.upc.edu/people/jsola/JoanSola/eng/toolbox.html EKF-SLAM TOOLBOX FOR MATLAB NEWS Upgrade 2012/04/22: Added support for Omni-directional cameras for ahmPnt and eucPnt points. From 2011/09/03 to 2011/09/08: a bug in the package released between these 5 days caused the toolbox to completely fail. Download the current version below. 2010/09/04: BUG FIX: Corrected bug in code for IDP. If you just want the bug fix, click here. Toolbox versions after 2011/09/08 are already fixed. INTRODUCTION This toolbox performs 6DOF SLAM using the classical EKF implementation. It is conceived as an "active-search" SLAM. It is provided for free under the GPL license (please read the file COPYING and make sure you agree in the terms and conditions before using it). Users employing the toolbox for scientific research should cite in their scientific communications one of the papers of the authors (especially SOLA-ETAL-IJCV-11, SOLA-ETAL-TRO-08) appearing in the References section of the documentation, and also acknowledging the use of this toolbox. • Download the 6DOF SLAM toolbox for Matlab. • Please email me with feedback, I will appreciate. • Read the pdf doc to have an idea. • Features: o Full 6DOF. o Points and lines, with many different parametrizations. Consult the IJCV'11 paper on landmark parametrization. o 3D graphics. o Works with any number of robots and sensors. o Monocular and stereo systems are treated alike. o Supports extrinsic self-calibration of multi-camera rigs as in our TRO'08 paper. • The toolbox supports undelayed initialization of the following landmark types: o ahmPnt : Anchored homogeneous points. See video. This parametrization performs equivalently to Inverse-depth points in filter consistency. o idpPnt : Inverse-Depth points, with conversion to Euclidean points (eucPnt) after confirming linearity. This follows Civera's TRO-08 paper on Inverse-depth parametrization. Seevideo. Also called Anchored Modified-polar points (AMPP) in SOLA-IJCV'11. o hmgPnt : Homogeneous points. See video. o fhmPnt : Framed Homogeneous points. We follow a work by Simone Ceriani et. al., 2011. o plkLin : Plucker lines as explained in our IROS-09 paper. See video. o aplLin : Anchored Plucker lines. See video. o idpLin : Inverse-depth points lines. See video. Also called Anchored Modified-polar points lines (AMPPL) in SOLA-IJCV'11. o hmgLin : Homogeneous-points lines. See video. o ahmLin : Anchored homogeneous-points lines. See video. o See this video that compares idpPnt against ahmPnt and hmgPnt points, showing the superior consistency of idpPnt and ahmPnt because of over-estimation of the covariance in hmgPnt.(note: in the video, hmgPnt is labeled HP, ahmPnt is AHP, and idpPnt is AMPP.) o See this video with all line parametrizations running in parallel. BUG FIXES BUG (fixed in toolbox releases after 2011/09/08): The Jacobians of the idpPnt initialization function were incorrect. This derived in a poor performance of idpPnt points. Now, idpPnt andahmPnt show equivalent performance. FIX: follow these simple steps: 1. Download this file. Unzip it. 2. Copy files idp2ahp.m and ahp2idp.m to toolbox folder %SLAMTB/Points/ 3. Copy file retroProjIdpPntFromPinHoleOnRob.m to toolbox folder %SLAMTB/Observations/ 4. Delete the obsolete bugged file %SLAMTB/Points/idpS2idpW.m from the toolbox.
配置安装并运行ORB-SLAM3,可以按照以下步骤进行: 1. 下载ORB-SLAM3的源代码。可以从GitHub上克隆最新版本的代码。 2. 安装必要的依赖项。ORB-SLAM3使用了许多第三方库,包括OpenCV、Pangolin、Eigen等。确保这些库已经在您的系统上安装完毕。 3. 编译ORB-SLAM3的源代码。使用CMake工具可以方便地生成可执行文件。新建一个文件夹,比如build,然后在该文件夹中运行CMake命令,将源代码路径作为参数。例如:cmake /path/to/orb-slam3。 4. 构建ORB-SLAM3。在使用CMake生成了Makefile后,运行make命令即可编译源代码。这将生成可执行文件,可以在后续步骤中使用。 5. 下载ORB-SLAM3的预训练模型。ORB-SLAM3需要使用预训练的深度学习模型来进行视觉定位和地图构建。可以从ORB-SLAM3的GitHub页面上下载这些模型,并将其放置在合适的文件夹中。 6. 运行ORB-SLAM3。在运行ORB-SLAM3之前,需要提供输入视频或图像序列。可以通过命令参数来指定输入数据的路径。例如,将ORB-SLAM3编译生成的可执行文件称为ORB_SLAM3,可以使用以下命令启动ORB-SLAM3:./ORB_SLAM3 /path/to/input/video。 7. 查看ORB-SLAM3的输出。ORB-SLAM3会输出定位结果、重建地图等信息。可以在命令行终端上看到这些输出。此外,ORB-SLAM3还提供了可视化工具Pangolin,可以通过该工具查看实时的视觉定位和地图重建结果。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值