A-LOAM安装与配置

article/2025/8/30 20:06:20

A-LOAM安装与配置

GitHub

https://github.com/HKUST-Aerial-Robotics/A-LOAM

依赖项

需要安装Ceres Slover和PCL
请添加图片描述

PCL之前已经安装过,因此只需要安装Ceres Solver

编译安装Ceres Slover报错

官方的安装指南

http://ceres-solver.org/installation.html

一开始是git下来的最新版本的Ceres Solver,即2.1版本,编译时报错

/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h:78:8: error: no type named ‘Literal’ in ‘struct Eigen::NumTraits<ceres::Jet<double, 9> >

网上搜索说是Ceres Solver版本与Eigen版本不兼容

查看Eigen版本,发现是3.3.9版本

pkg-config --modversion eigen3

官方要求Eigen 3.3及以上,照理来说应该是没问题的
请添加图片描述

于是更换Ceres Slover的版本,用的高翔博士视觉SLAM十四讲3rd_party下的Ceres Slover

用下述命令卸载原来安装的Ceres Slover

sudo rm /usr/local/lib/libceres*
sudo rm -rf /usr/local/include/ceres
sudo rm -rf /usr/include/ceres
sudo rm -rf /usr/local/lib/cmake/Ceres
sudo rm -rf /var/lib/dpkg/info/libceres*
sudo rm -rf /usr/share/doc/libceres*

卸载Eigen 3.3.9,安装Eigen 3.2.9,用下述命令卸载

sudo rm -rf /usr/include/eigen3
sudo rm -rf /usr/lib/cmake/eigen3
sudo rm -rf /usr/local/include/eigen3
sudo rm -rf /usr/share/doc/libeigen3-dev 
sudo rm -rf /usr/local/share/pkgconfig/eigen3.pc /usr/share/pkgconfig/eigen3.pc /var/lib/dpkg/info/libeigen3-dev.list /var/lib/dpkg/info/libeigen3-dev.md5sums
sudo rm -rf /usr/local/lib/pkgconfig/eigen3.pc
sudo rm -rf /usr/local/share/eigen3

catkin_make aloam_velodyne报错

更换完版本后Ceres Slover可以正常编译,但是执行catkin_make命令时又会报错

find_package Error reading CMake code from "/usr/local/lib/cmake/Ceres/CeresConfig.cmake"

查询资料说是没有有效安装,并且当前Ceres Slover的版本号也不清楚,于是我又在网上搜索其它较稳定版本的Ceres Slover,选择1.14.0版本,下面是下载链接

https://ceres-solver.googlesource.com/ceres-solver/+/refs/tags/1.14.0/

此时并未更换Eigen版本

更换Ceres Slover后再次catkin_make,报了新错误

Failed to find Ceres - Missing required Ceres dependency: Eigen version 3.2.9, please set EIGEN_INCLUDE_DIR

这个报错来自CeresConfig.cmake文件,查看这个文件后发现错误输出来自下面的程序段

# Eigen.
# Flag set during configuration and build of Ceres.
set(CERES_EIGEN_VERSION 3.2.9)
set(Eigen_INCLUDE_DIRS "/usr/include/eigen3")
set(EIGEN_WAS_BUILT_WITH_CMAKE TRUE)
# Append the locations of Eigen when Ceres was built to the search path hints.
if (EIGEN_WAS_BUILT_WITH_CMAKE)set(Eigen3_DIR "/usr/include/eigen3")set(EIGEN_PREFER_EXPORTED_EIGEN_CMAKE_CONFIGURATION TRUE)
else()list(APPEND EIGEN_INCLUDE_DIR_HINTS )
endif()
# Search quietly to control the timing of the error message if not found. The
# search should be for an exact match, but for usability reasons do a soft
# match and reject with an explanation below.
find_package(Eigen ${CERES_EIGEN_VERSION} QUIET)
if (EIGEN_FOUND)if (NOT EIGEN_VERSION VERSION_EQUAL CERES_EIGEN_VERSION)# CMake's VERSION check in FIND_PACKAGE() will accept any version >= the# specified version. However, only version = is supported. Improve# usability by explaining why we don't accept non-exact version matching.ceres_report_not_found("Found Eigen dependency, but the version of Eigen ""found (${EIGEN_VERSION}) does not exactly match the version of Eigen ""Ceres was compiled with (${CERES_EIGEN_VERSION}). This can cause subtle ""bugs by triggering violations of the One Definition Rule. See the ""Wikipedia article http://en.wikipedia.org/wiki/One_Definition_Rule ""for more details")endif ()message(STATUS "Found required Ceres dependency: ""Eigen version ${CERES_EIGEN_VERSION} in ${EIGEN_INCLUDE_DIRS}")
else (EIGEN_FOUND)ceres_report_not_found("Missing required Ceres ""dependency: Eigen version ${CERES_EIGEN_VERSION}, please set ""EIGEN_INCLUDE_DIR.")
endif (EIGEN_FOUND)
list(APPEND CERES_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})

