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