$search
00001 """autogenerated by genmsg_py from GetDBGraspsRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class GetDBGraspsRequest(roslib.message.Message): 00007 _md5sum = "d6a7063359b15cbc8bac77de0a1cc2cb" 00008 _type = "srs_grasping/GetDBGraspsRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """int32 object_id 00011 00012 """ 00013 __slots__ = ['object_id'] 00014 _slot_types = ['int32'] 00015 00016 def __init__(self, *args, **kwds): 00017 """ 00018 Constructor. Any message fields that are implicitly/explicitly 00019 set to None will be assigned a default value. The recommend 00020 use is keyword arguments as this is more robust to future message 00021 changes. You cannot mix in-order arguments and keyword arguments. 00022 00023 The available fields are: 00024 object_id 00025 00026 @param args: complete set of field values, in .msg order 00027 @param kwds: use keyword arguments corresponding to message field names 00028 to set specific fields. 00029 """ 00030 if args or kwds: 00031 super(GetDBGraspsRequest, self).__init__(*args, **kwds) 00032 #message fields cannot be None, assign default values for those that are 00033 if self.object_id is None: 00034 self.object_id = 0 00035 else: 00036 self.object_id = 0 00037 00038 def _get_types(self): 00039 """ 00040 internal API method 00041 """ 00042 return self._slot_types 00043 00044 def serialize(self, buff): 00045 """ 00046 serialize message into buffer 00047 @param buff: buffer 00048 @type buff: StringIO 00049 """ 00050 try: 00051 buff.write(_struct_i.pack(self.object_id)) 00052 except struct.error as se: self._check_types(se) 00053 except TypeError as te: self._check_types(te) 00054 00055 def deserialize(self, str): 00056 """ 00057 unpack serialized message in str into this message instance 00058 @param str: byte array of serialized message 00059 @type str: str 00060 """ 00061 try: 00062 end = 0 00063 start = end 00064 end += 4 00065 (self.object_id,) = _struct_i.unpack(str[start:end]) 00066 return self 00067 except struct.error as e: 00068 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00069 00070 00071 def serialize_numpy(self, buff, numpy): 00072 """ 00073 serialize message with numpy array types into buffer 00074 @param buff: buffer 00075 @type buff: StringIO 00076 @param numpy: numpy python module 00077 @type numpy module 00078 """ 00079 try: 00080 buff.write(_struct_i.pack(self.object_id)) 00081 except struct.error as se: self._check_types(se) 00082 except TypeError as te: self._check_types(te) 00083 00084 def deserialize_numpy(self, str, numpy): 00085 """ 00086 unpack serialized message in str into this message instance using numpy for array types 00087 @param str: byte array of serialized message 00088 @type str: str 00089 @param numpy: numpy python module 00090 @type numpy: module 00091 """ 00092 try: 00093 end = 0 00094 start = end 00095 end += 4 00096 (self.object_id,) = _struct_i.unpack(str[start:end]) 00097 return self 00098 except struct.error as e: 00099 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00100 00101 _struct_I = roslib.message.struct_I 00102 _struct_i = struct.Struct("<i") 00103 """autogenerated by genmsg_py from GetDBGraspsResponse.msg. Do not edit.""" 00104 import roslib.message 00105 import struct 00106 00107 import geometry_msgs.msg 00108 import srs_msgs.msg 00109 import std_msgs.msg 00110 00111 class GetDBGraspsResponse(roslib.message.Message): 00112 _md5sum = "724fab534f45bd149d08d0add7703059" 00113 _type = "srs_grasping/GetDBGraspsResponse" 00114 _has_header = False #flag to mark the presence of a Header object 00115 _full_text = """srs_msgs/DBGrasp[] grasp_configuration 00116 srs_msgs/GraspingErrorCodes error_code 00117 00118 00119 ================================================================================ 00120 MSG: srs_msgs/DBGrasp 00121 int32 object_id 00122 string hand_type 00123 float64[] sdh_joint_values 00124 geometry_msgs/PoseStamped pre_grasp 00125 geometry_msgs/PoseStamped grasp 00126 string category 00127 00128 ================================================================================ 00129 MSG: geometry_msgs/PoseStamped 00130 # A Pose with reference coordinate frame and timestamp 00131 Header header 00132 Pose pose 00133 00134 ================================================================================ 00135 MSG: std_msgs/Header 00136 # Standard metadata for higher-level stamped data types. 00137 # This is generally used to communicate timestamped data 00138 # in a particular coordinate frame. 00139 # 00140 # sequence ID: consecutively increasing ID 00141 uint32 seq 00142 #Two-integer timestamp that is expressed as: 00143 # * stamp.secs: seconds (stamp_secs) since epoch 00144 # * stamp.nsecs: nanoseconds since stamp_secs 00145 # time-handling sugar is provided by the client library 00146 time stamp 00147 #Frame this data is associated with 00148 # 0: no frame 00149 # 1: global frame 00150 string frame_id 00151 00152 ================================================================================ 00153 MSG: geometry_msgs/Pose 00154 # A representation of pose in free space, composed of postion and orientation. 00155 Point position 00156 Quaternion orientation 00157 00158 ================================================================================ 00159 MSG: geometry_msgs/Point 00160 # This contains the position of a point in free space 00161 float64 x 00162 float64 y 00163 float64 z 00164 00165 ================================================================================ 00166 MSG: geometry_msgs/Quaternion 00167 # This represents an orientation in free space in quaternion form. 00168 00169 float64 x 00170 float64 y 00171 float64 z 00172 float64 w 00173 00174 ================================================================================ 00175 MSG: srs_msgs/GraspingErrorCodes 00176 int32 val 00177 00178 int32 SUCCESS=1 00179 int32 SERVICE_DID_NOT_PROCESS_REQUEST=-1 00180 int32 UNKNOWN_OBJECT=-2 00181 int32 CORRUPTED_MESH_FILE=-3 00182 int32 CORRUPTED_ROBOT_MESH_FILE=-4 00183 int32 CORRUPTED_GRASP_FILE=-5 00184 int32 NON_GENERATED_INFO=-6 00185 int32 OBJECT_INFO_NOT_FOUND=-7 00186 int32 UNKNOWN_CATEGORY=-8 00187 int32 GOAL_UNREACHABLE=-9 00188 00189 """ 00190 __slots__ = ['grasp_configuration','error_code'] 00191 _slot_types = ['srs_msgs/DBGrasp[]','srs_msgs/GraspingErrorCodes'] 00192 00193 def __init__(self, *args, **kwds): 00194 """ 00195 Constructor. Any message fields that are implicitly/explicitly 00196 set to None will be assigned a default value. The recommend 00197 use is keyword arguments as this is more robust to future message 00198 changes. You cannot mix in-order arguments and keyword arguments. 00199 00200 The available fields are: 00201 grasp_configuration,error_code 00202 00203 @param args: complete set of field values, in .msg order 00204 @param kwds: use keyword arguments corresponding to message field names 00205 to set specific fields. 00206 """ 00207 if args or kwds: 00208 super(GetDBGraspsResponse, self).__init__(*args, **kwds) 00209 #message fields cannot be None, assign default values for those that are 00210 if self.grasp_configuration is None: 00211 self.grasp_configuration = [] 00212 if self.error_code is None: 00213 self.error_code = srs_msgs.msg.GraspingErrorCodes() 00214 else: 00215 self.grasp_configuration = [] 00216 self.error_code = srs_msgs.msg.GraspingErrorCodes() 00217 00218 def _get_types(self): 00219 """ 00220 internal API method 00221 """ 00222 return self._slot_types 00223 00224 def serialize(self, buff): 00225 """ 00226 serialize message into buffer 00227 @param buff: buffer 00228 @type buff: StringIO 00229 """ 00230 try: 00231 length = len(self.grasp_configuration) 00232 buff.write(_struct_I.pack(length)) 00233 for val1 in self.grasp_configuration: 00234 buff.write(_struct_i.pack(val1.object_id)) 00235 _x = val1.hand_type 00236 length = len(_x) 00237 buff.write(struct.pack('<I%ss'%length, length, _x)) 00238 length = len(val1.sdh_joint_values) 00239 buff.write(_struct_I.pack(length)) 00240 pattern = '<%sd'%length 00241 buff.write(struct.pack(pattern, *val1.sdh_joint_values)) 00242 _v1 = val1.pre_grasp 00243 _v2 = _v1.header 00244 buff.write(_struct_I.pack(_v2.seq)) 00245 _v3 = _v2.stamp 00246 _x = _v3 00247 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00248 _x = _v2.frame_id 00249 length = len(_x) 00250 buff.write(struct.pack('<I%ss'%length, length, _x)) 00251 _v4 = _v1.pose 00252 _v5 = _v4.position 00253 _x = _v5 00254 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00255 _v6 = _v4.orientation 00256 _x = _v6 00257 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00258 _v7 = val1.grasp 00259 _v8 = _v7.header 00260 buff.write(_struct_I.pack(_v8.seq)) 00261 _v9 = _v8.stamp 00262 _x = _v9 00263 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00264 _x = _v8.frame_id 00265 length = len(_x) 00266 buff.write(struct.pack('<I%ss'%length, length, _x)) 00267 _v10 = _v7.pose 00268 _v11 = _v10.position 00269 _x = _v11 00270 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00271 _v12 = _v10.orientation 00272 _x = _v12 00273 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00274 _x = val1.category 00275 length = len(_x) 00276 buff.write(struct.pack('<I%ss'%length, length, _x)) 00277 buff.write(_struct_i.pack(self.error_code.val)) 00278 except struct.error as se: self._check_types(se) 00279 except TypeError as te: self._check_types(te) 00280 00281 def deserialize(self, str): 00282 """ 00283 unpack serialized message in str into this message instance 00284 @param str: byte array of serialized message 00285 @type str: str 00286 """ 00287 try: 00288 if self.error_code is None: 00289 self.error_code = srs_msgs.msg.GraspingErrorCodes() 00290 end = 0 00291 start = end 00292 end += 4 00293 (length,) = _struct_I.unpack(str[start:end]) 00294 self.grasp_configuration = [] 00295 for i in range(0, length): 00296 val1 = srs_msgs.msg.DBGrasp() 00297 start = end 00298 end += 4 00299 (val1.object_id,) = _struct_i.unpack(str[start:end]) 00300 start = end 00301 end += 4 00302 (length,) = _struct_I.unpack(str[start:end]) 00303 start = end 00304 end += length 00305 val1.hand_type = str[start:end] 00306 start = end 00307 end += 4 00308 (length,) = _struct_I.unpack(str[start:end]) 00309 pattern = '<%sd'%length 00310 start = end 00311 end += struct.calcsize(pattern) 00312 val1.sdh_joint_values = struct.unpack(pattern, str[start:end]) 00313 _v13 = val1.pre_grasp 00314 _v14 = _v13.header 00315 start = end 00316 end += 4 00317 (_v14.seq,) = _struct_I.unpack(str[start:end]) 00318 _v15 = _v14.stamp 00319 _x = _v15 00320 start = end 00321 end += 8 00322 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00323 start = end 00324 end += 4 00325 (length,) = _struct_I.unpack(str[start:end]) 00326 start = end 00327 end += length 00328 _v14.frame_id = str[start:end] 00329 _v16 = _v13.pose 00330 _v17 = _v16.position 00331 _x = _v17 00332 start = end 00333 end += 24 00334 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00335 _v18 = _v16.orientation 00336 _x = _v18 00337 start = end 00338 end += 32 00339 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00340 _v19 = val1.grasp 00341 _v20 = _v19.header 00342 start = end 00343 end += 4 00344 (_v20.seq,) = _struct_I.unpack(str[start:end]) 00345 _v21 = _v20.stamp 00346 _x = _v21 00347 start = end 00348 end += 8 00349 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00350 start = end 00351 end += 4 00352 (length,) = _struct_I.unpack(str[start:end]) 00353 start = end 00354 end += length 00355 _v20.frame_id = str[start:end] 00356 _v22 = _v19.pose 00357 _v23 = _v22.position 00358 _x = _v23 00359 start = end 00360 end += 24 00361 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00362 _v24 = _v22.orientation 00363 _x = _v24 00364 start = end 00365 end += 32 00366 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00367 start = end 00368 end += 4 00369 (length,) = _struct_I.unpack(str[start:end]) 00370 start = end 00371 end += length 00372 val1.category = str[start:end] 00373 self.grasp_configuration.append(val1) 00374 start = end 00375 end += 4 00376 (self.error_code.val,) = _struct_i.unpack(str[start:end]) 00377 return self 00378 except struct.error as e: 00379 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00380 00381 00382 def serialize_numpy(self, buff, numpy): 00383 """ 00384 serialize message with numpy array types into buffer 00385 @param buff: buffer 00386 @type buff: StringIO 00387 @param numpy: numpy python module 00388 @type numpy module 00389 """ 00390 try: 00391 length = len(self.grasp_configuration) 00392 buff.write(_struct_I.pack(length)) 00393 for val1 in self.grasp_configuration: 00394 buff.write(_struct_i.pack(val1.object_id)) 00395 _x = val1.hand_type 00396 length = len(_x) 00397 buff.write(struct.pack('<I%ss'%length, length, _x)) 00398 length = len(val1.sdh_joint_values) 00399 buff.write(_struct_I.pack(length)) 00400 pattern = '<%sd'%length 00401 buff.write(val1.sdh_joint_values.tostring()) 00402 _v25 = val1.pre_grasp 00403 _v26 = _v25.header 00404 buff.write(_struct_I.pack(_v26.seq)) 00405 _v27 = _v26.stamp 00406 _x = _v27 00407 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00408 _x = _v26.frame_id 00409 length = len(_x) 00410 buff.write(struct.pack('<I%ss'%length, length, _x)) 00411 _v28 = _v25.pose 00412 _v29 = _v28.position 00413 _x = _v29 00414 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00415 _v30 = _v28.orientation 00416 _x = _v30 00417 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00418 _v31 = val1.grasp 00419 _v32 = _v31.header 00420 buff.write(_struct_I.pack(_v32.seq)) 00421 _v33 = _v32.stamp 00422 _x = _v33 00423 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00424 _x = _v32.frame_id 00425 length = len(_x) 00426 buff.write(struct.pack('<I%ss'%length, length, _x)) 00427 _v34 = _v31.pose 00428 _v35 = _v34.position 00429 _x = _v35 00430 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00431 _v36 = _v34.orientation 00432 _x = _v36 00433 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00434 _x = val1.category 00435 length = len(_x) 00436 buff.write(struct.pack('<I%ss'%length, length, _x)) 00437 buff.write(_struct_i.pack(self.error_code.val)) 00438 except struct.error as se: self._check_types(se) 00439 except TypeError as te: self._check_types(te) 00440 00441 def deserialize_numpy(self, str, numpy): 00442 """ 00443 unpack serialized message in str into this message instance using numpy for array types 00444 @param str: byte array of serialized message 00445 @type str: str 00446 @param numpy: numpy python module 00447 @type numpy: module 00448 """ 00449 try: 00450 if self.error_code is None: 00451 self.error_code = srs_msgs.msg.GraspingErrorCodes() 00452 end = 0 00453 start = end 00454 end += 4 00455 (length,) = _struct_I.unpack(str[start:end]) 00456 self.grasp_configuration = [] 00457 for i in range(0, length): 00458 val1 = srs_msgs.msg.DBGrasp() 00459 start = end 00460 end += 4 00461 (val1.object_id,) = _struct_i.unpack(str[start:end]) 00462 start = end 00463 end += 4 00464 (length,) = _struct_I.unpack(str[start:end]) 00465 start = end 00466 end += length 00467 val1.hand_type = str[start:end] 00468 start = end 00469 end += 4 00470 (length,) = _struct_I.unpack(str[start:end]) 00471 pattern = '<%sd'%length 00472 start = end 00473 end += struct.calcsize(pattern) 00474 val1.sdh_joint_values = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00475 _v37 = val1.pre_grasp 00476 _v38 = _v37.header 00477 start = end 00478 end += 4 00479 (_v38.seq,) = _struct_I.unpack(str[start:end]) 00480 _v39 = _v38.stamp 00481 _x = _v39 00482 start = end 00483 end += 8 00484 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00485 start = end 00486 end += 4 00487 (length,) = _struct_I.unpack(str[start:end]) 00488 start = end 00489 end += length 00490 _v38.frame_id = str[start:end] 00491 _v40 = _v37.pose 00492 _v41 = _v40.position 00493 _x = _v41 00494 start = end 00495 end += 24 00496 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00497 _v42 = _v40.orientation 00498 _x = _v42 00499 start = end 00500 end += 32 00501 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00502 _v43 = val1.grasp 00503 _v44 = _v43.header 00504 start = end 00505 end += 4 00506 (_v44.seq,) = _struct_I.unpack(str[start:end]) 00507 _v45 = _v44.stamp 00508 _x = _v45 00509 start = end 00510 end += 8 00511 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00512 start = end 00513 end += 4 00514 (length,) = _struct_I.unpack(str[start:end]) 00515 start = end 00516 end += length 00517 _v44.frame_id = str[start:end] 00518 _v46 = _v43.pose 00519 _v47 = _v46.position 00520 _x = _v47 00521 start = end 00522 end += 24 00523 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00524 _v48 = _v46.orientation 00525 _x = _v48 00526 start = end 00527 end += 32 00528 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00529 start = end 00530 end += 4 00531 (length,) = _struct_I.unpack(str[start:end]) 00532 start = end 00533 end += length 00534 val1.category = str[start:end] 00535 self.grasp_configuration.append(val1) 00536 start = end 00537 end += 4 00538 (self.error_code.val,) = _struct_i.unpack(str[start:end]) 00539 return self 00540 except struct.error as e: 00541 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00542 00543 _struct_I = roslib.message.struct_I 00544 _struct_i = struct.Struct("<i") 00545 _struct_4d = struct.Struct("<4d") 00546 _struct_2I = struct.Struct("<2I") 00547 _struct_3d = struct.Struct("<3d") 00548 class GetDBGrasps(roslib.message.ServiceDefinition): 00549 _type = 'srs_grasping/GetDBGrasps' 00550 _md5sum = '05192f3c2e8ac20ce03b65b2c74f6edc' 00551 _request_class = GetDBGraspsRequest 00552 _response_class = GetDBGraspsResponse