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