_GetObjectId.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_object_database_msgs/GetObjectIdRequest.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 GetObjectIdRequest(genpy.Message):
00009   _md5sum = "a10cc611c498c0243a6ab6d33b407956"
00010   _type = "srs_object_database_msgs/GetObjectIdRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 
00016 
00017 string type
00018 
00019 string item
00020 
00021 
00022 """
00023   __slots__ = ['type','item']
00024   _slot_types = ['string','string']
00025 
00026   def __init__(self, *args, **kwds):
00027     """
00028     Constructor. Any message fields that are implicitly/explicitly
00029     set to None will be assigned a default value. The recommend
00030     use is keyword arguments as this is more robust to future message
00031     changes.  You cannot mix in-order arguments and keyword arguments.
00032 
00033     The available fields are:
00034        type,item
00035 
00036     :param args: complete set of field values, in .msg order
00037     :param kwds: use keyword arguments corresponding to message field names
00038     to set specific fields.
00039     """
00040     if args or kwds:
00041       super(GetObjectIdRequest, self).__init__(*args, **kwds)
00042       #message fields cannot be None, assign default values for those that are
00043       if self.type is None:
00044         self.type = ''
00045       if self.item is None:
00046         self.item = ''
00047     else:
00048       self.type = ''
00049       self.item = ''
00050 
00051   def _get_types(self):
00052     """
00053     internal API method
00054     """
00055     return self._slot_types
00056 
00057   def serialize(self, buff):
00058     """
00059     serialize message into buffer
00060     :param buff: buffer, ``StringIO``
00061     """
00062     try:
00063       _x = self.type
00064       length = len(_x)
00065       if python3 or type(_x) == unicode:
00066         _x = _x.encode('utf-8')
00067         length = len(_x)
00068       buff.write(struct.pack('<I%ss'%length, length, _x))
00069       _x = self.item
00070       length = len(_x)
00071       if python3 or type(_x) == unicode:
00072         _x = _x.encode('utf-8')
00073         length = len(_x)
00074       buff.write(struct.pack('<I%ss'%length, length, _x))
00075     except struct.error as se: self._check_types(se)
00076     except TypeError as te: self._check_types(te)
00077 
00078   def deserialize(self, str):
00079     """
00080     unpack serialized message in str into this message instance
00081     :param str: byte array of serialized message, ``str``
00082     """
00083     try:
00084       end = 0
00085       start = end
00086       end += 4
00087       (length,) = _struct_I.unpack(str[start:end])
00088       start = end
00089       end += length
00090       if python3:
00091         self.type = str[start:end].decode('utf-8')
00092       else:
00093         self.type = str[start:end]
00094       start = end
00095       end += 4
00096       (length,) = _struct_I.unpack(str[start:end])
00097       start = end
00098       end += length
00099       if python3:
00100         self.item = str[start:end].decode('utf-8')
00101       else:
00102         self.item = str[start:end]
00103       return self
00104     except struct.error as e:
00105       raise genpy.DeserializationError(e) #most likely buffer underfill
00106 
00107 
00108   def serialize_numpy(self, buff, numpy):
00109     """
00110     serialize message with numpy array types into buffer
00111     :param buff: buffer, ``StringIO``
00112     :param numpy: numpy python module
00113     """
00114     try:
00115       _x = self.type
00116       length = len(_x)
00117       if python3 or type(_x) == unicode:
00118         _x = _x.encode('utf-8')
00119         length = len(_x)
00120       buff.write(struct.pack('<I%ss'%length, length, _x))
00121       _x = self.item
00122       length = len(_x)
00123       if python3 or type(_x) == unicode:
00124         _x = _x.encode('utf-8')
00125         length = len(_x)
00126       buff.write(struct.pack('<I%ss'%length, length, _x))
00127     except struct.error as se: self._check_types(se)
00128     except TypeError as te: self._check_types(te)
00129 
00130   def deserialize_numpy(self, str, numpy):
00131     """
00132     unpack serialized message in str into this message instance using numpy for array types
00133     :param str: byte array of serialized message, ``str``
00134     :param numpy: numpy python module
00135     """
00136     try:
00137       end = 0
00138       start = end
00139       end += 4
00140       (length,) = _struct_I.unpack(str[start:end])
00141       start = end
00142       end += length
00143       if python3:
00144         self.type = str[start:end].decode('utf-8')
00145       else:
00146         self.type = str[start:end]
00147       start = end
00148       end += 4
00149       (length,) = _struct_I.unpack(str[start:end])
00150       start = end
00151       end += length
00152       if python3:
00153         self.item = str[start:end].decode('utf-8')
00154       else:
00155         self.item = str[start:end]
00156       return self
00157     except struct.error as e:
00158       raise genpy.DeserializationError(e) #most likely buffer underfill
00159 
00160 _struct_I = genpy.struct_I
00161 """autogenerated by genpy from srs_object_database_msgs/GetObjectIdResponse.msg. Do not edit."""
00162 import sys
00163 python3 = True if sys.hexversion > 0x03000000 else False
00164 import genpy
00165 import struct
00166 
00167 
00168 class GetObjectIdResponse(genpy.Message):
00169   _md5sum = "28c1f9c30f6beebadf0ced5cfa630c49"
00170   _type = "srs_object_database_msgs/GetObjectIdResponse"
00171   _has_header = False #flag to mark the presence of a Header object
00172   _full_text = """
00173 
00174 string return_response
00175 
00176 
00177 int32[] model_ids
00178 
00179 
00180 string[] model_desc
00181 
00182 
00183 string[] version
00184 
00185 
00186 string[] model_category
00187 
00188 
00189 bool[] graspable
00190 
00191 
00192 float32[] model_x_size
00193 
00194 
00195 float32[] model_y_size
00196 
00197 
00198 float32[] model_z_size
00199 
00200 
00201 string[] model_basic_shape
00202 
00203 
00204 """
00205   __slots__ = ['return_response','model_ids','model_desc','version','model_category','graspable','model_x_size','model_y_size','model_z_size','model_basic_shape']
00206   _slot_types = ['string','int32[]','string[]','string[]','string[]','bool[]','float32[]','float32[]','float32[]','string[]']
00207 
00208   def __init__(self, *args, **kwds):
00209     """
00210     Constructor. Any message fields that are implicitly/explicitly
00211     set to None will be assigned a default value. The recommend
00212     use is keyword arguments as this is more robust to future message
00213     changes.  You cannot mix in-order arguments and keyword arguments.
00214 
00215     The available fields are:
00216        return_response,model_ids,model_desc,version,model_category,graspable,model_x_size,model_y_size,model_z_size,model_basic_shape
00217 
00218     :param args: complete set of field values, in .msg order
00219     :param kwds: use keyword arguments corresponding to message field names
00220     to set specific fields.
00221     """
00222     if args or kwds:
00223       super(GetObjectIdResponse, self).__init__(*args, **kwds)
00224       #message fields cannot be None, assign default values for those that are
00225       if self.return_response is None:
00226         self.return_response = ''
00227       if self.model_ids is None:
00228         self.model_ids = []
00229       if self.model_desc is None:
00230         self.model_desc = []
00231       if self.version is None:
00232         self.version = []
00233       if self.model_category is None:
00234         self.model_category = []
00235       if self.graspable is None:
00236         self.graspable = []
00237       if self.model_x_size is None:
00238         self.model_x_size = []
00239       if self.model_y_size is None:
00240         self.model_y_size = []
00241       if self.model_z_size is None:
00242         self.model_z_size = []
00243       if self.model_basic_shape is None:
00244         self.model_basic_shape = []
00245     else:
00246       self.return_response = ''
00247       self.model_ids = []
00248       self.model_desc = []
00249       self.version = []
00250       self.model_category = []
00251       self.graspable = []
00252       self.model_x_size = []
00253       self.model_y_size = []
00254       self.model_z_size = []
00255       self.model_basic_shape = []
00256 
00257   def _get_types(self):
00258     """
00259     internal API method
00260     """
00261     return self._slot_types
00262 
00263   def serialize(self, buff):
00264     """
00265     serialize message into buffer
00266     :param buff: buffer, ``StringIO``
00267     """
00268     try:
00269       _x = self.return_response
00270       length = len(_x)
00271       if python3 or type(_x) == unicode:
00272         _x = _x.encode('utf-8')
00273         length = len(_x)
00274       buff.write(struct.pack('<I%ss'%length, length, _x))
00275       length = len(self.model_ids)
00276       buff.write(_struct_I.pack(length))
00277       pattern = '<%si'%length
00278       buff.write(struct.pack(pattern, *self.model_ids))
00279       length = len(self.model_desc)
00280       buff.write(_struct_I.pack(length))
00281       for val1 in self.model_desc:
00282         length = len(val1)
00283         if python3 or type(val1) == unicode:
00284           val1 = val1.encode('utf-8')
00285           length = len(val1)
00286         buff.write(struct.pack('<I%ss'%length, length, val1))
00287       length = len(self.version)
00288       buff.write(_struct_I.pack(length))
00289       for val1 in self.version:
00290         length = len(val1)
00291         if python3 or type(val1) == unicode:
00292           val1 = val1.encode('utf-8')
00293           length = len(val1)
00294         buff.write(struct.pack('<I%ss'%length, length, val1))
00295       length = len(self.model_category)
00296       buff.write(_struct_I.pack(length))
00297       for val1 in self.model_category:
00298         length = len(val1)
00299         if python3 or type(val1) == unicode:
00300           val1 = val1.encode('utf-8')
00301           length = len(val1)
00302         buff.write(struct.pack('<I%ss'%length, length, val1))
00303       length = len(self.graspable)
00304       buff.write(_struct_I.pack(length))
00305       pattern = '<%sB'%length
00306       buff.write(struct.pack(pattern, *self.graspable))
00307       length = len(self.model_x_size)
00308       buff.write(_struct_I.pack(length))
00309       pattern = '<%sf'%length
00310       buff.write(struct.pack(pattern, *self.model_x_size))
00311       length = len(self.model_y_size)
00312       buff.write(_struct_I.pack(length))
00313       pattern = '<%sf'%length
00314       buff.write(struct.pack(pattern, *self.model_y_size))
00315       length = len(self.model_z_size)
00316       buff.write(_struct_I.pack(length))
00317       pattern = '<%sf'%length
00318       buff.write(struct.pack(pattern, *self.model_z_size))
00319       length = len(self.model_basic_shape)
00320       buff.write(_struct_I.pack(length))
00321       for val1 in self.model_basic_shape:
00322         length = len(val1)
00323         if python3 or type(val1) == unicode:
00324           val1 = val1.encode('utf-8')
00325           length = len(val1)
00326         buff.write(struct.pack('<I%ss'%length, length, val1))
00327     except struct.error as se: self._check_types(se)
00328     except TypeError as te: self._check_types(te)
00329 
00330   def deserialize(self, str):
00331     """
00332     unpack serialized message in str into this message instance
00333     :param str: byte array of serialized message, ``str``
00334     """
00335     try:
00336       end = 0
00337       start = end
00338       end += 4
00339       (length,) = _struct_I.unpack(str[start:end])
00340       start = end
00341       end += length
00342       if python3:
00343         self.return_response = str[start:end].decode('utf-8')
00344       else:
00345         self.return_response = str[start:end]
00346       start = end
00347       end += 4
00348       (length,) = _struct_I.unpack(str[start:end])
00349       pattern = '<%si'%length
00350       start = end
00351       end += struct.calcsize(pattern)
00352       self.model_ids = struct.unpack(pattern, str[start:end])
00353       start = end
00354       end += 4
00355       (length,) = _struct_I.unpack(str[start:end])
00356       self.model_desc = []
00357       for i in range(0, length):
00358         start = end
00359         end += 4
00360         (length,) = _struct_I.unpack(str[start:end])
00361         start = end
00362         end += length
00363         if python3:
00364           val1 = str[start:end].decode('utf-8')
00365         else:
00366           val1 = str[start:end]
00367         self.model_desc.append(val1)
00368       start = end
00369       end += 4
00370       (length,) = _struct_I.unpack(str[start:end])
00371       self.version = []
00372       for i in range(0, length):
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 = str[start:end].decode('utf-8')
00380         else:
00381           val1 = str[start:end]
00382         self.version.append(val1)
00383       start = end
00384       end += 4
00385       (length,) = _struct_I.unpack(str[start:end])
00386       self.model_category = []
00387       for i in range(0, length):
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 = str[start:end].decode('utf-8')
00395         else:
00396           val1 = str[start:end]
00397         self.model_category.append(val1)
00398       start = end
00399       end += 4
00400       (length,) = _struct_I.unpack(str[start:end])
00401       pattern = '<%sB'%length
00402       start = end
00403       end += struct.calcsize(pattern)
00404       self.graspable = struct.unpack(pattern, str[start:end])
00405       self.graspable = map(bool, self.graspable)
00406       start = end
00407       end += 4
00408       (length,) = _struct_I.unpack(str[start:end])
00409       pattern = '<%sf'%length
00410       start = end
00411       end += struct.calcsize(pattern)
00412       self.model_x_size = struct.unpack(pattern, str[start:end])
00413       start = end
00414       end += 4
00415       (length,) = _struct_I.unpack(str[start:end])
00416       pattern = '<%sf'%length
00417       start = end
00418       end += struct.calcsize(pattern)
00419       self.model_y_size = struct.unpack(pattern, str[start:end])
00420       start = end
00421       end += 4
00422       (length,) = _struct_I.unpack(str[start:end])
00423       pattern = '<%sf'%length
00424       start = end
00425       end += struct.calcsize(pattern)
00426       self.model_z_size = struct.unpack(pattern, str[start:end])
00427       start = end
00428       end += 4
00429       (length,) = _struct_I.unpack(str[start:end])
00430       self.model_basic_shape = []
00431       for i in range(0, length):
00432         start = end
00433         end += 4
00434         (length,) = _struct_I.unpack(str[start:end])
00435         start = end
00436         end += length
00437         if python3:
00438           val1 = str[start:end].decode('utf-8')
00439         else:
00440           val1 = str[start:end]
00441         self.model_basic_shape.append(val1)
00442       return self
00443     except struct.error as e:
00444       raise genpy.DeserializationError(e) #most likely buffer underfill
00445 
00446 
00447   def serialize_numpy(self, buff, numpy):
00448     """
00449     serialize message with numpy array types into buffer
00450     :param buff: buffer, ``StringIO``
00451     :param numpy: numpy python module
00452     """
00453     try:
00454       _x = self.return_response
00455       length = len(_x)
00456       if python3 or type(_x) == unicode:
00457         _x = _x.encode('utf-8')
00458         length = len(_x)
00459       buff.write(struct.pack('<I%ss'%length, length, _x))
00460       length = len(self.model_ids)
00461       buff.write(_struct_I.pack(length))
00462       pattern = '<%si'%length
00463       buff.write(self.model_ids.tostring())
00464       length = len(self.model_desc)
00465       buff.write(_struct_I.pack(length))
00466       for val1 in self.model_desc:
00467         length = len(val1)
00468         if python3 or type(val1) == unicode:
00469           val1 = val1.encode('utf-8')
00470           length = len(val1)
00471         buff.write(struct.pack('<I%ss'%length, length, val1))
00472       length = len(self.version)
00473       buff.write(_struct_I.pack(length))
00474       for val1 in self.version:
00475         length = len(val1)
00476         if python3 or type(val1) == unicode:
00477           val1 = val1.encode('utf-8')
00478           length = len(val1)
00479         buff.write(struct.pack('<I%ss'%length, length, val1))
00480       length = len(self.model_category)
00481       buff.write(_struct_I.pack(length))
00482       for val1 in self.model_category:
00483         length = len(val1)
00484         if python3 or type(val1) == unicode:
00485           val1 = val1.encode('utf-8')
00486           length = len(val1)
00487         buff.write(struct.pack('<I%ss'%length, length, val1))
00488       length = len(self.graspable)
00489       buff.write(_struct_I.pack(length))
00490       pattern = '<%sB'%length
00491       buff.write(self.graspable.tostring())
00492       length = len(self.model_x_size)
00493       buff.write(_struct_I.pack(length))
00494       pattern = '<%sf'%length
00495       buff.write(self.model_x_size.tostring())
00496       length = len(self.model_y_size)
00497       buff.write(_struct_I.pack(length))
00498       pattern = '<%sf'%length
00499       buff.write(self.model_y_size.tostring())
00500       length = len(self.model_z_size)
00501       buff.write(_struct_I.pack(length))
00502       pattern = '<%sf'%length
00503       buff.write(self.model_z_size.tostring())
00504       length = len(self.model_basic_shape)
00505       buff.write(_struct_I.pack(length))
00506       for val1 in self.model_basic_shape:
00507         length = len(val1)
00508         if python3 or type(val1) == unicode:
00509           val1 = val1.encode('utf-8')
00510           length = len(val1)
00511         buff.write(struct.pack('<I%ss'%length, length, val1))
00512     except struct.error as se: self._check_types(se)
00513     except TypeError as te: self._check_types(te)
00514 
00515   def deserialize_numpy(self, str, numpy):
00516     """
00517     unpack serialized message in str into this message instance using numpy for array types
00518     :param str: byte array of serialized message, ``str``
00519     :param numpy: numpy python module
00520     """
00521     try:
00522       end = 0
00523       start = end
00524       end += 4
00525       (length,) = _struct_I.unpack(str[start:end])
00526       start = end
00527       end += length
00528       if python3:
00529         self.return_response = str[start:end].decode('utf-8')
00530       else:
00531         self.return_response = str[start:end]
00532       start = end
00533       end += 4
00534       (length,) = _struct_I.unpack(str[start:end])
00535       pattern = '<%si'%length
00536       start = end
00537       end += struct.calcsize(pattern)
00538       self.model_ids = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00539       start = end
00540       end += 4
00541       (length,) = _struct_I.unpack(str[start:end])
00542       self.model_desc = []
00543       for i in range(0, length):
00544         start = end
00545         end += 4
00546         (length,) = _struct_I.unpack(str[start:end])
00547         start = end
00548         end += length
00549         if python3:
00550           val1 = str[start:end].decode('utf-8')
00551         else:
00552           val1 = str[start:end]
00553         self.model_desc.append(val1)
00554       start = end
00555       end += 4
00556       (length,) = _struct_I.unpack(str[start:end])
00557       self.version = []
00558       for i in range(0, length):
00559         start = end
00560         end += 4
00561         (length,) = _struct_I.unpack(str[start:end])
00562         start = end
00563         end += length
00564         if python3:
00565           val1 = str[start:end].decode('utf-8')
00566         else:
00567           val1 = str[start:end]
00568         self.version.append(val1)
00569       start = end
00570       end += 4
00571       (length,) = _struct_I.unpack(str[start:end])
00572       self.model_category = []
00573       for i in range(0, length):
00574         start = end
00575         end += 4
00576         (length,) = _struct_I.unpack(str[start:end])
00577         start = end
00578         end += length
00579         if python3:
00580           val1 = str[start:end].decode('utf-8')
00581         else:
00582           val1 = str[start:end]
00583         self.model_category.append(val1)
00584       start = end
00585       end += 4
00586       (length,) = _struct_I.unpack(str[start:end])
00587       pattern = '<%sB'%length
00588       start = end
00589       end += struct.calcsize(pattern)
00590       self.graspable = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length)
00591       self.graspable = map(bool, self.graspable)
00592       start = end
00593       end += 4
00594       (length,) = _struct_I.unpack(str[start:end])
00595       pattern = '<%sf'%length
00596       start = end
00597       end += struct.calcsize(pattern)
00598       self.model_x_size = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00599       start = end
00600       end += 4
00601       (length,) = _struct_I.unpack(str[start:end])
00602       pattern = '<%sf'%length
00603       start = end
00604       end += struct.calcsize(pattern)
00605       self.model_y_size = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00606       start = end
00607       end += 4
00608       (length,) = _struct_I.unpack(str[start:end])
00609       pattern = '<%sf'%length
00610       start = end
00611       end += struct.calcsize(pattern)
00612       self.model_z_size = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00613       start = end
00614       end += 4
00615       (length,) = _struct_I.unpack(str[start:end])
00616       self.model_basic_shape = []
00617       for i in range(0, length):
00618         start = end
00619         end += 4
00620         (length,) = _struct_I.unpack(str[start:end])
00621         start = end
00622         end += length
00623         if python3:
00624           val1 = str[start:end].decode('utf-8')
00625         else:
00626           val1 = str[start:end]
00627         self.model_basic_shape.append(val1)
00628       return self
00629     except struct.error as e:
00630       raise genpy.DeserializationError(e) #most likely buffer underfill
00631 
00632 _struct_I = genpy.struct_I
00633 class GetObjectId(object):
00634   _type          = 'srs_object_database_msgs/GetObjectId'
00635   _md5sum = 'da04346db6b247535564f8d406b33256'
00636   _request_class  = GetObjectIdRequest
00637   _response_class = GetObjectIdResponse


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