zoukankan      html  css  js  c++  java
  • geometry_msgs/PoseStamped 类型的变量的构造

    #navpoint.msg
    geometry_msgs/PoseStamped target_pose
    uint8 floor
    uint8 type
    
    
    target_pose 的类型为geometry_msgs/PoseStamped 
    
    # A Pose with reference coordinate frame and timestamp
    Header header
    Pose pose
    
    Record PoseStamped := { _header : Header.Header; _pose : Pose.Pose}.
    
    简单构造
    
    demo1
    #构造header
    target_pose.header.seq = 0;
    target_pose.header.stamp =ros::Time::now();//如果有问题就使用Time(0)获取时间戳,确保类型一致
    target_pose.header.frame_id = "map";
    #构造pose
    target_pose.pose.position.x = x1;
    target_pose.pose.position.y = y1;
    target_pose.pose.position.z = 0.0;
    target_pose.pose.orientation.x = 0.0;
    target_pose.pose.orientation.y = 0.0;
    target_pose.pose.orientation.w = 1.0;
    
    demo2
    geometry_msgs::PoseStamped Start;
    Start.header.seq = 0;
    Start.header.stamp = ros::Time::now();//如果有问题就使用Time(0)获取时间戳,确保类型一致
    Start.header.frame_id = "map";
    Start.pose.position.x = x1;
    Start.pose.position.y = y1;
    Start.pose.position.z = 0.0;
    Start.pose.orientation.x = 0.0;
    Start.pose.orientation.y = 0.0;
    Start.pose.orientation.w = 1.0;

    参考:
    http://docs.ros.org/api/geometry_msgs/html/msg/PoseStamped.html
    http://www.cs.cornell.edu/~aa755/ROSCoq/coqdocnew/Ros.Geometry_msgs.PoseStamped.html
    http://docs.ros.org/api/std_msgs/html/msg/Header.html

  • 相关阅读:
    算是鼓励自己吧
    那些年,我们一起追过的梦想
    敢问路在何方?
    关于红黑树旋转算法的一点说明
    存一下
    shell脚本变量
    ubuntukylin
    如何在批处理作业进行DEBUG
    IBM AS/400 应用系统开发的软件工程工具分析
    AS/400开发经验点滴(六)如何制作下拉菜单
  • 原文地址:https://www.cnblogs.com/sea-stream/p/11129967.html
Copyright © 2011-2022 走看看