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

1003 CMake Error编译出错之ROS依赖缺失-autoware_perception_msgs #21

Open
zymouse opened this issue Oct 12, 2021 · 0 comments
Open

Comments

@zymouse
Copy link
Owner

zymouse commented Oct 12, 2021

1.0 错误源码

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

    autoware_perception_msgsConfig.cmake
    autoware_perception_msgs-config.cmake

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

image

2.0 解决办法

这是一个非常经典的msg消息缺失bug

方法一:

$ sudo apt-get install ros-melodic-autoware-perception-msgs

方法一出现的问题:

# 错误源码:
E: Unable to locate package ros-melodic-autoware-perception-msgs

出现这个问题原因是,apt源里找不到[ros-melodic-autoware-perception-msgs]。

# 这个问题,最快的验证方法是,按TAB键,会不会自动补全。
$ sudo apt-get install ros-melodic-autoware-perce 
# 如果能够找到这个插件,按TAB键,会自动补全
# 通过换apt源,然后[sudo apt update]更新,就可以解决此问题

3.0 方法二,离线安装【发现换源也不好使】

# 找到[ros-melodic-autoware-perception-msgs]的资源[如下图],下载编译,配置环境变量即可
$ mkdir -p  catkin_ws_msg/src
$ cd catkin_ws_msg/src
$ git clone https://gitlab.com/perceptionengine/autoware/autoware_iv_msgs.git
$ cd ..
$ catkin_make
$ source devel/setup.bash

msg

3.1 验证[autoware-perception-msgs]是否安装成功

$ rosmsg show autoware_【按下TAB补全】
$ source devel/setup.bash
$ rosmsg show autoware_【按下TAB补全】

image

配置环境变量

# 把[source ~/pix_driver/catkin_ws_msgs/devel/setup.bash]写进环境变量
$ echo source ~/pix_driver/catkin_ws_msgs/devel/setup.bash >>~/.bashrc
# 验证是否写入环境变量
$ tail ~/.bashrc 

image

bug解决结束,剩下编译即可

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