lego-loam运行常见错误
发布日期:2022-09-10 02:33:44 浏览次数:3 分类:技术文章

本文共 3688 字,大约阅读时间需要 12 分钟。

记录编译和运行过程中的错误,真的是心态崩阿


前言

下载好lego—loam后在工作空间上打开终端catkin_make编译出现以下几个错误:


一、CMake Error at /usr/local/lib/cmake/GTSAM/GTSAM-exports.cmake:100 (message):

-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpyCMake Error at /usr/local/lib/cmake/GTSAM/GTSAM-exports.cmake:100 (message):  The imported target "metis" references the file     "/usr/local/lib/libmetis.so"  but this file does not exist.  Possible reasons include:  * The file was deleted, renamed, or moved to another location.  * An install or uninstall procedure did not complete successfully.  * The installation package was faulty and contained     "/usr/local/lib/cmake/GTSAM/GTSAM-exports.cmake"  but not all the files it references.Call Stack (most recent call first):  /usr/local/lib/cmake/GTSAM/GTSAMConfig.cmake:20 (include)  LeGO-LOAM/LeGO-LOAM/CMakeLists.txt:23 (find_package)-- Configuring incomplete, errors occurred!See also "/home/robot/robot_ws/build/CMakeFiles/CMakeOutput.log".See also "/home/robot/robot_ws/build/CMakeFiles/CMakeError.log".Invoking "cmake" failed

解决方法1:

gedit /usr/local/lib/cmake/GTSAM/GTSAMConfig.cmake

这个方法只能是只读模式,无法进行修改,所以要采取下面这个方法

cd  /usr/local/lib/cmake/GTSAM/sudo chmod a+w GTSAMConfig.cmakegedit GTSAMConfig.cmake

将/usr/local/lib/cmake/GTSAM/GTSAMConfig.cmake:20行的include改成find_package,GTSAMConfig.cmake里面的代码如下:

# - Config file for GTSAM# It defines the following variables#  GTSAM_INCLUDE_DIR - include directories for GTSAM# Compute pathsget_filename_component(OUR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)if(EXISTS "${OUR_CMAKE_DIR}/CMakeCache.txt")  # In build tree  set(GTSAM_INCLUDE_DIR /home/robot/gtsam CACHE PATH "GTSAM include directory")else()  # Find installed library  set(GTSAM_INCLUDE_DIR "${OUR_CMAKE_DIR}/../../../include" CACHE PATH "GTSAM include directory")endif()# Find dependencies, required by cmake exported targets:include(CMakeFindDependencyMacro)find_dependency(Boost 1.43 COMPONENTS serialization;system;filesystem;thread;program_options;date_time;timer;chrono;regex)# Load exportsfind_package(${OUR_CMAKE_DIR}/GTSAM-exports.cmake)# Load project-specific flags, if presentif(EXISTS "${OUR_CMAKE_DIR}/gtsam_extra.cmake")	include("${OUR_CMAKE_DIR}/gtsam_extra.cmake")endif()message(STATUS "GTSAM include directory:  ${GTSAM_INCLUDE_DIR}")

二、/usr/bin/ld: 找不到 -lgtsam/usr/lib/x86_64-linux-gnu/libtbb.so.2

/usr/bin/ld: 找不到 -lgtsam/usr/lib/x86_64-linux-gnu/libtbb.so.2/usr/bin/ld: 找不到 -lgtsam/usr/lib/x86_64-linux-gnu/libtbb.so.2collect2: error: ld returned 1 exit statusLeGO-LOAM/LeGO-LOAM/CMakeFiles/mapOptmization.dir/build.make:797: recipe for target '/home/robot/robot_ws/devel/lib/lego_loam/mapOptmization' failedmake[2]: *** [/home/robot/robot_ws/devel/lib/lego_loam/mapOptmization] Error 1CMakeFiles/Makefile2:2331: recipe for target 'LeGO-LOAM/LeGO-LOAM/CMakeFiles/mapOptmization.dir/all' failedmake[1]: *** [LeGO-LOAM/LeGO-LOAM/CMakeFiles/mapOptmization.dir/all] Error 2make[1]: *** 正在等待未完成的任务....

解决方法:

很可能是系统有问题,我反正重装系统和ros

三、Install the project...-- Install configuration: "Release"

CMake Error at cmake_install.cmake:41 (file):

[100%] Built target SmartRangeExample_plaza1[100%] Built target ConcurrentFilteringAndSmoothingExampleInstall the project...-- Install configuration: "Release"CMake Error at cmake_install.cmake:41 (file):  file cannot create directory: /usr/local/lib/cmake/GTSAM.  Maybe need  administrative privileges.Makefile:150: recipe for target 'install' failedmake: *** [install] Error 1

解决方法:

官方的方法是直接make install,就会出现这个问题,所以用sudo make install安装,安装成功

sudo make install

四、

解决方法:

roslaunch之前一定要source一下

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/libsource devel/steup.bashroslaunch lego_loam run.launch

 

转载地址:https://blog.csdn.net/m0_63237813/article/details/125859354 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:lego-loam运行报错
下一篇:LeGO-LOAM 系列(3): featureAssociation node 分析

发表评论

最新留言

第一次来,支持一个
[***.219.124.196]2024年03月28日 00时47分23秒