如何修复 ROS2 构建错误:missing ethercat_sdk_masterConfig.cmake
问题
尝试使用 colcon build 构建某些 ROS 包时,你看到如下错误消息
cmake_error_ethercat_sdk.txt
CMake Error at CMakeLists.txt:27 (find_package):
By not providing "Findethercat_sdk_master.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"ethercat_sdk_master", but CMake did not find one.
Could not find a package configuration file provided by
"ethercat_sdk_master" with any of the following names:
ethercat_sdk_masterConfig.cmake
ethercat_sdk_master-config.cmake
Add the installation prefix of "ethercat_sdk_master" to CMAKE_PREFIX_PATH
or set "ethercat_sdk_master_DIR" to a directory containing one of the above
files. If "ethercat_sdk_master" provides a separate development package or
SDK, be sure it has been installed.解决方案
不幸的是,安装它不像只安装一个包那么简单。
通常,它涉及以下步骤:
- 安装 EtherCAT 主站。我建议使用 APT 仓库安装 EtherLab 主站: 参见我们之前的文章 A https://github.com/synapticon/Etherlab_EtherCAT_Master
- 安装 EtherCAT 的 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