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