还是Eigen的问题,上述文件已经做了部分修改,有下面几处,感兴趣可以对比原文件看下

set(CERES_EIGEN_VERSION 3.2.9)
set(Eigen_INCLUDE_DIRS "/usr/include/eigen3")
set(EIGEN_WAS_BUILT_WITH_CMAKE TRUE)set(Eigen3_DIR "/usr/include/eigen3")

这个报错的意思是没有找到Eigen的依赖,有两种解决思路

方法一

极其简单粗暴,这一段代码的最终目的是确定EIGEN_INCLUDE_DIRS,那么直接set这个变量值应该就可行,更改如下:

# Eigen.
# Flag set during configuration and build of Ceres.
set(CERES_EIGEN_VERSION 3.2.9)
set(Eigen_INCLUDE_DIRS "/usr/include/eigen3")
# set(EIGEN_WAS_BUILT_WITH_CMAKE TRUE)
# # Append the locations of Eigen when Ceres was built to the search path hints.
# if (EIGEN_WAS_BUILT_WITH_CMAKE)
#   set(Eigen3_DIR "/usr/include/eigen3")
#   set(EIGEN_PREFER_EXPORTED_EIGEN_CMAKE_CONFIGURATION TRUE)
# else()
#   list(APPEND EIGEN_INCLUDE_DIR_HINTS )
# endif()
# # Search quietly to control the timing of the error message if not found. The
# # search should be for an exact match, but for usability reasons do a soft
# # match and reject with an explanation below.
# find_package(Eigen ${CERES_EIGEN_VERSION} QUIET)
# if (EIGEN_FOUND)
#   if (NOT EIGEN_VERSION VERSION_EQUAL CERES_EIGEN_VERSION)
#     # CMake's VERSION check in FIND_PACKAGE() will accept any version >= the
#     # specified version. However, only version = is supported. Improve
#     # usability by explaining why we don't accept non-exact version matching.
#     ceres_report_not_found("Found Eigen dependency, but the version of Eigen "
#       "found (${EIGEN_VERSION}) does not exactly match the version of Eigen "
#       "Ceres was compiled with (${CERES_EIGEN_VERSION}). This can cause subtle "
#       "bugs by triggering violations of the One Definition Rule. See the "
#       "Wikipedia article http://en.wikipedia.org/wiki/One_Definition_Rule "
#       "for more details")
#   endif ()
#   message(STATUS "Found required Ceres dependency: "
#     "Eigen version ${CERES_EIGEN_VERSION} in ${EIGEN_INCLUDE_DIRS}")
# else (EIGEN_FOUND)
#   ceres_report_not_found("Missing required Ceres "
#     "dependency: Eigen version ${CERES_EIGEN_VERSION}, please set "
#     "EIGEN_INCLUDE_DIR.")
# endif (EIGEN_FOUND)
list(APPEND CERES_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})

再次catkin_make aloam_velodyne,编译成功

方法二

上述方法过于笨拙,不够优雅,并且没有发现问题的本质

