ros2 foxy 报错缺少“diagnostic_updater“,By not providing “Finddiagnostic_updater.cmake“ in CMAKE_MODULE_P

环境:ubuntu 20.04 ros2 foxy

安装镭神M10串口版雷达,编译报错

Starting >>> lslidar_driver
--- stderr: lslidar_driver                         
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
CMake Error at CMakeLists.txt:22 (find_package):
  By not providing "Finddiagnostic_updater.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "diagnostic_updater", but CMake did not find one.

  Could not find a package configuration file provided by
  "diagnostic_updater" with any of the following names:

    diagnostic_updaterConfig.cmake
    diagnostic_updater-config.cmake

  Add the installation prefix of "diagnostic_updater" to CMAKE_PREFIX_PATH or
  set "diagnostic_updater_DIR" to a directory containing one of the above
  files.  If "diagnostic_updater" provides a separate development package or
  SDK, be sure it has been installed.


---
Failed   <<< lslidar_driver [1.39s, exited with code 1]
                                
Summary: 0 packages finished [1.74s]
  1 package failed: lslidar_driver
  1 package had stderr output: lslidar_driver

原因分析及解决方法:

仔细分析了一下,其实是缺少了这个包,diagnostic_updater,需要去下载适配于我的ros2 foxy的diagnostic_updater的包,就是先寻找适配的包,然后下载即可

sudo apt-cache search diagnostics updater #在apt源里寻找同样名字的包

返回

ros-noetic-diagnostic-updater - diagnostic_updater contains tools for easily updating diagnostics.
ros-foxy-diagnostic-updater - diagnostic_updater contains tools for easily updating diagnostics.
ros-galactic-diagnostic-updater - diagnostic_updater contains tools for easily updating diagnostics.
ros-rolling-diagnostic-updater - diagnostic_updater contains tools for easily updating diagnostics.

因此,ros-foxy-diagnostic-updater这个包就是我们所需的包,所以使用apt下载指令就好了。

sudo apt install ros-foxy-diagnostic-updater

参考博主:ROS2报错缺少“diagnostic_updater“,CMake did not find diagnostic_updater. 解决思路_diagnostics ros 安装_暮尘依旧的博客-CSDN博客

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值