ROS——工程编译出错:Could not find a package configuration file provided by

深藏阁楼爱情的钟 2022-11-20 09:46 629阅读 0赞

文章目录

  • 问题描述
  • 解决方法

问题描述

  在catkin_make 编译ROS工程时,通常会出现如下的错误:

  1. -- Could NOT find octomap_ros (missing: octomap_ros_DIR)
  2. -- Could not find the required component 'octomap_ros'. 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.
  3. CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  4. Could not find a package configuration file provided by "octomap_ros" with
  5. any of the following names:
  6. octomap_rosConfig.cmake
  7. octomap_ros-config.cmake
  8. Add the installation prefix of "octomap_ros" to CMAKE_PREFIX_PATH or set
  9. "octomap_ros_DIR" to a directory containing one of the above files. If
  10. "octomap_ros" provides a separate development package or SDK, be sure it
  11. has been installed.
  12. Call Stack (most recent call first):
  13. rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:106 (find_package)
  14. -- Configuring incomplete, errors occurred!
  15. See also "/home/lanx/Project/ROS/UAV/build/CMakeFiles/CMakeOutput.log".
  16. See also "/home/lanx/Project/ROS/UAV/build/CMakeFiles/CMakeError.log".
  17. Invoking "cmake" failed

在这里插入图片描述

这种情况通常是因为缺少工程编译所需的依赖包,解决方法如下。

解决方法

以上述错误为例,注意看下面几句话
在这里插入图片描述

其说明缺少依赖包octomap-msgs,这个时候把提示里面的octomap_msgsConfig.cmake后面的Config.cmake删掉,即为缺少的包,并把其中的下划线_用连字符-替换,替换后就变成octomap-msgs,然后在前面加上ros-noetic即可。这里的noetic是我安装ROS的版本,根据你们自己的版本,替换成kinetic等版本。
最后输入下面代码进行安装

  1. sudo apt-get install ros-noetic-octomap-msgs

安装成功后重新catkin_make即可。

发表评论

表情:
评论列表 (有 0 条评论,629人围观)

还没有评论,来说两句吧...

相关阅读