Files
dreamDeckAutopilot/环境搭建说明.md
T
2026-07-27 13:51:19 +08:00

4.6 KiB

1:搭建lio-sam所需要gtsam 依赖已经放在depends文件夹里面 wget -O ~/Downloads/gtsam.zip https://github.com/borglab/gtsam/archive/4.0.2.zip
cd ~/Downloads/ && unzip gtsam.zip -d ~/Downloads/
cd ~/Downloads/gtsam-4.0.2/
mkdir build && cd build
cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ..
sudo make instal

如果出现以下错误:
    -- Found TBB: /usr/include (found suitable version "2020.1", minimum required is "4.4") found components: tbb tbbmalloc 
    -- Could NOT find MKL (missing: MKL_INCLUDE_DIR MKL_LIBRARIES) 
    -- Found OpenMP_C: -fopenmp (found version "4.5") 
    -- Found OpenMP_CXX: -fopenmp (found version "4.5") 
    -- Found OpenMP: TRUE (found version "4.5")  
    -- Found Eigen version: 3.3.7
    CMake Error at wrap/CMakeLists.txt:32 (target_link_libraries):
    The "debug" argument must be followed by a library.
    
    
    -- Configuring incomplete, errors occurred!
    See also "/opt/ykcnnc/libs/libs/gtsam-4.0.2/build/CMakeFiles/CMakeOutput.log".
    See also "/opt/ykcnnc/libs/libs/gtsam-4.0.2/build/CMakeFiles/CMakeError.log".

1. 找到gtsam/wrap/CMakeLists.txt文件,注释掉debug部分

    set(WRAP_BOOST_LIBRARIES
    optimized
        ${Boost_FILESYSTEM_LIBRARY_RELEASE}
        ${Boost_SYSTEM_LIBRARY_RELEASE}
        ${Boost_THREAD_LIBRARY_RELEASE}
        #  debug
        #${Boost_FILESYSTEM_LIBRARY_DEBUG}
        #${Boost_SYSTEM_LIBRARY_DEBUG}
        #${Boost_THREAD_LIBRARY_DEBUG}
    )

2. 找到gtsam/CMakeLists.txt文件,注释掉debug部分

    if (GTSAM_DISABLE_NEW_TIMERS)
        message("WARNING:  GTSAM timing instrumentation manually disabled")
        list_append_cache(GTSAM_COMPILE_DEFINITIONS_PUBLIC DGTSAM_DISABLE_NEW_TIMERS)
    else()
        if(Boost_TIMER_LIBRARY)
        list(APPEND GTSAM_BOOST_LIBRARIES
            optimized ${Boost_TIMER_LIBRARY_RELEASE}
            optimized ${Boost_CHRONO_LIBRARY_RELEASE}
            #debug ${Boost_TIMER_LIBRARY_DEBUG}
            #debug ${Boost_CHRONO_LIBRARY_DEBUG}
            )
        else()
        list(APPEND GTSAM_BOOST_LIBRARIES rt) # When using the header-only boost timer library, need -lrt
        message("WARNING:  GTSAM timing instrumentation will use the older, less accurate, Boost timer library because boost older than 1.48 was found.")
        endif()
    endif()

3: 重新编译

2: 出现以下错误时 Could not find a package configuration file provided by "tf2_sensor_msgs" with any of the following names:

    tf2_sensor_msgsConfig.cmake
    tf2_sensor_msgs-config.cmake

执行如下操作:
    sudo apt-get install ros-noetic-tf2-sensor-msgs

3:出现以下错误时 Could not find a package configuration file provided by "costmap_converter" with any of the following names:

    costmap_converterConfig.cmake
    costmap_converter-config.cmake

执行如下操作:
    sudo apt-get install ros-noetic-costmap-converter

4: 出现以下错误时 Could not find a package configuration file provided by "mbf_costmap_core" with any of the following names:

    mbf_costmap_coreConfig.cmake
    mbf_costmap_core-config.cmake

执行如下操作:
    sudo apt-get install ros-noetic-mbf-costmap-core

5: 出现如下错误时: Could not find a package configuration file provided by "mbf_msgs" with any of the following names:

    mbf_msgsConfig.cmake
    mbf_msgs-config.cmake

执行如下操作:
    sudo apt-get install ros-noetic-mbf-msgs 

6: 出现如下错误时: CMake Error at ros_navigation_ws/teb_local_planner/cmake_modules/FindSUITESPARSE.cmake:131 (MESSAGE): Unable to find SuiteSparse Call Stack (most recent call first): ros_navigation_ws/teb_local_planner/CMakeLists.txt:35 (find_package)

执行如下操作:
    sudo apt-get install libsuitesparse-dev

7: 出现如下错误时: CMake Error at ros_navigation_ws/teb_local_planner/cmake_modules/FindG2O.cmake:85 (message): Could not find libg2o! Call Stack (most recent call first): ros_navigation_ws/teb_local_planner/CMakeLists.txt:36 (find_package)

执行如下操作:
    sudo apt-get install ros-noetic-libg2o

8: 出现如下错误时 fatal error: geodesy/utm.h: No such file or directory #include <geodesy/utm.h>

执行如下操作:
    sudo apt-get install ros-noetic-geodesy