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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM