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


continual_planning_executive
Author(s): Christian Dornhege
autogenerated on Mon Oct 6 2014 07:51:56