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

    7.5.3rosidl_generate_interfaces报错

    已定时 已固定 已锁定 已移动
    动手学ROS2
    cmake报错 接口报错
    2
    2
    302
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 4
      开心
      最后由 编辑

      构建空间报错代码:

      tingbo@DESKTOP-NHH5E05:~/chapt7/chapt7_ws$ colcon build
      Starting >>> autopatrol_interfaces
      Starting >>> autopatrol_robot
      Starting >>> fishbot_application
      Starting >>> fishbot_description
      Starting >>> fishbot_navigation2
      Finished <<< fishbot_description [0.53s]                                                                                                                              
      Finished <<< fishbot_navigation2 [0.53s]
      Finished <<< fishbot_application [1.02s]                                                                                     
      Finished <<< autopatrol_robot [1.04s]
      --- stderr: autopatrol_interfaces                         
      CMake Error at CMakeLists.txt:10 (find_package):
        By not providing "Findrosidl_generate_interfaces.cmake" in
        CMAKE_MODULE_PATH this project has asked CMake to find a package
        configuration file provided by "rosidl_generate_interfaces", but CMake did
        not find one.
      
        Could not find a package configuration file provided by
        "rosidl_generate_interfaces" with any of the following names:
      
          rosidl_generate_interfacesConfig.cmake
          rosidl_generate_interfaces-config.cmake
      
        Add the installation prefix of "rosidl_generate_interfaces" to
        CMAKE_PREFIX_PATH or set "rosidl_generate_interfaces_DIR" to a directory
        containing one of the above files.  If "rosidl_generate_interfaces"
        provides a separate development package or SDK, be sure it has been
        installed.
      
      
      ---
      Failed   <<< autopatrol_interfaces [1.40s, exited with code 1]
      
      Summary: 4 packages finished [1.65s]
        1 package failed: autopatrol_interfaces
        1 package had stderr output: autopatrol_interfaces
      

      SpeachText.srv代码:

      string text     
      ---
      bool result    
      

      CmakeLists.txt代码:

      cmake_minimum_required(VERSION 3.8)
      project(autopatrol_interfaces)
      
      if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
        add_compile_options(-Wall -Wextra -Wpedantic)
      endif()
      
      # find dependencies
      find_package(ament_cmake REQUIRED)
      find_package(rosidl_generate_interfaces REQUIRED)
      
      if(BUILD_TESTING)
        find_package(ament_lint_auto REQUIRED)
        # the following line skips the linter which checks for copyrights
        # comment the line when a copyright and license is added to all source files
        set(ament_cmake_copyright_FOUND TRUE)
        # the following line skips cpplint (only works in a git repo)
        # comment the line when this package is in a git repo and when
        # a copyright and license is added to all source files
        set(ament_cmake_cpplint_FOUND TRUE)
        ament_lint_auto_find_test_dependencies()
      endif()
      
      rosidl_generate_interfaces(${PROJECT_NAME}
        "srv/SpeachText.srv"
      )
      ament_package()
      

      package.xml代码:

      <?xml version="1.0"?>
      <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
      <package format="3">
        <name>autopatrol_interfaces</name>
        <version>0.0.0</version>
        <description>TODO: Package description</description>
        <maintainer email="tingbo01@qq.com">tingbo</maintainer>
        <license>Apache-2.0</license>
      
        <buildtool_depend>ament_cmake</buildtool_depend>
      
        <depend>rosidl_generate_interfaces</depend>
        <member_of_group>rosidl_interface_packages</member_of_group>
      
        <test_depend>ament_lint_auto</test_depend>
        <test_depend>ament_lint_common</test_depend>
      
        <export>
          <build_type>ament_cmake</build_type>
        </export>
      </package>
      
      1 条回复 最后回复 回复 引用 0
      • C
        ControlStudy
        最后由 编辑

        你的问题解决了吗?

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