_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         if python3:
00287           val1.bs = str[start:end].decode('utf-8')
00288         else:
00289           val1.bs = str[start:end]
00290         start = end
00291         end += 4
00292         (val1.size,) = _struct_i.unpack(str[start:end])
00293         self.msg.append(val1)
00294       return self
00295     except struct.error as e:
00296       raise genpy.DeserializationError(e) #most likely buffer underfill
00297 
00298 
00299   def serialize_numpy(self, buff, numpy):
00300     """
00301     serialize message with numpy array types into buffer
00302     :param buff: buffer, ``StringIO``
00303     :param numpy: numpy python module
00304     """
00305     try:
00306       _x = self.return_response
00307       length = len(_x)
00308       if python3 or type(_x) == unicode:
00309         _x = _x.encode('utf-8')
00310         length = len(_x)
00311       buff.write(struct.pack('<I%ss'%length, length, _x))
00312       length = len(self.msg)
00313       buff.write(_struct_I.pack(length))
00314       for val1 in self.msg:
00315         buff.write(_struct_i.pack(val1.objectId))
00316         _x = val1.Objecttype
00317         length = len(_x)
00318         if python3 or type(_x) == unicode:
00319           _x = _x.encode('utf-8')
00320           length = len(_x)
00321         buff.write(struct.pack('<I%ss'%length, length, _x))
00322         _x = val1.pose
00323         length = len(_x)
00324         if python3 or type(_x) == unicode:
00325           _x = _x.encode('utf-8')
00326           length = len(_x)
00327         buff.write(struct.pack('<I%ss'%length, length, _x))
00328         _x = val1.fileDescription
00329         length = len(_x)
00330         if python3 or type(_x) == unicode:
00331           _x = _x.encode('utf-8')
00332           length = len(_x)
00333         buff.write(struct.pack('<I%ss'%length, length, _x))
00334         _x = val1.bs
00335         length = len(_x)
00336         # - if encoded as a list instead, serialize as bytes instead of string
00337         if type(_x) in [list, tuple]:
00338           buff.write(struct.pack('<I%sB'%length, length, *_x))
00339         else:
00340           buff.write(struct.pack('<I%ss'%length, length, _x))
00341         buff.write(_struct_i.pack(val1.size))
00342     except struct.error as se: self._check_types(se)
00343     except TypeError as te: self._check_types(te)
00344 
00345   def deserialize_numpy(self, str, numpy):
00346     """
00347     unpack serialized message in str into this message instance using numpy for array types
00348     :param str: byte array of serialized message, ``str``
00349     :param numpy: numpy python module
00350     """
00351     try:
00352       if self.msg is None:
00353         self.msg = None
00354       end = 0
00355       start = end
00356       end += 4
00357       (length,) = _struct_I.unpack(str[start:end])
00358       start = end
00359       end += length
00360       if python3:
00361         self.return_response = str[start:end].decode('utf-8')
00362       else:
00363         self.return_response = str[start:end]
00364       start = end
00365       end += 4
00366       (length,) = _struct_I.unpack(str[start:end])
00367       self.msg = []
00368       for i in range(0, length):
00369         val1 = srs_object_database_msgs.msg.grasp()
00370         start = end
00371         end += 4
00372         (val1.objectId,) = _struct_i.unpack(str[start:end])
00373         start = end
00374         end += 4
00375         (length,) = _struct_I.unpack(str[start:end])
00376         start = end
00377         end += length
00378         if python3:
00379           val1.Objecttype = str[start:end].decode('utf-8')
00380         else:
00381           val1.Objecttype = str[start:end]
00382         start = end
00383         end += 4
00384         (length,) = _struct_I.unpack(str[start:end])
00385         start = end
00386         end += length
00387         if python3:
00388           val1.pose = str[start:end].decode('utf-8')
00389         else:
00390           val1.pose = str[start:end]
00391         start = end
00392         end += 4
00393         (length,) = _struct_I.unpack(str[start:end])
00394         start = end
00395         end += length
00396         if python3:
00397           val1.fileDescription = str[start:end].decode('utf-8')
00398         else:
00399           val1.fileDescription = str[start:end]
00400         start = end
00401         end += 4
00402         (length,) = _struct_I.unpack(str[start:end])
00403         start = end
00404         end += length
00405         if python3:
00406           val1.bs = str[start:end].decode('utf-8')
00407         else:
00408           val1.bs = str[start:end]
00409         start = end
00410         end += 4
00411         (val1.size,) = _struct_i.unpack(str[start:end])
00412         self.msg.append(val1)
00413       return self
00414     except struct.error as e:
00415       raise genpy.DeserializationError(e) #most likely buffer underfill
00416 
00417 _struct_I = genpy.struct_I
00418 _struct_i = struct.Struct("<i")
00419 class GetGrasp(object):
00420   _type          = 'srs_object_database_msgs/GetGrasp'
00421   _md5sum = 'c0202fe21a6c8d396a99038df29693dc'
00422   _request_class  = GetGraspRequest
00423   _response_class = GetGraspResponse


srs_object_database_msgs
Author(s): Georg Arbeiter
autogenerated on Sun Jan 5 2014 11:36:25