幻宇机器人ros程序编译报错

1.未安装串口依赖;

-- Could not find the required component 'serial'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "serial" with any
  of the following names:

    serialConfig.cmake
    serial-config.cmake

sudo apt install ros-noetic(或者melodic或者kinetic)-serial

2.未安装SDL依赖

-- Found Bullet: /usr/lib/x86_64-linux-gnu/libBulletDynamics.so  
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindSDL.cmake:188 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  huanyu_navigation/map_server/CMakeLists.txt:12 (find_package)

sudo apt-get install libsdl-image1.2-dev
sudo apt-get install libsdl-dev.

3.未安装bfl依赖

-- Checking for module 'orocos-bfl'
--   No package 'orocos-bfl' found
CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found

sudo apt install liborocos-bfl-dev
 

4.重新定位Boost

根据错误显示;找到报错位置,打开文件进行修改

 huanyu_navigation/fake_localization/CMakeLists.txt:17 (find_package):

-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
  Could not find a package configuration file provided by "boost_signals"
  (requested version 1.71.0) with any of the following names:

    boost_signalsConfig.cmake
    boost_signals-config.cmake

  Add the installation prefix of "boost_signals" to CMAKE_PREFIX_PATH or set
  "boost_signals_DIR" to a directory containing one of the above files.  If
  "boost_signals" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
  /usr/share/cmake-3.16/Modules/FindBoost.cmake:443 (find_package)
  huanyu_navigation/fake_localization/CMakeLists.txt:17 (find_package)

将原先的find_package(Boost REQUIRED COMPONENTS signals)注释掉:增加:

#find_package(Boost REQUIRED COMPONENTS signals)
set(Boost_INCLUDE_DIRS /usr/include/boost)

set(Boost_INCLUDE_DIRS /usr/include/boost)语句即可;

5.未定位到opencv文件夹

-- Could NOT find OpenCV (missing: OpenCV_DIR)
-- Could not find the required component 'OpenCV'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "OpenCV" with any
  of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake

  Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
  "OpenCV_DIR" to a directory containing one of the above files.  If "OpenCV"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  camera_image/CMakeLists.txt:6 (find_package)

找到camera_image/CMakeLists.txt:6 (find_package)文件,并打开;

set(OpenCV_DIR /opt/ros/kinetic/share/OpenCV-3.3.1-dev)

这几句换opencv定位路径不对:

查看本系统安装的opencv路径:

locate OpenCVConfig.cmake(可能需要安装:sudo apt install mlocate)

/usr/lib/x86_64-linux-gnu/cmake/opencv4/OpenCVConfig.cmake

修改路径映射:

#set(OpenCV_DIR /opt/ros/kinetic/share/OpenCV-3.3.1-dev)
set(OpenCV_DIR /usr/lib/x86_64-linux-gnu/cmake/opencv4)

6.缺少依赖:

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "move_base_msgs"
  with any of the following names:

    move_base_msgsConfig.cmake
    move_base_msgs-config.cmake

  Add the installation prefix of "move_base_msgs" to CMAKE_PREFIX_PATH or set
  "move_base_msgs_DIR" to a directory containing one of the above files.  If
  "move_base_msgs" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  huanyu_navigation/move_base/CMakeLists.txt:4 (find_package)

sudo apt-get install ros-noetic(或者melodic或者kinetic)-move-base

7.缺少依赖

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "costmap_converter"
  with any of the following names:

    costmap_converterConfig.cmake
    costmap_converter-config.cmake

  Add the installation prefix of "costmap_converter" to CMAKE_PREFIX_PATH or
  set "costmap_converter_DIR" to a directory containing one of the above
  files.  If "costmap_converter" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  teb_local_planner/CMakeLists.txt:8 (find_package)

sudo apt-get install ros-kinetic-noetic(或者melodic或者kinetic))-converter

8. 缺少依赖

CMake Error at teb_local_planner/cmake_modules/FindSUITESPARSE.cmake:131 (MESSAGE):
  Unable to find SuiteSparse
Call Stack (most recent call first):
  teb_local_planner/CMakeLists.txt:31 (find_package

sudo apt-get install libsuitesparse-dev

9.缺少依赖

CMake Error at teb_local_planner/cmake_modules/FindG2O.cmake:85 (message):
  Could not find libg2o!
Call Stack (most recent call first):
  teb_local_planner/CMakeLists.txt:32 (find_package)

sudo apt-get install ros-noetic(或者melodic或者kinetic)-libg2o

参照:Ubuntu日常使用问题杂记_向阳花开_的博客-CSDN博客

你可能感兴趣的:(机器人)