任何帮助表示赞赏:
我只是想在运行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
答案 0 :(得分:1)
似乎您没有安装一些环境变量。
当我尝试用Colcon构建ROS2项目时,我遇到了类似的问题。
但是,当我最初获取我的环境(像. ~ros2_ws/install/setup.bash)
之类的东西时,就可以了。
P.S。如果您遇到的这个问题也与ROS有关,请不要忘记在构建后将安装的库添加到类路径中:. install/setup.bash
。