小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
colcon编译carto时报错
-
背景:
按照动手学ros2的教程,源码编译carto
问题描述:
我在按照步骤走到colcon build的时候,出现了报错
具体细节和上下文:
fishros@fishros-linux:/home/fishbot_ws$ sudo colcon build --packages-up-to cartographer_ros
Starting >>> cartographer
Starting >>> cartographer_ros_msgs
--- stderr: cartographer_ros_msgs
CMake Error at CMakeLists.txt:30 (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 <<< cartographer_ros_msgs [0.02s, exited with code 1]
Aborted <<< cartographer [35.5s]Summary: 0 packages finished [35.6s]
1 package failed: cartographer_ros_msgs
1 package aborted: cartographer
1 package had stderr output: cartographer_ros_msgs
1 package not processed尝试过的解决方法:
在工作空间中source了,还是这个错误
-
已经找到了解决办法,我做了2个操作:
1.在工作空间
sudo chmod 777 -R .
2.su认证root账户重新colcon然后就成功了,我并没有测试是那一个操作使得成功编译了,解决方案源头在这里:https://github.com/ros2/ros2/issues/1236
同时这个帖子也给出了解决办法,看起来像是和我一模一样的问题,但是他的方法无效,不知道是不是我使用错误:https://blog.csdn.net/huachizi/article/details/133274365