背景:interactive_slam是一款可用于離線優化點云地圖算法。部署安裝容易出問題,這里記錄一下。
一、安裝基本流程
絕大部分跟著readme走,g2o安裝使用apt安裝
interactive_slam depends on the following libraries:GL3W
GLFW
Dear ImGui
portable-file-dialog
OpenMP
PCL
g2o
# for ROS noetic
sudo apt-get install libglm-dev libglfw3-dev
sudo apt-get install libsuitesparse-dev libeigen3-dev
sudo apt-get install ros-noetic-geodesy ros-noetic-pcl-ros ros-noetic-nmea-msgs
# Install g2o from original source code 本人使用的是apt安裝g2o,在踩坑記錄中會說到
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build
cd build
cmake ../
make
sudo make install
# Install Ceres Library
git clone https://ceres-solver.googlesource.com/ceres-solver
# Install all dependencies
# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# Use ATLAS for BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
cd ~/catkin_ws/src
git clone https://github.com/koide3/ndt_omp
git clone https://github.com/koide3/hdl_graph_slam
git clone https://github.com/koide3/odometry_saver
git clone https://github.com/SMRT-AIST/fast_gicp --recursive
git clone https://github.com/SMRT-AIST/interactive_slam --recursivecd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE=Release
二、踩坑記錄
1、編譯出現g2o報錯
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
G2O_CORE_LIBRARYlinked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_SOLVER_CHOLMODlinked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_SOLVER_CSPARSElinked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_SOLVER_PCGlinked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_STUFF_LIBRARYlinked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_TYPES_DATAlinked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_TYPES_SLAM3Dlinked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_TYPES_SLAM3D_ADDONSlinked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
原因:沒有找到對應的g2o版本
解決方式
sudo apt install ros-noetic-libg2o
參考
2、提示第三方依賴找不到
interactive_slam/thirdparty/imgui 等找不到
原因:子庫沒有正常拉取
在interactive_slam目錄下運行
git submodule update --init --recursive
若出現錯誤,多運行幾次
3、工作空間一次性編譯混亂報錯
原來方式
catkin_make -DCMAKE_BUILD_TYPE=Release
使用編譯方式,單個包編譯
catkin_make -DCATKIN_WHITELIST_PACKAGES="odometry_saver"
catkin_make -DCATKIN_WHITELIST_PACKAGES="ndt_omp"
catkin_make -DCATKIN_WHITELIST_PACKAGES="fast_gicp"
catkin_make -DCATKIN_WHITELIST_PACKAGES="hdl_graph_slam"
catkin_make -DCATKIN_WHITELIST_PACKAGES="interactive_slam"
###################
好記性不如爛筆頭
積跬步期千里
覺得不錯的話,記得點贊收藏