ros相关开发经验

在知乎上看到一篇文章,讲地图分割的,里面提到了一篇论文,这篇论文实现了几种地图分割的方法,所以我就打算clone下来跑一下:
GitHub - ipa320/ipa_coverage_planning: Algorithms for floor plan segmentation and systematic coverage driving patterns

创建工作空间等工作略过了。

开始编译:

catkin_make

 出错了:

-- Could NOT find libdlib (missing: libdlib_DIR)
-- Could not find the required component 'libdlib'. 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 "libdlib" with any
  of the following names:

    libdlibConfig.cmake
    libdlib-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

开第一行,找不到libdlib。直接安装libdlib试试:

$ sudo apt install libdlib
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
E: 无法定位软件包 libdlib

无法定位libdlib,有可能这个包根本不叫这个名字,试着找一下:

$ apt-cache search libdlib
libdlib-data - C++ toolkit for machine learning and computer vision - models
libdlib-dev - C++ toolkit for machine learning and computer vision - development
libdlib19 - C++ toolkit for machine learning and computer vision - library
ros-noetic-libdlib - This package wraps the external c++ library dlib (http://dlib.net/) in a ROS package, so other packages can use it.

找到了几个和libdlib相关的包,前三个是关于机器学习和视觉的C++库,最后一个是一个dlib的包,和ros有关,先安装最后一个并再次编译试试:

sudo apt install ros-noetic-libdlib
catkin_make

没在报同样的错误了。但是:

-- Could NOT find opengm (missing: opengm_DIR)
-- Could not find the required component 'opengm'. 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 "opengm" with any
  of the following names:

    opengmConfig.cmake
    opengm-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

这回找不到opengm了,同样的解决方法:

$ apt-cache search opengm
ros-noetic-opengm - This package wraps the external c++ library opengm in a ROS package, so other packages can use it.

找到了,安装,编译,没出同样的错误。

后面还出现了几个catkin_make的错误,都是同样的套路,先找,再安装:

CMake Warning at /opt/ros/noetic/share/catkin/cmake/catkin_package.cmake:166 (message):
  catkin_package() DEPENDS on 'OpenMP' but neither 'OpenMP_INCLUDE_DIRS' nor
  'OpenMP_LIBRARIES' is defined.
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
  ipa_coverage_planning/ipa_room_segmentation/CMakeLists.txt:53 (catkin_package)


-- +++ processing catkin package: 'ipa_room_exploration'
-- ==> add_subdirectory(ipa_coverage_planning/ipa_room_exploration)
-- Could NOT find cob_map_accessibility_analysis (missing: cob_map_accessibility_analysis_DIR)
-- Could not find the required component 'cob_map_accessibility_analysis'. 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
  "cob_map_accessibility_analysis" with any of the following names:

    cob_map_accessibility_analysisConfig.cmake
    cob_map_accessibility_analysis-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
-- Could NOT find move_base_msgs (missing: move_base_msgs_DIR)
-- Could not find the required component 'move_base_msgs'. 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 "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):
  ipa_coverage_planning/ipa_room_exploration/CMakeLists.txt:33 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
-   No package 'coinutils' found
CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
  ipa_coverage_planning/ipa_room_exploration/CMakeLists.txt:71 (pkg_check_modules)


-- Configuring incomplete, errors occurred!
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/john/room_segmentation_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

这个我去找,发现有几个相似的包,分不清,全安上:

$ apt-cache search coinutils
coinor-libcoinutils-dev - Coin-or collection of utility classes (developer files)
coinor-libcoinutils-doc - Coin-or collection of utility classes (documentation)
coinor-libcoinutils3v5 - Coin-or collection of utility classes (binaries and libraries)
$ sudo apt install coinor*

所有的库都安上了。

且编译成功。

  • 8
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
### 回答1: 这个错误提示说明你的程序无法找到 OpenCV 的配置文件。OpenCV 的配置文件通常是 opencvconfig.cmake 或 opencv-config.cmake。如果你的系统中没有安装 OpenCV,或者安装的版本不正确,就会出现这个错误。要解决这个问题,你需要确保已经正确安装了 OpenCV 并且版本号正确。如果你已经安装了 OpenCV,但仍然遇到这个问题,那么你可以检查一下 OpenCV 的安装目录,看看这些配置文件是否存在,如果不存在,你可以手动创建一个。 ### 回答2: 这个错误信息提示在编译运行代码时,出现了无法找到名为 "opencvconfig.cmake" 或 "opencv-config.cmake" 提供的软件包配置文件。 opencv 是一款广泛使用于计算机视觉领域的开源库,其中包含了很多图像处理和计算机视觉相关的函数和工具。在编译运行代码时,如果需要调用 opencv 提供的库函数,就需要通过这两个配置文件来告诉编译器和系统如何查找和链接这些函数库。 如果提示找不到这两个文件,可能有以下几个原因: 1. 没有正确安装 opencv。在编译运行代码之前,需要先安装 opencv 库,并确保安装的版本和文件路径正确。 2. 文件路径没有配置正确。如果已安装 opencv,但在编译运行代码时仍然提示无法找到配置文件,则可能是文件路径没有正确配置。需要检查项目的配置文件、环境变量等设置是否正确。 3. 编译器不支持 opencv 库。某些编译器可能不支持 opencv 库,需要更换支持 opencv 的编译器,或者手动配置链接选项。 解决这个问题的方法是根据错误提示找到缺失的配置文件,并确保 opencv 库已正确安装和配置。如果仍然无法解决,可以根据具体情况逐步排查原因,并更改相关设置,以确保代码能够正确编译和运行。 ### 回答3: 这个错误提示是由于在使用CMake构建项目时,项目无法找到名为"opencvconfig.cmake"或"opencv-config.cmake"的OpenCV配置文件,无法继续进行编译。要解决这个错误,需要检查以下几个问题: 1. Opencv是否已经正确地安装在系统中,如果是,那么它的安装路径是否已经加入到了系统的环境变量中,如果没有,那么需要手动设置系统环境变量。 2. 检查CMakeLists.txt文件,是否正确地设置了OpenCV的依赖库路径,如果没有,需要在该文件中添加配置。 3. 如果第一步和第二步都没有问题,那么需要检查一下OpenCV的版本号是否和当前项目中使用的版本号一致,如果不一致,那么需要卸载之前的版本并安装当前版本。 4. 如果以上三个步骤都没有解决问题,那么可以尝试在终端中输入sudo apt-get update && sudo apt-get upgrade进行系统更新。 总之,这个错误的出现通常与OpenCV的配置有关,需要检查安装路径、版本号、依赖库路径等方面,找到问题所在并逐一解决。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值