ROS2报错缺少“diagnostic_updater“,CMake did not find diagnostic_updater. 解决思路

问题描述:

今天在安装激光雷达的功能包的时候,在使用colcon build编译时,出现了如下错误

CMake Error at CMakeLists.txt:17 (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.

仔细查看错误信息其实就知道是缺少了diagnostic_updater这个包导致出现的错误,但是跟着网上的一些安装指令发现根本无法定位到包,如下所示
我找到的安装指令是

sudo apt-get install ros-kinetic-diagnostics

但是直接出现

E: Unable to locate package ros-kinetic-diagnostics

环境

Ubuntu22.04
ROS2 humble


原因分析及解决方法:

仔细分析了一下,其实是缺少了这个包,所以在思考之后,我明白了,我需要去下载适配于我的ros2 humble的diagnostic_updater的包,那么其实解决方法就很简单了,就是先寻找适配的包,然后下载即可

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

返回了

libdiagnostic-updater-dev - development files for diagnostic_updater (Robot OS)
libdiagnostic-updater0d - library for diagnostic_updater (Robot OS)
python3-diagnostic-updater - Python library diagnostic_updater (Robot OS)
ros-humble-diagnostic-updater - diagnostic_updater contains tools for easily updating diagnostics.
ros-rolling-diagnostic-updater - diagnostic_updater contains tools for easily updating diagnostics.

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

sudo apt install ros-humble-diagnostic-updater

  • 6
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

暮尘依旧

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值