zoukankan      html  css  js  c++  java
  • ros自定义消息消息类型

    1.在工作空间下创建一个关于消息的包;

    mkdir -p ~/catkin_ws/src
    cd src
    catkin_create_pkg msg_topic roscpp rospy std_msgs message_generation message_runtime
    cd msg_topic 
    mkdir msg//这里要创建一个msg的文件夹,将消息文件保存到这里,否则会找不到文件

     2.修改消息包下的CMakeLists.txt文件:

    cmake_minimum_required(VERSION 2.8.3)
    project(zx_msg_topic)
    
    
    find_package(catkin REQUIRED COMPONENTS
      message_generation
      message_runtime
      roscpp
      rospy
      std_msgs
    )
     add_message_files(
       FILES
       消息文件名.msg
     )
    
     generate_messages(
       DEPENDENCIES
       std_msgs
     )
    catkin_package(
    #  INCLUDE_DIRS include
      LIBRARIES msg_topic //创建的消息包名
      CATKIN_DEPENDS message_generation message_runtime roscpp rospy std_msgs
    #  DEPENDS system_lib
    )
    
    include_directories(
    # include
      ${catkin_INCLUDE_DIRS}
    )
    

      3.修改package.xml文件:

    <exec_depend>message_generation</exec_depend>
    <build_depend>message_runtime</build_depend>
    

      4,运行以下指令判断消息类型是否创建成功

    rosmsg show  msg_topic/消息文件名.msg
    

      

  • 相关阅读:
    https-->http and http-->https bitransfer
    socat
    docker daemon configuration
    centos 7 update to python V3.43 to assure git clone as usual
    df and du
    SS iproute2,nslookup,dig
    jmxtrans
    web.xml之env-entry
    Java发送Http请求
    elasticsearch在CentOS环境下开机启动
  • 原文地址:https://www.cnblogs.com/zxzmnh/p/11945064.html
Copyright © 2011-2022 走看看