环境: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