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


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