ROS学习笔记INF-重要操作列表

该笔记将重要操作的步骤进行列表,以便查询:

  1. 添加消息
    1. 在包中的msg文件夹中创建msg文件
    2. 确保package.xml中的如下代码段被启用:
        <build_depend>message_generation</build_depend>
        <exec_depend>message_runtime</exec_depend>
      
    3. CMakeLists.txt中:
      1. find_package中添加message_generation的条目:
        ## Find catkin macros and libraries
        ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
        ## is used, also find other catkin packages
        find_package(catkin REQUIRED COMPONENTS
          roscpp
          rospy
          std_msgs
          message_generation
        )
        
      2. 同时,确保在运行时依赖中也添加了该消息的依赖:
        catkin_package(
        #  INCLUDE_DIRS include
        #  LIBRARIES begginner_tutorials
        #  CATKIN_DEPENDS roscpp rospy std_msgs
        #  DEPENDS system_lib
        CATKIN_DEPENDS message_runtime
        )
        
      3. 取消注释并添加该消息文件名:
        add_message_files(
          FILES
          Num.msg
        )
        
      4. 确保generate_message被调用:
        generate_messages(
          DEPENDENCIES
          std_msgs
        )
        
  2. 添加服务

猜你喜欢

转载自www.cnblogs.com/spyplus/p/11544061.html
今日推荐