_GetGrasp.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_object_database_msgs/GetGraspRequest.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 GetGraspRequest(genpy.Message):
00009   _md5sum = "80afe6caba30c992d2e7ff6ff0e0d51e"
00010   _type = "srs_object_database_msgs/GetGraspRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 
00016 int32[] model_ids
00017 
00018 
00019 """
00020   __slots__ = ['model_ids']
00021   _slot_types = ['int32[]']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        model_ids
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(GetGraspRequest, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.model_ids is None:
00041         self.model_ids = []
00042     else:
00043       self.model_ids = []
00044 
00045   def _get_types(self):
00046     """
00047     internal API method
00048     """
00049     return self._slot_types
00050 
00051   def serialize(self, buff):
00052     """
00053     serialize message into buffer
00054     :param buff: buffer, ``StringIO``
00055     """
00056     try:
00057       length = len(self.model_ids)
00058       buff.write(_struct_I.pack(length))
00059       pattern = '<%si'%length
00060       buff.write(struct.pack(pattern, *self.model_ids))
00061     except struct.error as se: self._check_types(se)
00062     except TypeError as te: self._check_types(te)
00063 
00064   def deserialize(self, str):
00065     """
00066     unpack serialized message in str into this message instance
00067     :param str: byte array of serialized message, ``str``
00068     """
00069     try:
00070       end = 0
00071       start = end
00072       end += 4
00073       (length,) = _struct_I.unpack(str[start:end])
00074       pattern = '<%si'%length
00075       start = end
00076       end += struct.calcsize(pattern)
00077       self.model_ids = struct.unpack(pattern, str[start:end])
00078       return self
00079     except struct.error as e:
00080       raise genpy.DeserializationError(e) #most likely buffer underfill
00081 
00082 
00083   def serialize_numpy(self, buff, numpy):
00084     """
00085     serialize message with numpy array types into buffer
00086     :param buff: buffer, ``StringIO``
00087     :param numpy: numpy python module
00088     """
00089     try:
00090       length = len(self.model_ids)
00091       buff.write(_struct_I.pack(length))
00092       pattern = '<%si'%length
00093       buff.write(self.model_ids.tostring())
00094     except struct.error as se: self._check_types(se)
00095     except TypeError as te: self._check_types(te)
00096 
00097   def deserialize_numpy(self, str, numpy):
00098     """
00099     unpack serialized message in str into this message instance using numpy for array types
00100     :param str: byte array of serialized message, ``str``
00101     :param numpy: numpy python module
00102     """
00103     try:
00104       end = 0
00105       start = end
00106       end += 4
00107       (length,) = _struct_I.unpack(str[start:end])
00108       pattern = '<%si'%length
00109       start = end
00110       end += struct.calcsize(pattern)
00111       self.model_ids = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00112       return self
00113     except struct.error as e:
00114       raise genpy.DeserializationError(e) #most likely buffer underfill
00115 
00116 _struct_I = genpy.struct_I
00117 """autogenerated by genpy from srs_object_database_msgs/GetGraspResponse.msg. Do not edit."""
00118 import sys
00119 python3 = True if sys.hexversion > 0x03000000 else False
00120 import genpy
00121 import struct
00122 
00123 import srs_object_database_msgs.msg
00124 
00125 class GetGraspResponse(genpy.Message):
00126   _md5sum = "ceb53febd9683791f1b348a4d33610eb"
00127   _type = "srs_object_database_msgs/GetGraspResponse"
00128   _has_header = False #flag to mark the presence of a Header object
00129   _full_text = """
00130 
00131 string return_response
00132 
00133 srs_object_database_msgs/grasp[] msg
00134 
00135 
00136 
00137 
00138 ================================================================================
00139 MSG: srs_object_database_msgs/grasp
00140 int32 objectId
00141 string Objecttype
00142 string pose
00143 string fileDescription
00144 uint8[] bs
00145 int32 size
00146 
00147 """
00148   __slots__ = ['return_response','msg']
00149   _slot_types = ['string','srs_object_database_msgs/grasp[]']
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        return_response,msg
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(GetGraspResponse, self).__init__(*args, **kwds)
00167       #message fields cannot be None, assign default values for those that are
00168       if self.return_response is None:
00169         self.return_response = ''
00170       if self.msg is None:
00171         self.msg = []
00172     else:
00173       self.return_response = ''
00174       self.msg = []
00175 
00176   def _get_types(self):
00177     """
00178     internal API method
00179     """
00180     return self._slot_types
00181 
00182   def serialize(self, buff):
00183     """
00184     serialize message into buffer
00185     :param buff: buffer, ``StringIO``
00186     """
00187     try:
00188       _x = self.return_response
00189       length = len(_x)
00190       if python3 or type(_x) == unicode:
00191         _x = _x.encode('utf-8')
00192         length = len(_x)
00193       buff.write(struct.pack('<I%ss'%length, length, _x))
00194       length = len(self.msg)
00195       buff.write(_struct_I.pack(length))
00196       for val1 in self.msg:
00197         buff.write(_struct_i.pack(val1.objectId))
00198         _x = val1.Objecttype
00199         length = len(_x)
00200         if python3 or type(_x) == unicode:
00201           _x = _x.encode('utf-8')
00202           length = len(_x)
00203         buff.write(struct.pack('<I%ss'%length, length, _x))
00204         _x = val1.pose
00205         length = len(_x)
00206         if python3 or type(_x) == unicode:
00207           _x = _x.encode('utf-8')
00208           length = len(_x)
00209         buff.write(struct.pack('<I%ss'%length, length, _x))
00210         _x = val1.fileDescription
00211         length = len(_x)
00212         if python3 or type(_x) == unicode:
00213           _x = _x.encode('utf-8')
00214           length = len(_x)
00215         buff.write(struct.pack('<I%ss'%length, length, _x))
00216         _x = val1.bs
00217         length = len(_x)
00218         # - if encoded as a list instead, serialize as bytes instead of string
00219         if type(_x) in [list, tuple]:
00220           buff.write(struct.pack('<I%sB'%length, length, *_x))
00221         else:
00222           buff.write(struct.pack('<I%ss'%length, length, _x))
00223         buff.write(_struct_i.pack(val1.size))
00224     except struct.error as se: self._check_types(se)
00225     except TypeError as te: self._check_types(te)
00226 
00227   def deserialize(self, str):
00228     """
00229     unpack serialized message in str into this message instance
00230     :param str: byte array of serialized message, ``str``
00231     """
00232     try:
00233       if self.msg is None:
00234         self.msg = None
00235       end = 0
00236       start = end
00237       end += 4
00238       (length,) = _struct_I.unpack(str[start:end])
00239       start = end
00240       end += length
00241       if python3:
00242         self.return_response = str[start:end].decode('utf-8')
00243       else:
00244         self.return_response = str[start:end]
00245       start = end
00246       end += 4
00247       (length,) = _struct_I.unpack(str[start:end])
00248       self.msg = []
00249       for i in range(0, length):
00250         val1 = srs_object_database_msgs.msg.grasp()
00251         start = end
00252         end += 4
00253         (val1.objectId,) = _struct_i.unpack(str[start:end])
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.Objecttype = str[start:end].decode('utf-8')
00261         else:
00262           val1.Objecttype = str[start:end]
00263         start = end
00264         end += 4
00265         (length,) = _struct_I.unpack(str[start:end])
00266         start = end
00267         end += length
00268         if python3:
00269           val1.pose = str[start:end].decode('utf-8')
00270         else:
00271           val1.pose = str[start:end]
00272         start = end
00273         end += 4
00274         (length,) = _struct_I.unpack(str[start:end])
00275         start = end
00276         end += length
00277         if python3:
00278           val1.fileDescription = str[start:end].decode('utf-8')
00279         else:
00280           val1.fileDescription = str[start:end]
00281         start = end
00282         end += 4
00283         (length,) = _struct_I.unpack(str[start:end])
00284         start = end
00285         end += length
00286         val1.bs = str[start:end]
00287         start = end
00288         end += 4
00289         (val1.size,) = _struct_i.unpack(str[start:end])
00290         self.msg.append(val1)
00291       return self
00292     except struct.error as e:
00293       raise genpy.DeserializationError(e) #most likely buffer underfill
00294 
00295 
00296   def serialize_numpy(self, buff, numpy):
00297     """
00298     serialize message with numpy array types into buffer
00299     :param buff: buffer, ``StringIO``
00300     :param numpy: numpy python module
00301     """
00302     try:
00303       _x = self.return_response
00304       length = len(_x)
00305       if python3 or type(_x) == unicode:
00306         _x = _x.encode('utf-8')
00307         length = len(_x)
00308       buff.write(struct.pack('<I%ss'%length, length, _x))
00309       length = len(self.msg)
00310       buff.write(_struct_I.pack(length))
00311       for val1 in self.msg:
00312         buff.write(_struct_i.pack(val1.objectId))
00313         _x = val1.Objecttype
00314         length = len(_x)
00315         if python3 or type(_x) == unicode:
00316           _x = _x.encode('utf-8')
00317           length = len(_x)
00318         buff.write(struct.pack('<I%ss'%length, length, _x))
00319         _x = val1.pose
00320         length = len(_x)
00321         if python3 or type(_x) == unicode:
00322           _x = _x.encode('utf-8')
00323           length = len(_x)
00324         buff.write(struct.pack('<I%ss'%length, length, _x))
00325         _x = val1.fileDescription
00326         length = len(_x)
00327         if python3 or type(_x) == unicode:
00328           _x = _x.encode('utf-8')
00329           length = len(_x)
00330         buff.write(struct.pack('<I%ss'%length, length, _x))
00331         _x = val1.bs
00332         length = len(_x)
00333         # - if encoded as a list instead, serialize as bytes instead of string
00334         if type(_x) in [list, tuple]:
00335           buff.write(struct.pack('<I%sB'%length, length, *_x))
00336         else:
00337           buff.write(struct.pack('<I%ss'%length, length, _x))
00338         buff.write(_struct_i.pack(val1.size))
00339     except struct.error as se: self._check_types(se)
00340     except TypeError as te: self._check_types(te)
00341 
00342   def deserialize_numpy(self, str, numpy):
00343     """
00344     unpack serialized message in str into this message instance using numpy for array types
00345     :param str: byte array of serialized message, ``str``
00346     :param numpy: numpy python module
00347     """
00348     try:
00349       if self.msg is None:
00350         self.msg = None
00351       end = 0
00352       start = end
00353       end += 4
00354       (length,) = _struct_I.unpack(str[start:end])
00355       start = end
00356       end += length
00357       if python3:
00358         self.return_response = str[start:end].decode('utf-8')
00359       else:
00360         self.return_response = str[start:end]
00361       start = end
00362       end += 4
00363       (length,) = _struct_I.unpack(str[start:end])
00364       self.msg = []
00365       for i in range(0, length):
00366         val1 = srs_object_database_msgs.msg.grasp()
00367         start = end
00368         end += 4
00369         (val1.objectId,) = _struct_i.unpack(str[start:end])
00370         start = end
00371         end += 4
00372         (length,) = _struct_I.unpack(str[start:end])
00373         start = end
00374         end += length
00375         if python3:
00376           val1.Objecttype = str[start:end].decode('utf-8')
00377         else:
00378           val1.Objecttype = str[start:end]
00379         start = end
00380         end += 4
00381         (length,) = _struct_I.unpack(str[start:end])
00382         start = end
00383         end += length
00384         if python3:
00385           val1.pose = str[start:end].decode('utf-8')
00386         else:
00387           val1.pose = str[start:end]
00388         start = end
00389         end += 4
00390         (length,) = _struct_I.unpack(str[start:end])
00391         start = end
00392         end += length
00393         if python3:
00394           val1.fileDescription = str[start:end].decode('utf-8')
00395         else:
00396           val1.fileDescription = str[start:end]
00397         start = end
00398         end += 4
00399         (length,) = _struct_I.unpack(str[start:end])
00400         start = end
00401         end += length
00402         val1.bs = str[start:end]
00403         start = end
00404         end += 4
00405         (val1.size,) = _struct_i.unpack(str[start:end])
00406         self.msg.append(val1)
00407       return self
00408     except struct.error as e:
00409       raise genpy.DeserializationError(e) #most likely buffer underfill
00410 
00411 _struct_I = genpy.struct_I
00412 _struct_i = struct.Struct("<i")
00413 class GetGrasp(object):
00414   _type          = 'srs_object_database_msgs/GetGrasp'
00415   _md5sum = 'c0202fe21a6c8d396a99038df29693dc'
00416   _request_class  = GetGraspRequest
00417   _response_class = GetGraspResponse


srs_object_database_msgs
Author(s): Georg Arbeiter
autogenerated on Wed Nov 27 2013 14:14:38