_PDDLStep.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pddl_msgs/PDDLStep.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 PDDLStep(genpy.Message):
00009   _md5sum = "f85878397649e3f20844d62528120c68"
00010   _type = "pddl_msgs/PDDLStep"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string action
00013 string[] args
00014 
00015 """
00016   __slots__ = ['action','args']
00017   _slot_types = ['string','string[]']
00018 
00019   def __init__(self, *args, **kwds):
00020     """
00021     Constructor. Any message fields that are implicitly/explicitly
00022     set to None will be assigned a default value. The recommend
00023     use is keyword arguments as this is more robust to future message
00024     changes.  You cannot mix in-order arguments and keyword arguments.
00025 
00026     The available fields are:
00027        action,args
00028 
00029     :param args: complete set of field values, in .msg order
00030     :param kwds: use keyword arguments corresponding to message field names
00031     to set specific fields.
00032     """
00033     if args or kwds:
00034       super(PDDLStep, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.action is None:
00037         self.action = ''
00038       if self.args is None:
00039         self.args = []
00040     else:
00041       self.action = ''
00042       self.args = []
00043 
00044   def _get_types(self):
00045     """
00046     internal API method
00047     """
00048     return self._slot_types
00049 
00050   def serialize(self, buff):
00051     """
00052     serialize message into buffer
00053     :param buff: buffer, ``StringIO``
00054     """
00055     try:
00056       _x = self.action
00057       length = len(_x)
00058       if python3 or type(_x) == unicode:
00059         _x = _x.encode('utf-8')
00060         length = len(_x)
00061       buff.write(struct.pack('<I%ss'%length, length, _x))
00062       length = len(self.args)
00063       buff.write(_struct_I.pack(length))
00064       for val1 in self.args:
00065         length = len(val1)
00066         if python3 or type(val1) == unicode:
00067           val1 = val1.encode('utf-8')
00068           length = len(val1)
00069         buff.write(struct.pack('<I%ss'%length, length, val1))
00070     except struct.error as se: self._check_types(se)
00071     except TypeError as te: self._check_types(te)
00072 
00073   def deserialize(self, str):
00074     """
00075     unpack serialized message in str into this message instance
00076     :param str: byte array of serialized message, ``str``
00077     """
00078     try:
00079       end = 0
00080       start = end
00081       end += 4
00082       (length,) = _struct_I.unpack(str[start:end])
00083       start = end
00084       end += length
00085       if python3:
00086         self.action = str[start:end].decode('utf-8')
00087       else:
00088         self.action = str[start:end]
00089       start = end
00090       end += 4
00091       (length,) = _struct_I.unpack(str[start:end])
00092       self.args = []
00093       for i in range(0, length):
00094         start = end
00095         end += 4
00096         (length,) = _struct_I.unpack(str[start:end])
00097         start = end
00098         end += length
00099         if python3:
00100           val1 = str[start:end].decode('utf-8')
00101         else:
00102           val1 = str[start:end]
00103         self.args.append(val1)
00104       return self
00105     except struct.error as e:
00106       raise genpy.DeserializationError(e) #most likely buffer underfill
00107 
00108 
00109   def serialize_numpy(self, buff, numpy):
00110     """
00111     serialize message with numpy array types into buffer
00112     :param buff: buffer, ``StringIO``
00113     :param numpy: numpy python module
00114     """
00115     try:
00116       _x = self.action
00117       length = len(_x)
00118       if python3 or type(_x) == unicode:
00119         _x = _x.encode('utf-8')
00120         length = len(_x)
00121       buff.write(struct.pack('<I%ss'%length, length, _x))
00122       length = len(self.args)
00123       buff.write(_struct_I.pack(length))
00124       for val1 in self.args:
00125         length = len(val1)
00126         if python3 or type(val1) == unicode:
00127           val1 = val1.encode('utf-8')
00128           length = len(val1)
00129         buff.write(struct.pack('<I%ss'%length, length, val1))
00130     except struct.error as se: self._check_types(se)
00131     except TypeError as te: self._check_types(te)
00132 
00133   def deserialize_numpy(self, str, numpy):
00134     """
00135     unpack serialized message in str into this message instance using numpy for array types
00136     :param str: byte array of serialized message, ``str``
00137     :param numpy: numpy python module
00138     """
00139     try:
00140       end = 0
00141       start = end
00142       end += 4
00143       (length,) = _struct_I.unpack(str[start:end])
00144       start = end
00145       end += length
00146       if python3:
00147         self.action = str[start:end].decode('utf-8')
00148       else:
00149         self.action = str[start:end]
00150       start = end
00151       end += 4
00152       (length,) = _struct_I.unpack(str[start:end])
00153       self.args = []
00154       for i in range(0, length):
00155         start = end
00156         end += 4
00157         (length,) = _struct_I.unpack(str[start:end])
00158         start = end
00159         end += length
00160         if python3:
00161           val1 = str[start:end].decode('utf-8')
00162         else:
00163           val1 = str[start:end]
00164         self.args.append(val1)
00165       return self
00166     except struct.error as e:
00167       raise genpy.DeserializationError(e) #most likely buffer underfill
00168 
00169 _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