查找资料发现如果要通过find_package(Eigen XXX)找到Eigen库,则应在/usr/lib/cmake和/usr/local/lib/cmake存在eigen3的cmake文件,然而我的笔记本上并没有(可能由于多次重装Eigen导致),所以这才是上述错误的真正原因

虚拟机上有eigen3的cmake文件,找了一个用到Eigen的文件,更改其CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
project(useEigen)set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-O3")# 添加Eigen头文件
# include_directories("/usr/include/eigen3")
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIRS})add_executable(eigenMatrix eigenMatrix.cpp)

再次编译,报错

CMake Error at CMakeLists.txt:9 (find_package):By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project hasasked CMake to find a package configuration file provided by "Eigen3", butCMake did not find one.Could not find a package configuration file provided by "Eigen3" with anyof the following names:Eigen3Config.cmakeeigen3-config.cmakeAdd the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set"Eigen3_DIR" to a directory containing one of the above files.  If "Eigen3"provides a separate development package or SDK, be sure it has beeninstalled.

将eigen3的cmake文件还原回去,则可顺利编译,验证之前的分析正确

因此将虚拟机中的eigen3的cmake文件复制到双系统中应该就可以解决问题,但是要注意版本问题,统一将cmake文件中出现版本号的地方更改为双系统中的Eigen版本,比如

