_PlanNextAction.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_knowledge/PlanNextActionRequest.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 PlanNextActionRequest(genpy.Message):
00009   _md5sum = "e2d4f487750c8fa860dee6148514cfe4"
00010   _type = "srs_knowledge/PlanNextActionRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 int32 sessionId
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 int8 LAST_ACTION_SUCCESS = 0
00026 int8 LAST_ACTION_NOT_COMPLETED = 1
00027 int8 LAST_ACTION_FAIL = 2
00028 
00029 int32 resultLastAction
00030 
00031 
00032 
00033 
00034 string jsonFeedback
00035 
00036 
00037 """
00038   # Pseudo-constants
00039   LAST_ACTION_SUCCESS = 0
00040   LAST_ACTION_NOT_COMPLETED = 1
00041   LAST_ACTION_FAIL = 2
00042 
00043   __slots__ = ['sessionId','resultLastAction','jsonFeedback']
00044   _slot_types = ['int32','int32','string']
00045 
00046   def __init__(self, *args, **kwds):
00047     """
00048     Constructor. Any message fields that are implicitly/explicitly
00049     set to None will be assigned a default value. The recommend
00050     use is keyword arguments as this is more robust to future message
00051     changes.  You cannot mix in-order arguments and keyword arguments.
00052 
00053     The available fields are:
00054        sessionId,resultLastAction,jsonFeedback
00055 
00056     :param args: complete set of field values, in .msg order
00057     :param kwds: use keyword arguments corresponding to message field names
00058     to set specific fields.
00059     """
00060     if args or kwds:
00061       super(PlanNextActionRequest, self).__init__(*args, **kwds)
00062       #message fields cannot be None, assign default values for those that are
00063       if self.sessionId is None:
00064         self.sessionId = 0
00065       if self.resultLastAction is None:
00066         self.resultLastAction = 0
00067       if self.jsonFeedback is None:
00068         self.jsonFeedback = ''
00069     else:
00070       self.sessionId = 0
00071       self.resultLastAction = 0
00072       self.jsonFeedback = ''
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
00087       buff.write(_struct_2i.pack(_x.sessionId, _x.resultLastAction))
00088       _x = self.jsonFeedback
00089       length = len(_x)
00090       if python3 or type(_x) == unicode:
00091         _x = _x.encode('utf-8')
00092         length = len(_x)
00093       buff.write(struct.pack('<I%ss'%length, length, _x))
00094     except struct.error as se: self._check_types(se)
00095     except TypeError as te: self._check_types(te)
00096 
00097   def deserialize(self, str):
00098     """
00099     unpack serialized message in str into this message instance
00100     :param str: byte array of serialized message, ``str``
00101     """
00102     try:
00103       end = 0
00104       _x = self
00105       start = end
00106       end += 8
00107       (_x.sessionId, _x.resultLastAction,) = _struct_2i.unpack(str[start:end])
00108       start = end
00109       end += 4
00110       (length,) = _struct_I.unpack(str[start:end])
00111       start = end
00112       end += length
00113       if python3:
00114         self.jsonFeedback = str[start:end].decode('utf-8')
00115       else:
00116         self.jsonFeedback = str[start:end]
00117       return self
00118     except struct.error as e:
00119       raise genpy.DeserializationError(e) #most likely buffer underfill
00120 
00121 
00122   def serialize_numpy(self, buff, numpy):
00123     """
00124     serialize message with numpy array types into buffer
00125     :param buff: buffer, ``StringIO``
00126     :param numpy: numpy python module
00127     """
00128     try:
00129       _x = self
00130       buff.write(_struct_2i.pack(_x.sessionId, _x.resultLastAction))
00131       _x = self.jsonFeedback
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     except struct.error as se: self._check_types(se)
00138     except TypeError as te: self._check_types(te)
00139 
00140   def deserialize_numpy(self, str, numpy):
00141     """
00142     unpack serialized message in str into this message instance using numpy for array types
00143     :param str: byte array of serialized message, ``str``
00144     :param numpy: numpy python module
00145     """
00146     try:
00147       end = 0
00148       _x = self
00149       start = end
00150       end += 8
00151       (_x.sessionId, _x.resultLastAction,) = _struct_2i.unpack(str[start:end])
00152       start = end
00153       end += 4
00154       (length,) = _struct_I.unpack(str[start:end])
00155       start = end
00156       end += length
00157       if python3:
00158         self.jsonFeedback = str[start:end].decode('utf-8')
00159       else:
00160         self.jsonFeedback = str[start:end]
00161       return self
00162     except struct.error as e:
00163       raise genpy.DeserializationError(e) #most likely buffer underfill
00164 
00165 _struct_I = genpy.struct_I
00166 _struct_2i = struct.Struct("<2i")
00167 """autogenerated by genpy from srs_knowledge/PlanNextActionResponse.msg. Do not edit."""
00168 import sys
00169 python3 = True if sys.hexversion > 0x03000000 else False
00170 import genpy
00171 import struct
00172 
00173 import srs_knowledge.msg
00174 
00175 class PlanNextActionResponse(genpy.Message):
00176   _md5sum = "3cfc405d12917b675e44ffae8a735c2f"
00177   _type = "srs_knowledge/PlanNextActionResponse"
00178   _has_header = False #flag to mark the presence of a Header object
00179   _full_text = """
00180 
00181 CUAction nextAction
00182 
00183 
00184 ================================================================================
00185 MSG: srs_knowledge/CUAction
00186 # still at alpha stage. not finalised yet. 
00187 
00188 # indicate if task finished successfully (1); no feasible solution (-1); continue executing the given actions in this message (0)
00189 int32 status
00190 
00191 # [ifNavigate, ifDetect, ifGrasp]. 0: yes, 1: no, 2: others (undefined)
00192 #int32[] actionFlags
00193 
00194 #MoveAction ma
00195 #PerceptionAction pa
00196 #GraspAction ga
00197 GenericAction generic
00198 
00199 # move, perception, grasp, or generic
00200 string actionType
00201 ================================================================================
00202 MSG: srs_knowledge/GenericAction
00203 # use a list as the information container of an action
00204 # BE CAREFUL WHEN USING IT. FOR FLEXIBILITY REASON OR TESTING NEW ADDED ACTION TYPE 
00205 # string[] actionInfo    # to deprecate
00206 string jsonActionInfo
00207 
00208 """
00209   __slots__ = ['nextAction']
00210   _slot_types = ['srs_knowledge/CUAction']
00211 
00212   def __init__(self, *args, **kwds):
00213     """
00214     Constructor. Any message fields that are implicitly/explicitly
00215     set to None will be assigned a default value. The recommend
00216     use is keyword arguments as this is more robust to future message
00217     changes.  You cannot mix in-order arguments and keyword arguments.
00218 
00219     The available fields are:
00220        nextAction
00221 
00222     :param args: complete set of field values, in .msg order
00223     :param kwds: use keyword arguments corresponding to message field names
00224     to set specific fields.
00225     """
00226     if args or kwds:
00227       super(PlanNextActionResponse, self).__init__(*args, **kwds)
00228       #message fields cannot be None, assign default values for those that are
00229       if self.nextAction is None:
00230         self.nextAction = srs_knowledge.msg.CUAction()
00231     else:
00232       self.nextAction = srs_knowledge.msg.CUAction()
00233 
00234   def _get_types(self):
00235     """
00236     internal API method
00237     """
00238     return self._slot_types
00239 
00240   def serialize(self, buff):
00241     """
00242     serialize message into buffer
00243     :param buff: buffer, ``StringIO``
00244     """
00245     try:
00246       buff.write(_struct_i.pack(self.nextAction.status))
00247       _x = self.nextAction.generic.jsonActionInfo
00248       length = len(_x)
00249       if python3 or type(_x) == unicode:
00250         _x = _x.encode('utf-8')
00251         length = len(_x)
00252       buff.write(struct.pack('<I%ss'%length, length, _x))
00253       _x = self.nextAction.actionType
00254       length = len(_x)
00255       if python3 or type(_x) == unicode:
00256         _x = _x.encode('utf-8')
00257         length = len(_x)
00258       buff.write(struct.pack('<I%ss'%length, length, _x))
00259     except struct.error as se: self._check_types(se)
00260     except TypeError as te: self._check_types(te)
00261 
00262   def deserialize(self, str):
00263     """
00264     unpack serialized message in str into this message instance
00265     :param str: byte array of serialized message, ``str``
00266     """
00267     try:
00268       if self.nextAction is None:
00269         self.nextAction = srs_knowledge.msg.CUAction()
00270       end = 0
00271       start = end
00272       end += 4
00273       (self.nextAction.status,) = _struct_i.unpack(str[start:end])
00274       start = end
00275       end += 4
00276       (length,) = _struct_I.unpack(str[start:end])
00277       start = end
00278       end += length
00279       if python3:
00280         self.nextAction.generic.jsonActionInfo = str[start:end].decode('utf-8')
00281       else:
00282         self.nextAction.generic.jsonActionInfo = str[start:end]
00283       start = end
00284       end += 4
00285       (length,) = _struct_I.unpack(str[start:end])
00286       start = end
00287       end += length
00288       if python3:
00289         self.nextAction.actionType = str[start:end].decode('utf-8')
00290       else:
00291         self.nextAction.actionType = str[start:end]
00292       return self
00293     except struct.error as e:
00294       raise genpy.DeserializationError(e) #most likely buffer underfill
00295 
00296 
00297   def serialize_numpy(self, buff, numpy):
00298     """
00299     serialize message with numpy array types into buffer
00300     :param buff: buffer, ``StringIO``
00301     :param numpy: numpy python module
00302     """
00303     try:
00304       buff.write(_struct_i.pack(self.nextAction.status))
00305       _x = self.nextAction.generic.jsonActionInfo
00306       length = len(_x)
00307       if python3 or type(_x) == unicode:
00308         _x = _x.encode('utf-8')
00309         length = len(_x)
00310       buff.write(struct.pack('<I%ss'%length, length, _x))
00311       _x = self.nextAction.actionType
00312       length = len(_x)
00313       if python3 or type(_x) == unicode:
00314         _x = _x.encode('utf-8')
00315         length = len(_x)
00316       buff.write(struct.pack('<I%ss'%length, length, _x))
00317     except struct.error as se: self._check_types(se)
00318     except TypeError as te: self._check_types(te)
00319 
00320   def deserialize_numpy(self, str, numpy):
00321     """
00322     unpack serialized message in str into this message instance using numpy for array types
00323     :param str: byte array of serialized message, ``str``
00324     :param numpy: numpy python module
00325     """
00326     try:
00327       if self.nextAction is None:
00328         self.nextAction = srs_knowledge.msg.CUAction()
00329       end = 0
00330       start = end
00331       end += 4
00332       (self.nextAction.status,) = _struct_i.unpack(str[start:end])
00333       start = end
00334       end += 4
00335       (length,) = _struct_I.unpack(str[start:end])
00336       start = end
00337       end += length
00338       if python3:
00339         self.nextAction.generic.jsonActionInfo = str[start:end].decode('utf-8')
00340       else:
00341         self.nextAction.generic.jsonActionInfo = str[start:end]
00342       start = end
00343       end += 4
00344       (length,) = _struct_I.unpack(str[start:end])
00345       start = end
00346       end += length
00347       if python3:
00348         self.nextAction.actionType = str[start:end].decode('utf-8')
00349       else:
00350         self.nextAction.actionType = str[start:end]
00351       return self
00352     except struct.error as e:
00353       raise genpy.DeserializationError(e) #most likely buffer underfill
00354 
00355 _struct_I = genpy.struct_I
00356 _struct_i = struct.Struct("<i")
00357 class PlanNextAction(object):
00358   _type          = 'srs_knowledge/PlanNextAction'
00359   _md5sum = '65b0f6a77aa595bf1f1021102977c4fc'
00360   _request_class  = PlanNextActionRequest
00361   _response_class = PlanNextActionResponse


srs_knowledge
Author(s): Ze Ji
autogenerated on Sun Jan 5 2014 12:03:27