slam学习笔记9---ubuntu2004部署interactive_slam踩坑记录

背景:interactive_slam是一款可用于离线优化点云地图算法。部署安装容易出问题,这里记录一下。

一、安装基本流程

绝大部分跟着readme走,g2o安装使用apt安装

cpp 复制代码
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 --recursive

cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE=Release

二、踩坑记录

1、编译出现g2o报错

cpp 复制代码
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_LIBRARY
    linked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_SOLVER_CHOLMOD
    linked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_SOLVER_CSPARSE
    linked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_SOLVER_PCG
    linked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_STUFF_LIBRARY
    linked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_TYPES_DATA
    linked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_TYPES_SLAM3D
    linked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam
G2O_TYPES_SLAM3D_ADDONS
    linked by target "hdl_graph_slam_nodelet" in directory /home/ylh/code_ws/interactiveSlam_ws/src/hdl_graph_slam

原因:没有找到对应的g2o版本

解决方式

cpp 复制代码
sudo apt install ros-noetic-libg2o

参考

2、提示第三方依赖找不到

interactive_slam/thirdparty/imgui 等找不到

原因:子库没有正常拉取

在interactive_slam目录下运行

cpp 复制代码
git submodule update --init --recursive

若出现错误,多运行几次

3、工作空间一次性编译混乱报错

原来方式

cpp 复制代码
catkin_make -DCMAKE_BUILD_TYPE=Release

使用编译方式,单个包编译

cpp 复制代码
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"

###################

好记性不如烂笔头

积跬步期千里

觉得不错的话,记得点赞收藏

相关推荐
flashier5 小时前
C语言 进阶指针学习笔记
c语言·笔记·学习
大白的编程日记.6 小时前
【Linux学习笔记】Linux基本指令分析和权限的概念
linux·笔记·学习
螺旋式上升abc6 小时前
GO语言学习笔记
笔记·学习·golang
W起名有点难6 小时前
前端学习——CSS
前端·css·学习
Moonnnn.7 小时前
51单片机——汇编工程建立、仿真、调试全过程
汇编·笔记·嵌入式硬件·学习·51单片机
EnigmaCoder8 小时前
蓝桥杯刷题周计划(第二周)
学习·算法·蓝桥杯
银河小铁骑plus9 小时前
Go学习笔记:基础语法6
笔记·学习·golang
汤姆和杰瑞在瑞士吃糯米粑粑9 小时前
【Linux学习篇】--开发工具第一期
linux·运维·学习
sealaugh3210 小时前
aws(学习笔记第三十二课) 深入使用cdk(API Gateway + event bridge)
笔记·学习·aws
江小年10 小时前
Gin学习笔记
笔记·学习·gin