如何修复 Ubuntu 上的 ROS2 错误 hardware_interfaceConfig.cmake
问题
尝试使用 colcon build 构建某些 ROS 包时,你看到如下错误消息
cmake_error_hardware_interface.txt
CMake Error at CMakeLists.txt:20 (find_package):
By not providing "Findhardware_interface.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"hardware_interface", but CMake did not find one.
Could not find a package configuration file provided by
"hardware_interface" with any of the following names:
hardware_interfaceConfig.cmake
hardware_interface-config.cmake
Add the installation prefix of "hardware_interface" to CMAKE_PREFIX_PATH or
set "hardware_interface_DIR" to a directory containing one of the above
files. If "hardware_interface" provides a separate development package or
SDK, be sure it has been installed.解决方案
安装 ros-<distro>-hardware-interface 包。例如,对于 ROS2 Jazzy,运行
install_hardware_interface.sh
sudo apt install ros-jazzy-hardware-interfaceCheck out similar posts by category:
ROS
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow