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


proximity_sensor_driver
Author(s): Philip Roan, Joerg Wagner (Maintained by Philip Roan)
autogenerated on Fri Jan 3 2014 11:08:48