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


bmg160_driver
Author(s): Joshua Vasquez, Philip Roan. Maintained by Philip Roan
autogenerated on Mon Oct 6 2014 10:10:13