# This file exports the Eigen3::Eigen CMake target which should be passed to the
# target_link_libraries command.####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was Eigen3Config.cmake.in                            ########get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)# Use original install prefix when loaded through a "/usr move"
# cross-prefix symbolic link such as /lib -> /usr/lib.
get_filename_component(_realCurr "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
get_filename_component(_realOrig "/usr/lib/cmake/eigen3" REALPATH)
if(_realCurr STREQUAL _realOrig)set(PACKAGE_PREFIX_DIR "/usr")
endif()
unset(_realOrig)
unset(_realCurr)macro(set_and_check _var _file)set(${_var} "${_file}")if(NOT EXISTS "${_file}")message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")endif()
endmacro()####################################################################################include ("${CMAKE_CURRENT_LIST_DIR}/Eigen3Targets.cmake")# Legacy variables, do *not* use. May be removed in the future.set (EIGEN3_FOUND 1)
set (EIGEN3_USE_FILE    "${CMAKE_CURRENT_LIST_DIR}/UseEigen3.cmake")set (EIGEN3_DEFINITIONS  "")
set (EIGEN3_INCLUDE_DIR  "${PACKAGE_PREFIX_DIR}/include/eigen3")
set (EIGEN3_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/eigen3")
set (EIGEN3_ROOT_DIR     "${PACKAGE_PREFIX_DIR}")set (EIGEN3_VERSION_STRING "3.3.4")
set (EIGEN3_VERSION_MAJOR  "3")
set (EIGEN3_VERSION_MINOR  "3")
set (EIGEN3_VERSION_PATCH  "4")

有3.3.4的地方都要改成3.2.9,再次catkin_make aloam_velodyne,编译成功,看到输出

-- Found installed version of Eigen: /usr/local/lib/eigen3
-- Found required Ceres dependency: Eigen version 3.2.9 in /usr/include/eigen3

测试运行

下载数据集,下面是网盘链接

链接:https://pan.baidu.com/s/1b_M-Vs-524TTGNOAxu1gQA
提取码:xkqd

roslaunch aloam_velodyne aloam_velodyne_VLP_16.launch
rosbag play YOUR_DATASET_FOLDER/nsh_indoor_outdoor.bag

实际效果如下图所示
请添加图片描述

说明安装配置成功


http://chatgpt.dhexx.cn/article/JUOodAuw.shtml

相关文章

LOAM论文阅读笔记

目录 1.特征点的提取 2.特征点的匹配 3.运动估计 4.运动估计优化 5.建图 参考文章&#xff1a; 1.特征点的提取 velodyne 16雷达每次返回的数据称为一帧&#xff08;sweep&#xff09;&#xff0c;一帧由16条线组成&#xff08;每条线称为一个scan&#xff09;&#xff0…

LOAM、LEGO-LOAM与LIO-SAM的知识总结

文章目录 LOAM、LEGO-LOAM与LIO-SAM的知识总结1.概要2.传感器信息读取3.数据的预处理4.激光雷达里程计4.1特征点提取4.2特征点关联匹配4.2.1 标签匹配4.2.2 两步LM优化4.2.3 LIO-SAM优化4.2.3.1 IMU预积分4.2.3.2 关键帧的引入4.2.3.3 因子图4.2.3.4 GPS因子4.2.3.5 回环因子 5…

如何运行loam和其衍生算法

目录 一、如何运行loam和其衍生算法 1. ros的一些例如bag play和run、rviz一些操作。 2. ros的一些衍生算法的内容a-loam、lego-loam等一些介绍和优劣。 3. 点云地图的保存方法介绍&#xff0c;使用效果如何。 3.1 第一种点云地图保存 3.2 第二种点云地图保存 3.3 Autoware文…

Loam livox 论文翻译和总结

Loam livox 论文翻译和总结 主要贡献一.固态激光雷达的特点1. 小FoV2. 不规律的扫描模式3. 非重复扫描4. 运动模糊 二. 特征点提取和筛选&#xff11;. 3D点的筛选2. 特征提取 三. 迭代姿态优化1.边缘点残差(Residual of edge-to-edge)2. 平面点的残差(Residual of plane-to-pl…

对LOAM算法原理和代码的理解

LOAM概况 V-LOAM和LOAM在KITTI上的排名一直是前两名。 LOAM在KITTI上的排名 原始LOAM代码(带中文注释)的地址&#xff1a;https://github.com/cuitaixiang/LOAM_NOTED 作为教学用的A-LOAM代码地址&#xff1a;https://github.com/HKUST-Aerial-Robotics/A-LOAM使用ceres库来做…

LOAM论文阅读

LOAM是Ji Zhang提出的使用激光雷达进行实时建图的算法&#xff0c;即Lidar Odometry and Mapping in Real-time。 Abstract 提出了一个用移动在6自由度的两轴激光雷达实现实时的里程计和建图的算法。由于距离测量值的不同时性和运动估计时产生的畸变导致点云错误匹配。这里作…

LOAM笔记及A-LOAM源码阅读

转载出处&#xff1a;LOAM笔记及A-LOAM源码阅读 - WellP.C - 博客园 导读 下面是我对LOAM论文的理解以及对A-LOAM的源码阅读&#xff08;中文注释版的A-LOAM已经push到github&#xff0c;见A-LOAM-NOTED&#xff09;&#xff0c;最后也会手推一下LOAM源码中高斯牛顿法&#xf…

LOAM算法详解

激光SLAM 帧间匹配方法&#xff1a; Point-to-Plane ICPNDTFeature-based Method 回环检测方法&#xff1a; Scan-to-ScanScan-to-Map LOAM创新点 定位和建图的分离&#xff1a; 里程计模块&#xff1a;高频低质量的帧间运动估计建图模块&#xff1a;低频高质量的用于点云…

loam 框架流程描述

前端流程(scanRegistration.cpp) 多线激光雷达即有多个激光发射器同时工作&#xff0c;如常见的 Velodyne16,就是共有 16 个激光发射器&#xff0c;一般这些发射器竖排排列&#xff0c;然后一起水平旋转。 激光雷达在一定的时间内旋转一圈&#xff0c;即一帧的点云数据。值得注…

LOAM 梳理

LOAM 梳理 本篇文章对 LOAM 框架进行宏观的解析&#xff0c;暂不涉及内部具体的实现原理。 整个流程 整个 LOAM 框架分为三个主要部分&#xff0c;分别为 Registration&#xff08;特征提取&#xff09;、Odometry&#xff08;特征匹配&#xff09;和 Mapping&#xff08;建…

LOAM 原理及代码实现介绍

文章目录 LOAM 原理及代码实现介绍LOAM技术点LOAM整体框架退化问题代码结构 LOAM 原理及代码实现介绍 paper:《Lidar Odometry and Mapping in Real-time》 LOAM的参考代码链接&#xff1a; A-LOAM A-LOAM-Notes LOAM-notes 使用传感器介绍&#xff1a; 如果没有电机旋转&am…

学习LOAM笔记——特征点提取与匹配

学习LOAM笔记——特征点提取与匹配 学习LOAM笔记——特征点提取与匹配1. 特征点提取1.1 对激光点按线束分类1.2 计算激光点曲率1.3 根据曲率提取特征点 2. 特征点匹配2.1 scan-to-scan中的特征点匹配2.2 scan-to-map中特征点匹配 3. 补充 学习LOAM笔记——特征点提取与匹配 兜…

Loam算法详解(配合开源代码aloam)

参考论文&#xff1a;LOAM: Lidar Odometry and Mapping in Real-time 代码&#xff1a;A-LOAM Ubuntu 18.04 ROS Melodic eigen 3.3.4 PCL 1.8.1 ceres 2.0 A-LOAM 配置 LOAM算法是激光slam中一个经典的开源框架&#xff0c;结合qin tong 博士的开源代码a-loam&#xff…

无人驾驶学习笔记 - LOAM 算法论文核心关键点总结

目录 1、框架 2、特征点提取 3、点云去畸变 4、帧间匹配 特征关联与损失函数计算 a 线特征 b 面特征 5、运动估计 6、建图 7、姿态融合 8、LOAM 优劣势 9、参考连接 1、框架 loam框架核心是两部分&#xff0c;高频率的里程计和低频率的建图。两种算法处理。里程计通…

LOAM简介

LOAM 文章目录 LOAMLOAM系统流程1、特征提取&#xff08;1&#xff09;按线数分割&#xff08;2&#xff09;计算曲率&#xff08;3&#xff09;删除异常点&#xff08;4&#xff09;按曲率大小筛选特征点 2、帧间匹配&#xff08;1&#xff09;特征关联与损失函数计算&#xf…

SLAM算法 -LOAM框架分析(一)

LOAM框架分析 算法简介1 激光里程计(高频率)1.1 计算曲率1.2 筛选特征1.3 问题建模1.3.1 损失函数1.3.2 运动补偿 1.4 优化求解1.5 定位输出 2 环境建图(低频率)2.1 问题模型2.2 PCA特征 参考文献 算法简介 LOAM的整体思想就是将复杂的SLAM问题分为&#xff1a;1. 高频的运动估…

顶级高手常用的16个思维模型

“养成一个掌握多元思维模型的习惯是你能做的最有用的事情”&#xff0c;投资家、巴菲特的黄金拍档查理 芒格认为&#xff1a;“思维模型是你大脑中做决策的工具箱。你的工具箱越多&#xff0c;你就越能做出最正确的决策。”与您分享查理芒格的12种思维模型&#xff0c;对做决…

100种思维模型之大脑系统思维模型-52

上世纪60年代&#xff0c;美国神经学家保罗 D 麦克莱恩&#xff08;Paul D. MacLean&#xff09;首次提出“三脑一体”假说&#xff0c;他认为人的大脑是蜥蜴-松鼠-猴子合体的隐喻&#xff0c;代表了进化发展不同阶段的遗传。 复旦大学管理学院的项保华教授对此有一个精彩的总结…

思维模型 SWOT分析

本系列文章 主要是 分享 思维模型&#xff0c;涉及各个领域&#xff0c;重在提升认知 1 模型故事 一个技术岗位想转产品经理&#xff08;个人职业规划SWOT的应用&#xff09;&#xff0c;做的SWOT分析&#xff0c;进而可以量化自己转型的成本&#xff1a; 小王想在自己的居住小…

【转载】100个思维模型(不一定都适用,各取所需)

世界上最有智慧的人是怎样理性思考的&#xff1f;他们在商业活动和个人生活中是如何做决策的&#xff1f; 95岁的智慧老人查理芒格的“多元思维模型”&#xff0c;相信大家都不陌生。 他提倡要学习在所有学科中真正重要的理论&#xff0c;并在此基础上形成所谓的“普世智慧”&…