00001 """autogenerated by genpy from komodo_sensors/apm_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
00008 class apm_imu(genpy.Message):
00009 _md5sum = "13f07ef07721826d5bb32ddaf22559ad"
00010 _type = "komodo_sensors/apm_imu"
00011 _has_header = False
00012 _full_text = """float32 ax
00013 float32 ay
00014 float32 az
00015 float32 gx
00016 float32 gy
00017 float32 gz
00018 float32 roll
00019 float32 pitch
00020 float32 yaw
00021 float32 heading
00022 float32 mx
00023 float32 my
00024 float32 mz
00025
00026 """
00027 __slots__ = ['ax','ay','az','gx','gy','gz','roll','pitch','yaw','heading','mx','my','mz']
00028 _slot_types = ['float32','float32','float32','float32','float32','float32','float32','float32','float32','float32','float32','float32','float32']
00029
00030 def __init__(self, *args, **kwds):
00031 """
00032 Constructor. Any message fields that are implicitly/explicitly
00033 set to None will be assigned a default value. The recommend
00034 use is keyword arguments as this is more robust to future message
00035 changes. You cannot mix in-order arguments and keyword arguments.
00036
00037 The available fields are:
00038 ax,ay,az,gx,gy,gz,roll,pitch,yaw,heading,mx,my,mz
00039
00040 :param args: complete set of field values, in .msg order
00041 :param kwds: use keyword arguments corresponding to message field names
00042 to set specific fields.
00043 """
00044 if args or kwds:
00045 super(apm_imu, self).__init__(*args, **kwds)
00046
00047 if self.ax is None:
00048 self.ax = 0.
00049 if self.ay is None:
00050 self.ay = 0.
00051 if self.az is None:
00052 self.az = 0.
00053 if self.gx is None:
00054 self.gx = 0.
00055 if self.gy is None:
00056 self.gy = 0.
00057 if self.gz is None:
00058 self.gz = 0.
00059 if self.roll is None:
00060 self.roll = 0.
00061 if self.pitch is None:
00062 self.pitch = 0.
00063 if self.yaw is None:
00064 self.yaw = 0.
00065 if self.heading is None:
00066 self.heading = 0.
00067 if self.mx is None:
00068 self.mx = 0.
00069 if self.my is None:
00070 self.my = 0.
00071 if self.mz is None:
00072 self.mz = 0.
00073 else:
00074 self.ax = 0.
00075 self.ay = 0.
00076 self.az = 0.
00077 self.gx = 0.
00078 self.gy = 0.
00079 self.gz = 0.
00080 self.roll = 0.
00081 self.pitch = 0.
00082 self.yaw = 0.
00083 self.heading = 0.
00084 self.mx = 0.
00085 self.my = 0.
00086 self.mz = 0.
00087
00088 def _get_types(self):
00089 """
00090 internal API method
00091 """
00092 return self._slot_types
00093
00094 def serialize(self, buff):
00095 """
00096 serialize message into buffer
00097 :param buff: buffer, ``StringIO``
00098 """
00099 try:
00100 _x = self
00101 buff.write(_struct_13f.pack(_x.ax, _x.ay, _x.az, _x.gx, _x.gy, _x.gz, _x.roll, _x.pitch, _x.yaw, _x.heading, _x.mx, _x.my, _x.mz))
00102 except struct.error as se: self._check_types(se)
00103 except TypeError as te: self._check_types(te)
00104
00105 def deserialize(self, str):
00106 """
00107 unpack serialized message in str into this message instance
00108 :param str: byte array of serialized message, ``str``
00109 """
00110 try:
00111 end = 0
00112 _x = self
00113 start = end
00114 end += 52
00115 (_x.ax, _x.ay, _x.az, _x.gx, _x.gy, _x.gz, _x.roll, _x.pitch, _x.yaw, _x.heading, _x.mx, _x.my, _x.mz,) = _struct_13f.unpack(str[start:end])
00116 return self
00117 except struct.error as e:
00118 raise genpy.DeserializationError(e)
00119
00120
00121 def serialize_numpy(self, buff, numpy):
00122 """
00123 serialize message with numpy array types into buffer
00124 :param buff: buffer, ``StringIO``
00125 :param numpy: numpy python module
00126 """
00127 try:
00128 _x = self
00129 buff.write(_struct_13f.pack(_x.ax, _x.ay, _x.az, _x.gx, _x.gy, _x.gz, _x.roll, _x.pitch, _x.yaw, _x.heading, _x.mx, _x.my, _x.mz))
00130 except struct.error as se: self._check_types(se)
00131 except TypeError as te: self._check_types(te)
00132
00133 def deserialize_numpy(self, str, numpy):
00134 """
00135 unpack serialized message in str into this message instance using numpy for array types
00136 :param str: byte array of serialized message, ``str``
00137 :param numpy: numpy python module
00138 """
00139 try:
00140 end = 0
00141 _x = self
00142 start = end
00143 end += 52
00144 (_x.ax, _x.ay, _x.az, _x.gx, _x.gy, _x.gz, _x.roll, _x.pitch, _x.yaw, _x.heading, _x.mx, _x.my, _x.mz,) = _struct_13f.unpack(str[start:end])
00145 return self
00146 except struct.error as e:
00147 raise genpy.DeserializationError(e)
00148
00149 _struct_I = genpy.struct_I
00150 _struct_13f = struct.Struct("<13f")