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