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