$search
00001 """autogenerated by genmsg_py from PoseStamped.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 00008 class PoseStamped(roslib.message.Message): 00009 _md5sum = "d3812c3cbc69362b77dc0b19b345f8f5" 00010 _type = "geometry_msgs/PoseStamped" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """# A Pose with reference coordinate frame and timestamp 00013 Header header 00014 Pose pose 00015 00016 ================================================================================ 00017 MSG: std_msgs/Header 00018 # Standard metadata for higher-level stamped data types. 00019 # This is generally used to communicate timestamped data 00020 # in a particular coordinate frame. 00021 # 00022 # sequence ID: consecutively increasing ID 00023 uint32 seq 00024 #Two-integer timestamp that is expressed as: 00025 # * stamp.secs: seconds (stamp_secs) since epoch 00026 # * stamp.nsecs: nanoseconds since stamp_secs 00027 # time-handling sugar is provided by the client library 00028 time stamp 00029 #Frame this data is associated with 00030 # 0: no frame 00031 # 1: global frame 00032 string frame_id 00033 00034 ================================================================================ 00035 MSG: geometry_msgs/Pose 00036 # A representation of pose in free space, composed of postion and orientation. 00037 Point position 00038 Quaternion orientation 00039 00040 ================================================================================ 00041 MSG: geometry_msgs/Point 00042 # This contains the position of a point in free space 00043 float64 x 00044 float64 y 00045 float64 z 00046 00047 ================================================================================ 00048 MSG: geometry_msgs/Quaternion 00049 # This represents an orientation in free space in quaternion form. 00050 00051 float64 x 00052 float64 y 00053 float64 z 00054 float64 w 00055 00056 """ 00057 __slots__ = ['header','pose'] 00058 _slot_types = ['Header','geometry_msgs/Pose'] 00059 00060 def __init__(self, *args, **kwds): 00061 """ 00062 Constructor. Any message fields that are implicitly/explicitly 00063 set to None will be assigned a default value. The recommend 00064 use is keyword arguments as this is more robust to future message 00065 changes. You cannot mix in-order arguments and keyword arguments. 00066 00067 The available fields are: 00068 header,pose 00069 00070 @param args: complete set of field values, in .msg order 00071 @param kwds: use keyword arguments corresponding to message field names 00072 to set specific fields. 00073 """ 00074 if args or kwds: 00075 super(PoseStamped, self).__init__(*args, **kwds) 00076 #message fields cannot be None, assign default values for those that are 00077 if self.header is None: 00078 self.header = std_msgs.msg._Header.Header() 00079 if self.pose is None: 00080 self.pose = geometry_msgs.msg.Pose() 00081 else: 00082 self.header = std_msgs.msg._Header.Header() 00083 self.pose = geometry_msgs.msg.Pose() 00084 00085 def _get_types(self): 00086 """ 00087 internal API method 00088 """ 00089 return self._slot_types 00090 00091 def serialize(self, buff): 00092 """ 00093 serialize message into buffer 00094 @param buff: buffer 00095 @type buff: StringIO 00096 """ 00097 try: 00098 _x = self 00099 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00100 _x = self.header.frame_id 00101 length = len(_x) 00102 buff.write(struct.pack('<I%ss'%length, length, _x)) 00103 _x = self 00104 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w)) 00105 except struct.error as se: self._check_types(se) 00106 except TypeError as te: self._check_types(te) 00107 00108 def deserialize(self, str): 00109 """ 00110 unpack serialized message in str into this message instance 00111 @param str: byte array of serialized message 00112 @type str: str 00113 """ 00114 try: 00115 if self.header is None: 00116 self.header = std_msgs.msg._Header.Header() 00117 if self.pose is None: 00118 self.pose = geometry_msgs.msg.Pose() 00119 end = 0 00120 _x = self 00121 start = end 00122 end += 12 00123 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00124 start = end 00125 end += 4 00126 (length,) = _struct_I.unpack(str[start:end]) 00127 start = end 00128 end += length 00129 self.header.frame_id = str[start:end] 00130 _x = self 00131 start = end 00132 end += 56 00133 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end]) 00134 return self 00135 except struct.error as e: 00136 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00137 00138 00139 def serialize_numpy(self, buff, numpy): 00140 """ 00141 serialize message with numpy array types into buffer 00142 @param buff: buffer 00143 @type buff: StringIO 00144 @param numpy: numpy python module 00145 @type numpy module 00146 """ 00147 try: 00148 _x = self 00149 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00150 _x = self.header.frame_id 00151 length = len(_x) 00152 buff.write(struct.pack('<I%ss'%length, length, _x)) 00153 _x = self 00154 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w)) 00155 except struct.error as se: self._check_types(se) 00156 except TypeError as te: self._check_types(te) 00157 00158 def deserialize_numpy(self, str, numpy): 00159 """ 00160 unpack serialized message in str into this message instance using numpy for array types 00161 @param str: byte array of serialized message 00162 @type str: str 00163 @param numpy: numpy python module 00164 @type numpy: module 00165 """ 00166 try: 00167 if self.header is None: 00168 self.header = std_msgs.msg._Header.Header() 00169 if self.pose is None: 00170 self.pose = geometry_msgs.msg.Pose() 00171 end = 0 00172 _x = self 00173 start = end 00174 end += 12 00175 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00176 start = end 00177 end += 4 00178 (length,) = _struct_I.unpack(str[start:end]) 00179 start = end 00180 end += length 00181 self.header.frame_id = str[start:end] 00182 _x = self 00183 start = end 00184 end += 56 00185 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end]) 00186 return self 00187 except struct.error as e: 00188 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00189 00190 _struct_I = roslib.message.struct_I 00191 _struct_3I = struct.Struct("<3I") 00192 _struct_7d = struct.Struct("<7d")