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


adc_sub20
Author(s): Nikhil Deshpande (Maintained by Philip Roan)
autogenerated on Mon Oct 6 2014 10:10:25