_PDDLAction.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pddl_msgs/PDDLAction.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 PDDLAction(genpy.Message):
00009   _md5sum = "bfaa943a9c9df1ee5bb56495ada2cdd8"
00010   _type = "pddl_msgs/PDDLAction"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string name
00013 # write String in S expression like "(and foo var)"
00014 string parameters
00015 string precondition
00016 string effect
00017 string on_condition
00018 
00019 """
00020   __slots__ = ['name','parameters','precondition','effect','on_condition']
00021   _slot_types = ['string','string','string','string','string']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        name,parameters,precondition,effect,on_condition
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(PDDLAction, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.name is None:
00041         self.name = ''
00042       if self.parameters is None:
00043         self.parameters = ''
00044       if self.precondition is None:
00045         self.precondition = ''
00046       if self.effect is None:
00047         self.effect = ''
00048       if self.on_condition is None:
00049         self.on_condition = ''
00050     else:
00051       self.name = ''
00052       self.parameters = ''
00053       self.precondition = ''
00054       self.effect = ''
00055       self.on_condition = ''
00056 
00057   def _get_types(self):
00058     """
00059     internal API method
00060     """
00061     return self._slot_types
00062 
00063   def serialize(self, buff):
00064     """
00065     serialize message into buffer
00066     :param buff: buffer, ``StringIO``
00067     """
00068     try:
00069       _x = self.name
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       _x = self.parameters
00076       length = len(_x)
00077       if python3 or type(_x) == unicode:
00078         _x = _x.encode('utf-8')
00079         length = len(_x)
00080       buff.write(struct.pack('<I%ss'%length, length, _x))
00081       _x = self.precondition
00082       length = len(_x)
00083       if python3 or type(_x) == unicode:
00084         _x = _x.encode('utf-8')
00085         length = len(_x)
00086       buff.write(struct.pack('<I%ss'%length, length, _x))
00087       _x = self.effect
00088       length = len(_x)
00089       if python3 or type(_x) == unicode:
00090         _x = _x.encode('utf-8')
00091         length = len(_x)
00092       buff.write(struct.pack('<I%ss'%length, length, _x))
00093       _x = self.on_condition
00094       length = len(_x)
00095       if python3 or type(_x) == unicode:
00096         _x = _x.encode('utf-8')
00097         length = len(_x)
00098       buff.write(struct.pack('<I%ss'%length, length, _x))
00099     except struct.error as se: self._check_types(se)
00100     except TypeError as te: self._check_types(te)
00101 
00102   def deserialize(self, str):
00103     """
00104     unpack serialized message in str into this message instance
00105     :param str: byte array of serialized message, ``str``
00106     """
00107     try:
00108       end = 0
00109       start = end
00110       end += 4
00111       (length,) = _struct_I.unpack(str[start:end])
00112       start = end
00113       end += length
00114       if python3:
00115         self.name = str[start:end].decode('utf-8')
00116       else:
00117         self.name = str[start:end]
00118       start = end
00119       end += 4
00120       (length,) = _struct_I.unpack(str[start:end])
00121       start = end
00122       end += length
00123       if python3:
00124         self.parameters = str[start:end].decode('utf-8')
00125       else:
00126         self.parameters = str[start:end]
00127       start = end
00128       end += 4
00129       (length,) = _struct_I.unpack(str[start:end])
00130       start = end
00131       end += length
00132       if python3:
00133         self.precondition = str[start:end].decode('utf-8')
00134       else:
00135         self.precondition = str[start:end]
00136       start = end
00137       end += 4
00138       (length,) = _struct_I.unpack(str[start:end])
00139       start = end
00140       end += length
00141       if python3:
00142         self.effect = str[start:end].decode('utf-8')
00143       else:
00144         self.effect = str[start:end]
00145       start = end
00146       end += 4
00147       (length,) = _struct_I.unpack(str[start:end])
00148       start = end
00149       end += length
00150       if python3:
00151         self.on_condition = str[start:end].decode('utf-8')
00152       else:
00153         self.on_condition = str[start:end]
00154       return self
00155     except struct.error as e:
00156       raise genpy.DeserializationError(e) #most likely buffer underfill
00157 
00158 
00159   def serialize_numpy(self, buff, numpy):
00160     """
00161     serialize message with numpy array types into buffer
00162     :param buff: buffer, ``StringIO``
00163     :param numpy: numpy python module
00164     """
00165     try:
00166       _x = self.name
00167       length = len(_x)
00168       if python3 or type(_x) == unicode:
00169         _x = _x.encode('utf-8')
00170         length = len(_x)
00171       buff.write(struct.pack('<I%ss'%length, length, _x))
00172       _x = self.parameters
00173       length = len(_x)
00174       if python3 or type(_x) == unicode:
00175         _x = _x.encode('utf-8')
00176         length = len(_x)
00177       buff.write(struct.pack('<I%ss'%length, length, _x))
00178       _x = self.precondition
00179       length = len(_x)
00180       if python3 or type(_x) == unicode:
00181         _x = _x.encode('utf-8')
00182         length = len(_x)
00183       buff.write(struct.pack('<I%ss'%length, length, _x))
00184       _x = self.effect
00185       length = len(_x)
00186       if python3 or type(_x) == unicode:
00187         _x = _x.encode('utf-8')
00188         length = len(_x)
00189       buff.write(struct.pack('<I%ss'%length, length, _x))
00190       _x = self.on_condition
00191       length = len(_x)
00192       if python3 or type(_x) == unicode:
00193         _x = _x.encode('utf-8')
00194         length = len(_x)
00195       buff.write(struct.pack('<I%ss'%length, length, _x))
00196     except struct.error as se: self._check_types(se)
00197     except TypeError as te: self._check_types(te)
00198 
00199   def deserialize_numpy(self, str, numpy):
00200     """
00201     unpack serialized message in str into this message instance using numpy for array types
00202     :param str: byte array of serialized message, ``str``
00203     :param numpy: numpy python module
00204     """
00205     try:
00206       end = 0
00207       start = end
00208       end += 4
00209       (length,) = _struct_I.unpack(str[start:end])
00210       start = end
00211       end += length
00212       if python3:
00213         self.name = str[start:end].decode('utf-8')
00214       else:
00215         self.name = str[start:end]
00216       start = end
00217       end += 4
00218       (length,) = _struct_I.unpack(str[start:end])
00219       start = end
00220       end += length
00221       if python3:
00222         self.parameters = str[start:end].decode('utf-8')
00223       else:
00224         self.parameters = str[start:end]
00225       start = end
00226       end += 4
00227       (length,) = _struct_I.unpack(str[start:end])
00228       start = end
00229       end += length
00230       if python3:
00231         self.precondition = str[start:end].decode('utf-8')
00232       else:
00233         self.precondition = str[start:end]
00234       start = end
00235       end += 4
00236       (length,) = _struct_I.unpack(str[start:end])
00237       start = end
00238       end += length
00239       if python3:
00240         self.effect = str[start:end].decode('utf-8')
00241       else:
00242         self.effect = str[start:end]
00243       start = end
00244       end += 4
00245       (length,) = _struct_I.unpack(str[start:end])
00246       start = end
00247       end += length
00248       if python3:
00249         self.on_condition = str[start:end].decode('utf-8')
00250       else:
00251         self.on_condition = str[start:end]
00252       return self
00253     except struct.error as e:
00254       raise genpy.DeserializationError(e) #most likely buffer underfill
00255 
00256 _struct_I = genpy.struct_I
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


pddl_msgs
Author(s): Ryohei Ueda (ueda@jsk.t.u-tokyo.ac.jp)
autogenerated on Sat Mar 23 2013 23:39:10