鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    colcon编译carto时报错

    已定时 已固定 已锁定 已移动
    FishBot二驱机器人
    fishbot ros2 humble cartographer
    1
    2
    351
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 8415217918
      夏上至野
      最后由 编辑

      背景:

      按照动手学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了,还是这个错误

      1 条回复 最后回复 回复 引用 0
      • 8415217918
        夏上至野
        最后由 编辑

        已经找到了解决办法,我做了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

        1 条回复 最后回复 回复 引用 0
        • 第一个帖子
          最后一个帖子
        皖ICP备16016415号-7
        Powered by NodeBB | 鱼香ROS