《视觉SLAM十四讲》高翔第二版 实践出现的问题及解决办法笔记

#前言:这是我在看这本书遇到的问题和解决方法的笔记,希望可以在你学习的过程中给你一点帮助。使用下文的方法在我的虚拟机中可以解决,但不确保在你那边可以解决,因此仅作参考。写得有点乱,按照出现的问题参照一下吧。

问题1:

“pangolin“ includes non-existent path “/usr/include/eigen3“

原因:
非apt安装的eigen,不在/usr/include/下,而是/usr/local/include下。而pangolin应该是自动跑到/usr/include去找eigen3没找到。

治标不治本的解决方法:
terminal中跑一下

sudo ln -s /usr/local/include/eigen3 /usr/include/eigen3

问题2:

./example/groundtruth.txt not found.
./example/estimated.txt not found.

解决方法:
trajectoryError.cpp文件中修改string groundtruth_file = "./example/groundtruth.txt"为string groundtruth_file = “…/…/example/groundtruth.txt”;
修改string estimated_file = "./example/estimated.txt"为string estimated_file = “…/…/example/estimated.txt”

问题3:
无法安装libvtk5-dev
按提示修改安装:
libvtk5-dev->libvtk7-dev

无法安装libjasper-dev

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev

成功的解决了问题,其中libjasper1是libjasper-dev的依赖包

问题4:
opencv的安装问题
https://opencv.org/releases/ 选择opencv3 下载sources 解压后cmake编译后 sudo make install 即可
卡在IPPICV: Download: ippicv_2017u3_lnx_intel64_general_20170822.tgz
cmake和make都很慢 但是等就完了 就硬等 等到他出来

问题5
出现报错

teapot@ubuntu:~/slambook2/ch5/stereo/build$ ./stereoVision
terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(3.4.12) /home/teapot/opencv-3.4.12/modules/imgproc/src/median_blur.dispatch.cpp:283: error: (-215:Assertion failed) !_src0.empty() in function 'medianBlur'
已放弃 (核心已转储)

产生原因不明 暂时认为是由于图片路径没搞好的原因

问题6:
ceres安装出现报错

c++: fatal error: 已杀死 signal terminated program cc1plus
compilation terminated.
make[2]: *** [internal/ceres/CMakeFiles/ceres.dir/build.make:427:internal/ceres/CMakeFiles/ceres.dir/covariance_impl.cc.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[1]: *** [CMakeFiles/Makefile2:1595:internal/ceres/CMakeFiles/ceres.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2

目前认为是内存不足的原因 可以增加虚拟机内存 觉得慢的话还可以增加虚拟机可以用的核数
make -j3
然后sudo make install

问题7:
出现报错:

CMake Error at CMakeLists.txt:8 (find_package):
By not providing “FindG2O.cmake” in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by “G2O, but CMake did not find one.

Could not find a package configuration file provided by “G2Owith any of
the following names:

G2OConfig.cmake
g2o-config.cmake

Add the installation prefix ofG2O” to CMAKE_PREFIX_PATH or setG2O_DIR” to a directory containing one of the above files. If “G2O” provides a separate development package or SDK, be sure it has been installed.

这时需要在cmakelist文件中添加几行代码,添加代码如下:

list(APPEND CMAKE_MODULE_PATH /XXX/g2o/cmake_modules)
set(G2O_ROOT /XXX/g2o)
find_package( G2O REQUIRED )
include_directories(
${G2O_INCLUDE_DIRS}/usr/include/eigen3”
)

/XXX/g2o 是你的g2o安装目录,如果不知道自己的安装录取,可以在lunix主文件夹中搜索g2o,找到后,右键属性,即可看到父文件夹,那就是安装目录了。

暂时写到这,随缘更新。
如有错误,欢迎指正

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值