具体过程按照ubuntu18.04安装编译运行PL-SLAM
为了解决问题,翻的博客太多了我也记不清哪个问题是在哪里解决的了。。。。
期间遇到的问题:
CMake Error at cmakemodules/script_detect_gcc.cmake:16 (LIST):list GET given empty list
Call Stack (most recent call first):CMakeLists.txt:83 (include)CMake Error at cmakemodules/script_detect_gcc.cmake:17 (LIST):list GET given empty list
Call Stack (most recent call first):CMakeLists.txt:83 (include)
原文给出的解决方法是对的,但是需要注意的是在文件里的dumpversion
有两处,只改一处是不行的。
mrpt make报错
make时error报错为return howMany();
,找到报错文件并改为return howMany;
stvo-pl运行./build.sh时报错
报错为random_device
,据说是因为只在Linux支持,windows不支持?但是我用的服务器是ubuntu的?奇怪的很,但是在stereoFrameHandler.cpp文件加上#include
即可。
(MRPT:12213): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
应该是ROS的gtk2.x影响到了
# 卸载mrpt
cd mrpt/build #目录不同自行查询
sudo make uninstall
cd ..
sudo rm -r build
# 切换gtk版本
sudo update-alternatives --config wx-config
# 选择gtk3-unicode-3.0# 重新安装
mkdir build && cd build
cmake ..
make -j4
sudo make install
除了config/config中的文件需要修改vocabulary_p和vocabulary_l
,在src中slamConfig.cpp同样需要修改
CMakelists.txt的修改细节
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -mtune=native -march=native")
修改为
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -mtune=native")
需要额外注意的是,除了pl-slam的CMakelists.txt,stvo-pl的CMakelists.txt也同样要修改,只修改一个会出现OpenCV报错