_RfidSrv.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrl_rfid/RfidSrvRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class RfidSrvRequest(genpy.Message):
00009   _md5sum = "cce5a364f3a3be12c9722c6dcad2fa94"
00010   _type = "hrl_rfid/RfidSrvRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string[] data
00013 
00014 """
00015   __slots__ = ['data']
00016   _slot_types = ['string[]']
00017 
00018   def __init__(self, *args, **kwds):
00019     """
00020     Constructor. Any message fields that are implicitly/explicitly
00021     set to None will be assigned a default value. The recommend
00022     use is keyword arguments as this is more robust to future message
00023     changes.  You cannot mix in-order arguments and keyword arguments.
00024 
00025     The available fields are:
00026        data
00027 
00028     :param args: complete set of field values, in .msg order
00029     :param kwds: use keyword arguments corresponding to message field names
00030     to set specific fields.
00031     """
00032     if args or kwds:
00033       super(RfidSrvRequest, self).__init__(*args, **kwds)
00034       #message fields cannot be None, assign default values for those that are
00035       if self.data is None:
00036         self.data = []
00037     else:
00038       self.data = []
00039 
00040   def _get_types(self):
00041     """
00042     internal API method
00043     """
00044     return self._slot_types
00045 
00046   def serialize(self, buff):
00047     """
00048     serialize message into buffer
00049     :param buff: buffer, ``StringIO``
00050     """
00051     try:
00052       length = len(self.data)
00053       buff.write(_struct_I.pack(length))
00054       for val1 in self.data:
00055         length = len(val1)
00056         if python3 or type(val1) == unicode:
00057           val1 = val1.encode('utf-8')
00058           length = len(val1)
00059         buff.write(struct.pack('<I%ss'%length, length, val1))
00060     except struct.error as se: self._check_types(se)
00061     except TypeError as te: self._check_types(te)
00062 
00063   def deserialize(self, str):
00064     """
00065     unpack serialized message in str into this message instance
00066     :param str: byte array of serialized message, ``str``
00067     """
00068     try:
00069       end = 0
00070       start = end
00071       end += 4
00072       (length,) = _struct_I.unpack(str[start:end])
00073       self.data = []
00074       for i in range(0, length):
00075         start = end
00076         end += 4
00077         (length,) = _struct_I.unpack(str[start:end])
00078         start = end
00079         end += length
00080         if python3:
00081           val1 = str[start:end].decode('utf-8')
00082         else:
00083           val1 = str[start:end]
00084         self.data.append(val1)
00085       return self
00086     except struct.error as e:
00087       raise genpy.DeserializationError(e) #most likely buffer underfill
00088 
00089 
00090   def serialize_numpy(self, buff, numpy):
00091     """
00092     serialize message with numpy array types into buffer
00093     :param buff: buffer, ``StringIO``
00094     :param numpy: numpy python module
00095     """
00096     try:
00097       length = len(self.data)
00098       buff.write(_struct_I.pack(length))
00099       for val1 in self.data:
00100         length = len(val1)
00101         if python3 or type(val1) == unicode:
00102           val1 = val1.encode('utf-8')
00103           length = len(val1)
00104         buff.write(struct.pack('<I%ss'%length, length, val1))
00105     except struct.error as se: self._check_types(se)
00106     except TypeError as te: self._check_types(te)
00107 
00108   def deserialize_numpy(self, str, numpy):
00109     """
00110     unpack serialized message in str into this message instance using numpy for array types
00111     :param str: byte array of serialized message, ``str``
00112     :param numpy: numpy python module
00113     """
00114     try:
00115       end = 0
00116       start = end
00117       end += 4
00118       (length,) = _struct_I.unpack(str[start:end])
00119       self.data = []
00120       for i in range(0, length):
00121         start = end
00122         end += 4
00123         (length,) = _struct_I.unpack(str[start:end])
00124         start = end
00125         end += length
00126         if python3:
00127           val1 = str[start:end].decode('utf-8')
00128         else:
00129           val1 = str[start:end]
00130         self.data.append(val1)
00131       return self
00132     except struct.error as e:
00133       raise genpy.DeserializationError(e) #most likely buffer underfill
00134 
00135 _struct_I = genpy.struct_I
00136 """autogenerated by genpy from hrl_rfid/RfidSrvResponse.msg. Do not edit."""
00137 import sys
00138 python3 = True if sys.hexversion > 0x03000000 else False
00139 import genpy
00140 import struct
00141 
00142 
00143 class RfidSrvResponse(genpy.Message):
00144   _md5sum = "2f489a92a80f77ccc2a04104e2d9e875"
00145   _type = "hrl_rfid/RfidSrvResponse"
00146   _has_header = False #flag to mark the presence of a Header object
00147   _full_text = """bool rv
00148 
00149 """
00150   __slots__ = ['rv']
00151   _slot_types = ['bool']
00152 
00153   def __init__(self, *args, **kwds):
00154     """
00155     Constructor. Any message fields that are implicitly/explicitly
00156     set to None will be assigned a default value. The recommend
00157     use is keyword arguments as this is more robust to future message
00158     changes.  You cannot mix in-order arguments and keyword arguments.
00159 
00160     The available fields are:
00161        rv
00162 
00163     :param args: complete set of field values, in .msg order
00164     :param kwds: use keyword arguments corresponding to message field names
00165     to set specific fields.
00166     """
00167     if args or kwds:
00168       super(RfidSrvResponse, self).__init__(*args, **kwds)
00169       #message fields cannot be None, assign default values for those that are
00170       if self.rv is None:
00171         self.rv = False
00172     else:
00173       self.rv = False
00174 
00175   def _get_types(self):
00176     """
00177     internal API method
00178     """
00179     return self._slot_types
00180 
00181   def serialize(self, buff):
00182     """
00183     serialize message into buffer
00184     :param buff: buffer, ``StringIO``
00185     """
00186     try:
00187       buff.write(_struct_B.pack(self.rv))
00188     except struct.error as se: self._check_types(se)
00189     except TypeError as te: self._check_types(te)
00190 
00191   def deserialize(self, str):
00192     """
00193     unpack serialized message in str into this message instance
00194     :param str: byte array of serialized message, ``str``
00195     """
00196     try:
00197       end = 0
00198       start = end
00199       end += 1
00200       (self.rv,) = _struct_B.unpack(str[start:end])
00201       self.rv = bool(self.rv)
00202       return self
00203     except struct.error as e:
00204       raise genpy.DeserializationError(e) #most likely buffer underfill
00205 
00206 
00207   def serialize_numpy(self, buff, numpy):
00208     """
00209     serialize message with numpy array types into buffer
00210     :param buff: buffer, ``StringIO``
00211     :param numpy: numpy python module
00212     """
00213     try:
00214       buff.write(_struct_B.pack(self.rv))
00215     except struct.error as se: self._check_types(se)
00216     except TypeError as te: self._check_types(te)
00217 
00218   def deserialize_numpy(self, str, numpy):
00219     """
00220     unpack serialized message in str into this message instance using numpy for array types
00221     :param str: byte array of serialized message, ``str``
00222     :param numpy: numpy python module
00223     """
00224     try:
00225       end = 0
00226       start = end
00227       end += 1
00228       (self.rv,) = _struct_B.unpack(str[start:end])
00229       self.rv = bool(self.rv)
00230       return self
00231     except struct.error as e:
00232       raise genpy.DeserializationError(e) #most likely buffer underfill
00233 
00234 _struct_I = genpy.struct_I
00235 _struct_B = struct.Struct("<B")
00236 class RfidSrv(object):
00237   _type          = 'hrl_rfid/RfidSrv'
00238   _md5sum = '9ee8f561013000457944104727ead00a'
00239   _request_class  = RfidSrvRequest
00240   _response_class = RfidSrvResponse


hrl_rfid
Author(s): Travis Deyle, Advisor: Prof. Charlie Kemp (Healthcare Robotics Lab at Georgia Tech) and Prof. Matt Reynolds (Duke University)
autogenerated on Wed Nov 27 2013 11:32:45