Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1002 CMake Error编译出错之ROS依赖缺失,ROS CMake Error #12

Open
zymouse opened this issue Aug 13, 2021 · 0 comments
Open

1002 CMake Error编译出错之ROS依赖缺失,ROS CMake Error #12

zymouse opened this issue Aug 13, 2021 · 0 comments

Comments

@zymouse
Copy link
Owner

zymouse commented Aug 13, 2021

bug源码

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

    image_exposure_msgsConfig.cmake
    image_exposure_msgs-config.cmake

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


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

image

两种解决方法

方法一

1.0 $ sudo apt install ros-<ros版本>-<缺少的>
例如:
$ sudo apt install ros-kinetic-ros-control ros-kinetic-ros-controllers
$ sudo apt install ros-kinetic-image-exposure-msgs
2.0 怎么查找自己<缺少的>
例如查找:wfov_camera_msgs
$ apt-cache search ros-melodic |grep wfov
如下图

image

注意:只要输入正确的名称,方法一能够解决。但是依然会存在两个大坑
[哭]很不幸,我遇见了[哭]
1.0 第一个大坑:
$ sudo apt install  ros-kinetic-image-[按tab键自动补全]-------发现没有image-exposure-msgs这个
强行
$ sudo apt install ros-kinetic-image-exposure-msgs
出现下图bug:没有找到包
解决办法:
$ sudo apt update  # 根据$sources.list$确保你的 Debian 包索引是最新的
友情提示;这个指令应该经常执行,确保最新
2.1 换apt源
2.2 寻找apt源:百度-->清华apt源 或者 中科大apt源  
2.3 更换apt源:
$ sudo gedit /etc/apt/sources.list
$ sudo apt update  # 根据$sources.list$确保你的 Debian 包索引是最新的:

image

2.0 第二大坑:
2.1 apt的本质也是:先把deb安装包先下载下来,在进行安装

所以出现下图404--bug
现在可以[按tab键自动补全],但是忘记添加ros密钥了
所以下载deb文件失败
解决办法:添加ros源密钥

image
image

bug源码

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ros-melodic-statistics-msgs
The following NEW packages will be installed:
  ros-melodic-image-exposure-msgs ros-melodic-statistics-msgs
0 upgraded, 2 newly installed, 0 to remove and 122 not upgraded.
Need to get 38.7 kB of archives.
After this operation, 369 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://packages.ros.org/ros/ubuntu bionic/main amd64 ros-melodic-statistics-msgs amd64 0.14.1-1bionic.20210414.175625
  404  Not Found [IP: 140.211.166.134 80]
Err:2 http://packages.ros.org/ros/ubuntu bionic/main amd64 ros-melodic-image-exposure-msgs amd64 0.14.1-1bionic.20210414.212206
  404  Not Found [IP: 140.211.166.134 80]
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-melodic-statistics-msgs/ros-melodic-statistics-msgs_0.14.1-1bionic.20210414.175625_amd64.deb  404  Not Found [IP: 140.211.166.134 80]
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-melodic-image-exposure-msgs/ros-melodic-image-exposure-msgs_0.14.1-1bionic.20210414.212206_amd64.deb  404  Not Found [IP: 140.211.166.134 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

方法二

1.0 当方法一失败时:
以 $image-exposure-msgs$为例子
github搜索:$image-exposure-msgs$

image

1.0 把image-exposure-msgs文件夹移动到到自己的功能包里面
2.0 在把image-exposure-msgs添加功能包里的CMakeLists.txt相应位置就可以了,如下图
1.0 这个具体什么作用-大佬求解
find_package(catkin REQUIRED COMPONENTS
  image_exposure_msgs
)
2.0 这个具体什么作用-大佬求解
catkin_package(CATKIN_DEPENDS
  image_exposure_msgs 
)

image

总结:
1.0 典型的依赖缺失问题,缺什么安装什么
2.0 方法一就能解决任何问题,但是出现找不到包,或者404
2.1 肯定名字输错了或者密钥不对
比如:
正确的$sudo apt install ros-melodic-wfov-camera-msgs
错误的$ sudo apt install  ros-melodic-wfov_camera_msgs
3.0 注意:千万别手写和粘贴复制,都用[tab自动补全],实在不能[tab自动补全]在粘贴复制

image

@zymouse zymouse changed the title 1002 ros 1002 CMake Error编译出错之依赖缺失 Aug 13, 2021
@zymouse zymouse changed the title 1002 CMake Error编译出错之依赖缺失 1002 CMake Error编译出错之ROS依赖缺失,ROS CMake Error Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant