#前言:这是我在看这本书遇到的问题和解决方法的笔记,希望可以在你学习的过程中给你一点帮助。使用下文的方法在我的虚拟机中可以解决,但不确保在你那边可以解决,因此仅作参考。写得有点乱,按照出现的问题参照一下吧。
问题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 “G2O” with any of
the following names:
G2OConfig.cmake
g2o-config.cmake
Add the installation prefix of “G2O” to CMAKE_PREFIX_PATH or set “G2O_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,找到后,右键属性,即可看到父文件夹,那就是安装目录了。
暂时写到这,随缘更新。
如有错误,欢迎指正