ROS——工程编译出错:Could not find a package configuration file provided by
文章目录
- 问题描述
- 解决方法
问题描述
在catkin_make 编译ROS工程时,通常会出现如下的错误:
-- Could NOT find octomap_ros (missing: octomap_ros_DIR)
-- 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.
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "octomap_ros" with
any of the following names:
octomap_rosConfig.cmake
octomap_ros-config.cmake
Add the installation prefix of "octomap_ros" to CMAKE_PREFIX_PATH or set
"octomap_ros_DIR" to a directory containing one of the above files. If
"octomap_ros" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:106 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/lanx/Project/ROS/UAV/build/CMakeFiles/CMakeOutput.log".
See also "/home/lanx/Project/ROS/UAV/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
这种情况通常是因为缺少工程编译所需的依赖包,解决方法如下。
解决方法
以上述错误为例,注意看下面几句话
其说明缺少依赖包octomap-msgs
,这个时候把提示里面的octomap_msgsConfig.cmake
后面的Config.cmake
删掉,即为缺少的包,并把其中的下划线_
用连字符-
替换,替换后就变成octomap-msgs
,然后在前面加上ros-noetic
即可。这里的noetic
是我安装ROS的版本,根据你们自己的版本,替换成kinetic
等版本。
最后输入下面代码进行安装
sudo apt-get install ros-noetic-octomap-msgs
安装成功后重新catkin_make
即可。
还没有评论,来说两句吧...