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


rfid_behaviors
Author(s): Travis Deyle
autogenerated on Wed Nov 27 2013 11:50:14