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

    ROS2入门篇第3章-自定义接口RCLCPP实战colcon build失败

    已定时 已固定 已锁定 已移动
    ROS 2相关问题
    编译出错 自定义接口
    1
    4
    403
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 6516968996
      651696899
      最后由 编辑

      ROS2入门篇第3章-自定义接口RCLCPP实战colcon build失败代码也没问题啊,1df25682-30c8-4505-9fff-5727c8f7ab1b-image.png

      1 条回复 最后回复 回复 引用 0
      • 6516968996
        651696899
        最后由 编辑

        # 直接使用ROS2原始的数据类型
        string content
        # 图像消息,调用sensor_msgs下的Image类型
        sensor_msgs/Image image
        
        
        1 条回复 最后回复 回复 引用 0
        • 6516968996
          651696899
          最后由 编辑

          cmake_minimum_required(VERSION 3.8)
          project(village_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)
          #添加对sensor_msgs的
          find_package(sensor_msgs REQUIRED)
          find_package(rosidl_default_generators REQUIRED)
          #添加消息文件和依赖
          rosidl_generate_interfaces(${PROJECT_NAME}
            "msg/Novel.msg"
             DEPENDENCIES sensor_msgs
          )
          
          # uncomment the following section in order to fill in
          # further dependencies manually.
          # find_package(<dependency> 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()
          
          ament_package()
          
          
          1 条回复 最后回复 回复 引用 0
          • 6516968996
            651696899
            最后由 编辑

            <?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>village_interfaces</name>
              <version>0.0.0</version>
              <description>TODO: Package description</description>
              <maintainer email="lzh@todo.todo">lzh</maintainer>
              <license>TODO: License declaration</license>
            
              <buildtool_depend>ament_cmake</buildtool_depend>
            
              <test_depend>ament_lint_auto</test_depend>
              <test_depend>ament_lint_common</test_depend>
            
              <depend>sensor_msgs</depend>
              <build_depend>rosidl_default_generators</build_depend>
              <exec_depend>rosidl_default_runtime</exec_depend>
              <member_of_group>rosidl_interface_packages</member_of_group>
            
            
              <export>
                <build_type>ament_cmake</build_type>
              </export>
            </package>
            
            
            1 条回复 最后回复 回复 引用 0
            • 第一个帖子
              最后一个帖子
            皖ICP备16016415号-7
            Powered by NodeBB | 鱼香ROS