Colcon构建故障:“找不到“ Ament_cmake”提供的软件包配置文件



任何帮助:我只是想在运行Ubuntu-和的虚拟机上安装Colcon和我正在使用此命令:colcon build --symlink-install 我遇到了这个错误:

Starting >>> sick_scan2
--- stderr: sick_scan2
CMake Error at CMakeLists.txt:24 (find_package):
By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this 
project
has asked CMake to find a package configuration file provided by
"ament_cmake", but CMake did not find one.
 Could not find a package configuration file provided by "ament_cmake" 
with
any of the following names:
ament_cmakeConfig.cmake
ament_cmake-config.cmake
Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
"ament_cmake_DIR" to a directory containing one of the above files.  If
"ament_cmake" provides a separate development package or SDK, be sure it
has been installed.

---
Failed   <<< sick_scan2 [ Exited with code 1 ]
Summary: 0 packages finished [0.30s]
1 package failed: sick_scan2
1 package had stderr output: sick_scan2

看来您没有安装某些环境变量。

当我尝试使用COLCON构建ROS2项目时,我也有类似的问题。但是,当我最初采购环境时(类似. ~ros2_ws/install/setup.bash),它就可以了。

P.S。如果您的情况也是关于ROS的问题,请不要忘记在构建后将安装的库添加到Class Path:. install/setup.bash

我目前正在从事一个ROS2项目,并且收到了与您收到的相同错误消息。当我进入工作空间并从Foxy文档中输入命令source /opt/ros/foxy/setup.bash时,https://docs.ros.org/en/foxy/foxy/installation/ubuntu-inbuntu-install-debians.html#envorirnment-setup and and ant ant。希望这会有所帮助!

相关内容

最新更新