00001 """autogenerated by genpy from bma180_driver/bma180_measurement.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 std_msgs.msg
00008
00009 class bma180_measurement(genpy.Message):
00010 _md5sum = "0b294026355bac3525529d7c6acb6ac0"
00011 _type = "bma180_driver/bma180_measurement"
00012 _has_header = True
00013 _full_text = """Header header
00014 float64[] AccelerationX
00015 float64[] AccelerationY
00016 float64[] AccelerationZ
00017 float64[] Temperature
00018 float64[] staticRoll
00019 float64[] staticPitch
00020
00021 ================================================================================
00022 MSG: std_msgs/Header
00023 # Standard metadata for higher-level stamped data types.
00024 # This is generally used to communicate timestamped data
00025 # in a particular coordinate frame.
00026 #
00027 # sequence ID: consecutively increasing ID
00028 uint32 seq
00029 #Two-integer timestamp that is expressed as:
00030 # * stamp.secs: seconds (stamp_secs) since epoch
00031 # * stamp.nsecs: nanoseconds since stamp_secs
00032 # time-handling sugar is provided by the client library
00033 time stamp
00034 #Frame this data is associated with
00035 # 0: no frame
00036 # 1: global frame
00037 string frame_id
00038
00039 """
00040 __slots__ = ['header','AccelerationX','AccelerationY','AccelerationZ','Temperature','staticRoll','staticPitch']
00041 _slot_types = ['std_msgs/Header','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]']
00042
00043 def __init__(self, *args, **kwds):
00044 """
00045 Constructor. Any message fields that are implicitly/explicitly
00046 set to None will be assigned a default value. The recommend
00047 use is keyword arguments as this is more robust to future message
00048 changes. You cannot mix in-order arguments and keyword arguments.
00049
00050 The available fields are:
00051 header,AccelerationX,AccelerationY,AccelerationZ,Temperature,staticRoll,staticPitch
00052
00053 :param args: complete set of field values, in .msg order
00054 :param kwds: use keyword arguments corresponding to message field names
00055 to set specific fields.
00056 """
00057 if args or kwds:
00058 super(bma180_measurement, self).__init__(*args, **kwds)
00059
00060 if self.header is None:
00061 self.header = std_msgs.msg.Header()
00062 if self.AccelerationX is None:
00063 self.AccelerationX = []
00064 if self.AccelerationY is None:
00065 self.AccelerationY = []
00066 if self.AccelerationZ is None:
00067 self.AccelerationZ = []
00068 if self.Temperature is None:
00069 self.Temperature = []
00070 if self.staticRoll is None:
00071 self.staticRoll = []
00072 if self.staticPitch is None:
00073 self.staticPitch = []
00074 else:
00075 self.header = std_msgs.msg.Header()
00076 self.AccelerationX = []
00077 self.AccelerationY = []
00078 self.AccelerationZ = []
00079 self.Temperature = []
00080 self.staticRoll = []
00081 self.staticPitch = []
00082
00083 def _get_types(self):
00084 """
00085 internal API method
00086 """
00087 return self._slot_types
00088
00089 def serialize(self, buff):
00090 """
00091 serialize message into buffer
00092 :param buff: buffer, ``StringIO``
00093 """
00094 try:
00095 _x = self
00096 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00097 _x = self.header.frame_id
00098 length = len(_x)
00099 if python3 or type(_x) == unicode:
00100 _x = _x.encode('utf-8')
00101 length = len(_x)
00102 buff.write(struct.pack('<I%ss'%length, length, _x))
00103 length = len(self.AccelerationX)
00104 buff.write(_struct_I.pack(length))
00105 pattern = '<%sd'%length
00106 buff.write(struct.pack(pattern, *self.AccelerationX))
00107 length = len(self.AccelerationY)
00108 buff.write(_struct_I.pack(length))
00109 pattern = '<%sd'%length
00110 buff.write(struct.pack(pattern, *self.AccelerationY))
00111 length = len(self.AccelerationZ)
00112 buff.write(_struct_I.pack(length))
00113 pattern = '<%sd'%length
00114 buff.write(struct.pack(pattern, *self.AccelerationZ))
00115 length = len(self.Temperature)
00116 buff.write(_struct_I.pack(length))
00117 pattern = '<%sd'%length
00118 buff.write(struct.pack(pattern, *self.Temperature))
00119 length = len(self.staticRoll)
00120 buff.write(_struct_I.pack(length))
00121 pattern = '<%sd'%length
00122 buff.write(struct.pack(pattern, *self.staticRoll))
00123 length = len(self.staticPitch)
00124 buff.write(_struct_I.pack(length))
00125 pattern = '<%sd'%length
00126 buff.write(struct.pack(pattern, *self.staticPitch))
00127 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00128 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00129
00130 def deserialize(self, str):
00131 """
00132 unpack serialized message in str into this message instance
00133 :param str: byte array of serialized message, ``str``
00134 """
00135 try:
00136 if self.header is None:
00137 self.header = std_msgs.msg.Header()
00138 end = 0
00139 _x = self
00140 start = end
00141 end += 12
00142 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00143 start = end
00144 end += 4
00145 (length,) = _struct_I.unpack(str[start:end])
00146 start = end
00147 end += length
00148 if python3:
00149 self.header.frame_id = str[start:end].decode('utf-8')
00150 else:
00151 self.header.frame_id = str[start:end]
00152 start = end
00153 end += 4
00154 (length,) = _struct_I.unpack(str[start:end])
00155 pattern = '<%sd'%length
00156 start = end
00157 end += struct.calcsize(pattern)
00158 self.AccelerationX = struct.unpack(pattern, str[start:end])
00159 start = end
00160 end += 4
00161 (length,) = _struct_I.unpack(str[start:end])
00162 pattern = '<%sd'%length
00163 start = end
00164 end += struct.calcsize(pattern)
00165 self.AccelerationY = struct.unpack(pattern, str[start:end])
00166 start = end
00167 end += 4
00168 (length,) = _struct_I.unpack(str[start:end])
00169 pattern = '<%sd'%length
00170 start = end
00171 end += struct.calcsize(pattern)
00172 self.AccelerationZ = struct.unpack(pattern, str[start:end])
00173 start = end
00174 end += 4
00175 (length,) = _struct_I.unpack(str[start:end])
00176 pattern = '<%sd'%length
00177 start = end
00178 end += struct.calcsize(pattern)
00179 self.Temperature = struct.unpack(pattern, str[start:end])
00180 start = end
00181 end += 4
00182 (length,) = _struct_I.unpack(str[start:end])
00183 pattern = '<%sd'%length
00184 start = end
00185 end += struct.calcsize(pattern)
00186 self.staticRoll = struct.unpack(pattern, str[start:end])
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 pattern = '<%sd'%length
00191 start = end
00192 end += struct.calcsize(pattern)
00193 self.staticPitch = struct.unpack(pattern, str[start:end])
00194 return self
00195 except struct.error as e:
00196 raise genpy.DeserializationError(e)
00197
00198
00199 def serialize_numpy(self, buff, numpy):
00200 """
00201 serialize message with numpy array types into buffer
00202 :param buff: buffer, ``StringIO``
00203 :param numpy: numpy python module
00204 """
00205 try:
00206 _x = self
00207 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00208 _x = self.header.frame_id
00209 length = len(_x)
00210 if python3 or type(_x) == unicode:
00211 _x = _x.encode('utf-8')
00212 length = len(_x)
00213 buff.write(struct.pack('<I%ss'%length, length, _x))
00214 length = len(self.AccelerationX)
00215 buff.write(_struct_I.pack(length))
00216 pattern = '<%sd'%length
00217 buff.write(self.AccelerationX.tostring())
00218 length = len(self.AccelerationY)
00219 buff.write(_struct_I.pack(length))
00220 pattern = '<%sd'%length
00221 buff.write(self.AccelerationY.tostring())
00222 length = len(self.AccelerationZ)
00223 buff.write(_struct_I.pack(length))
00224 pattern = '<%sd'%length
00225 buff.write(self.AccelerationZ.tostring())
00226 length = len(self.Temperature)
00227 buff.write(_struct_I.pack(length))
00228 pattern = '<%sd'%length
00229 buff.write(self.Temperature.tostring())
00230 length = len(self.staticRoll)
00231 buff.write(_struct_I.pack(length))
00232 pattern = '<%sd'%length
00233 buff.write(self.staticRoll.tostring())
00234 length = len(self.staticPitch)
00235 buff.write(_struct_I.pack(length))
00236 pattern = '<%sd'%length
00237 buff.write(self.staticPitch.tostring())
00238 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00239 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00240
00241 def deserialize_numpy(self, str, numpy):
00242 """
00243 unpack serialized message in str into this message instance using numpy for array types
00244 :param str: byte array of serialized message, ``str``
00245 :param numpy: numpy python module
00246 """
00247 try:
00248 if self.header is None:
00249 self.header = std_msgs.msg.Header()
00250 end = 0
00251 _x = self
00252 start = end
00253 end += 12
00254 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00255 start = end
00256 end += 4
00257 (length,) = _struct_I.unpack(str[start:end])
00258 start = end
00259 end += length
00260 if python3:
00261 self.header.frame_id = str[start:end].decode('utf-8')
00262 else:
00263 self.header.frame_id = str[start:end]
00264 start = end
00265 end += 4
00266 (length,) = _struct_I.unpack(str[start:end])
00267 pattern = '<%sd'%length
00268 start = end
00269 end += struct.calcsize(pattern)
00270 self.AccelerationX = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00271 start = end
00272 end += 4
00273 (length,) = _struct_I.unpack(str[start:end])
00274 pattern = '<%sd'%length
00275 start = end
00276 end += struct.calcsize(pattern)
00277 self.AccelerationY = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00278 start = end
00279 end += 4
00280 (length,) = _struct_I.unpack(str[start:end])
00281 pattern = '<%sd'%length
00282 start = end
00283 end += struct.calcsize(pattern)
00284 self.AccelerationZ = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00285 start = end
00286 end += 4
00287 (length,) = _struct_I.unpack(str[start:end])
00288 pattern = '<%sd'%length
00289 start = end
00290 end += struct.calcsize(pattern)
00291 self.Temperature = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00292 start = end
00293 end += 4
00294 (length,) = _struct_I.unpack(str[start:end])
00295 pattern = '<%sd'%length
00296 start = end
00297 end += struct.calcsize(pattern)
00298 self.staticRoll = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00299 start = end
00300 end += 4
00301 (length,) = _struct_I.unpack(str[start:end])
00302 pattern = '<%sd'%length
00303 start = end
00304 end += struct.calcsize(pattern)
00305 self.staticPitch = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00306 return self
00307 except struct.error as e:
00308 raise genpy.DeserializationError(e)
00309
00310 _struct_I = genpy.struct_I
00311 _struct_3I = struct.Struct("<3I")