_GenerateSequence.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_knowledge/GenerateSequenceRequest.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 srs_knowledge.msg
00008 
00009 class GenerateSequenceRequest(genpy.Message):
00010   _md5sum = "f8b7e6eac542462f61a4f22feaa3eb4d"
00011   _type = "srs_knowledge/GenerateSequenceRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """
00014 
00015 
00016 string task
00017 
00018 
00019 string objectOrClass
00020 
00021 ABoxObject aboxObject
00022 TBoxObject tboxObject
00023 
00024 
00025 ================================================================================
00026 MSG: srs_knowledge/ABoxObject
00027 int32 object_id
00028 string name
00029 string description
00030 
00031 ================================================================================
00032 MSG: srs_knowledge/TBoxObject
00033 int32 class_id
00034 string name
00035 string description
00036 string[] properties
00037 int32[] subjects
00038 """
00039   __slots__ = ['task','objectOrClass','aboxObject','tboxObject']
00040   _slot_types = ['string','string','srs_knowledge/ABoxObject','srs_knowledge/TBoxObject']
00041 
00042   def __init__(self, *args, **kwds):
00043     """
00044     Constructor. Any message fields that are implicitly/explicitly
00045     set to None will be assigned a default value. The recommend
00046     use is keyword arguments as this is more robust to future message
00047     changes.  You cannot mix in-order arguments and keyword arguments.
00048 
00049     The available fields are:
00050        task,objectOrClass,aboxObject,tboxObject
00051 
00052     :param args: complete set of field values, in .msg order
00053     :param kwds: use keyword arguments corresponding to message field names
00054     to set specific fields.
00055     """
00056     if args or kwds:
00057       super(GenerateSequenceRequest, self).__init__(*args, **kwds)
00058       #message fields cannot be None, assign default values for those that are
00059       if self.task is None:
00060         self.task = ''
00061       if self.objectOrClass is None:
00062         self.objectOrClass = ''
00063       if self.aboxObject is None:
00064         self.aboxObject = srs_knowledge.msg.ABoxObject()
00065       if self.tboxObject is None:
00066         self.tboxObject = srs_knowledge.msg.TBoxObject()
00067     else:
00068       self.task = ''
00069       self.objectOrClass = ''
00070       self.aboxObject = srs_knowledge.msg.ABoxObject()
00071       self.tboxObject = srs_knowledge.msg.TBoxObject()
00072 
00073   def _get_types(self):
00074     """
00075     internal API method
00076     """
00077     return self._slot_types
00078 
00079   def serialize(self, buff):
00080     """
00081     serialize message into buffer
00082     :param buff: buffer, ``StringIO``
00083     """
00084     try:
00085       _x = self.task
00086       length = len(_x)
00087       if python3 or type(_x) == unicode:
00088         _x = _x.encode('utf-8')
00089         length = len(_x)
00090       buff.write(struct.pack('<I%ss'%length, length, _x))
00091       _x = self.objectOrClass
00092       length = len(_x)
00093       if python3 or type(_x) == unicode:
00094         _x = _x.encode('utf-8')
00095         length = len(_x)
00096       buff.write(struct.pack('<I%ss'%length, length, _x))
00097       buff.write(_struct_i.pack(self.aboxObject.object_id))
00098       _x = self.aboxObject.name
00099       length = len(_x)
00100       if python3 or type(_x) == unicode:
00101         _x = _x.encode('utf-8')
00102         length = len(_x)
00103       buff.write(struct.pack('<I%ss'%length, length, _x))
00104       _x = self.aboxObject.description
00105       length = len(_x)
00106       if python3 or type(_x) == unicode:
00107         _x = _x.encode('utf-8')
00108         length = len(_x)
00109       buff.write(struct.pack('<I%ss'%length, length, _x))
00110       buff.write(_struct_i.pack(self.tboxObject.class_id))
00111       _x = self.tboxObject.name
00112       length = len(_x)
00113       if python3 or type(_x) == unicode:
00114         _x = _x.encode('utf-8')
00115         length = len(_x)
00116       buff.write(struct.pack('<I%ss'%length, length, _x))
00117       _x = self.tboxObject.description
00118       length = len(_x)
00119       if python3 or type(_x) == unicode:
00120         _x = _x.encode('utf-8')
00121         length = len(_x)
00122       buff.write(struct.pack('<I%ss'%length, length, _x))
00123       length = len(self.tboxObject.properties)
00124       buff.write(_struct_I.pack(length))
00125       for val1 in self.tboxObject.properties:
00126         length = len(val1)
00127         if python3 or type(val1) == unicode:
00128           val1 = val1.encode('utf-8')
00129           length = len(val1)
00130         buff.write(struct.pack('<I%ss'%length, length, val1))
00131       length = len(self.tboxObject.subjects)
00132       buff.write(_struct_I.pack(length))
00133       pattern = '<%si'%length
00134       buff.write(struct.pack(pattern, *self.tboxObject.subjects))
00135     except struct.error as se: self._check_types(se)
00136     except TypeError as te: self._check_types(te)
00137 
00138   def deserialize(self, str):
00139     """
00140     unpack serialized message in str into this message instance
00141     :param str: byte array of serialized message, ``str``
00142     """
00143     try:
00144       if self.aboxObject is None:
00145         self.aboxObject = srs_knowledge.msg.ABoxObject()
00146       if self.tboxObject is None:
00147         self.tboxObject = srs_knowledge.msg.TBoxObject()
00148       end = 0
00149       start = end
00150       end += 4
00151       (length,) = _struct_I.unpack(str[start:end])
00152       start = end
00153       end += length
00154       if python3:
00155         self.task = str[start:end].decode('utf-8')
00156       else:
00157         self.task = str[start:end]
00158       start = end
00159       end += 4
00160       (length,) = _struct_I.unpack(str[start:end])
00161       start = end
00162       end += length
00163       if python3:
00164         self.objectOrClass = str[start:end].decode('utf-8')
00165       else:
00166         self.objectOrClass = str[start:end]
00167       start = end
00168       end += 4
00169       (self.aboxObject.object_id,) = _struct_i.unpack(str[start:end])
00170       start = end
00171       end += 4
00172       (length,) = _struct_I.unpack(str[start:end])
00173       start = end
00174       end += length
00175       if python3:
00176         self.aboxObject.name = str[start:end].decode('utf-8')
00177       else:
00178         self.aboxObject.name = str[start:end]
00179       start = end
00180       end += 4
00181       (length,) = _struct_I.unpack(str[start:end])
00182       start = end
00183       end += length
00184       if python3:
00185         self.aboxObject.description = str[start:end].decode('utf-8')
00186       else:
00187         self.aboxObject.description = str[start:end]
00188       start = end
00189       end += 4
00190       (self.tboxObject.class_id,) = _struct_i.unpack(str[start:end])
00191       start = end
00192       end += 4
00193       (length,) = _struct_I.unpack(str[start:end])
00194       start = end
00195       end += length
00196       if python3:
00197         self.tboxObject.name = str[start:end].decode('utf-8')
00198       else:
00199         self.tboxObject.name = str[start:end]
00200       start = end
00201       end += 4
00202       (length,) = _struct_I.unpack(str[start:end])
00203       start = end
00204       end += length
00205       if python3:
00206         self.tboxObject.description = str[start:end].decode('utf-8')
00207       else:
00208         self.tboxObject.description = str[start:end]
00209       start = end
00210       end += 4
00211       (length,) = _struct_I.unpack(str[start:end])
00212       self.tboxObject.properties = []
00213       for i in range(0, length):
00214         start = end
00215         end += 4
00216         (length,) = _struct_I.unpack(str[start:end])
00217         start = end
00218         end += length
00219         if python3:
00220           val1 = str[start:end].decode('utf-8')
00221         else:
00222           val1 = str[start:end]
00223         self.tboxObject.properties.append(val1)
00224       start = end
00225       end += 4
00226       (length,) = _struct_I.unpack(str[start:end])
00227       pattern = '<%si'%length
00228       start = end
00229       end += struct.calcsize(pattern)
00230       self.tboxObject.subjects = struct.unpack(pattern, str[start:end])
00231       return self
00232     except struct.error as e:
00233       raise genpy.DeserializationError(e) #most likely buffer underfill
00234 
00235 
00236   def serialize_numpy(self, buff, numpy):
00237     """
00238     serialize message with numpy array types into buffer
00239     :param buff: buffer, ``StringIO``
00240     :param numpy: numpy python module
00241     """
00242     try:
00243       _x = self.task
00244       length = len(_x)
00245       if python3 or type(_x) == unicode:
00246         _x = _x.encode('utf-8')
00247         length = len(_x)
00248       buff.write(struct.pack('<I%ss'%length, length, _x))
00249       _x = self.objectOrClass
00250       length = len(_x)
00251       if python3 or type(_x) == unicode:
00252         _x = _x.encode('utf-8')
00253         length = len(_x)
00254       buff.write(struct.pack('<I%ss'%length, length, _x))
00255       buff.write(_struct_i.pack(self.aboxObject.object_id))
00256       _x = self.aboxObject.name
00257       length = len(_x)
00258       if python3 or type(_x) == unicode:
00259         _x = _x.encode('utf-8')
00260         length = len(_x)
00261       buff.write(struct.pack('<I%ss'%length, length, _x))
00262       _x = self.aboxObject.description
00263       length = len(_x)
00264       if python3 or type(_x) == unicode:
00265         _x = _x.encode('utf-8')
00266         length = len(_x)
00267       buff.write(struct.pack('<I%ss'%length, length, _x))
00268       buff.write(_struct_i.pack(self.tboxObject.class_id))
00269       _x = self.tboxObject.name
00270       length = len(_x)
00271       if python3 or type(_x) == unicode:
00272         _x = _x.encode('utf-8')
00273         length = len(_x)
00274       buff.write(struct.pack('<I%ss'%length, length, _x))
00275       _x = self.tboxObject.description
00276       length = len(_x)
00277       if python3 or type(_x) == unicode:
00278         _x = _x.encode('utf-8')
00279         length = len(_x)
00280       buff.write(struct.pack('<I%ss'%length, length, _x))
00281       length = len(self.tboxObject.properties)
00282       buff.write(_struct_I.pack(length))
00283       for val1 in self.tboxObject.properties:
00284         length = len(val1)
00285         if python3 or type(val1) == unicode:
00286           val1 = val1.encode('utf-8')
00287           length = len(val1)
00288         buff.write(struct.pack('<I%ss'%length, length, val1))
00289       length = len(self.tboxObject.subjects)
00290       buff.write(_struct_I.pack(length))
00291       pattern = '<%si'%length
00292       buff.write(self.tboxObject.subjects.tostring())
00293     except struct.error as se: self._check_types(se)
00294     except TypeError as te: self._check_types(te)
00295 
00296   def deserialize_numpy(self, str, numpy):
00297     """
00298     unpack serialized message in str into this message instance using numpy for array types
00299     :param str: byte array of serialized message, ``str``
00300     :param numpy: numpy python module
00301     """
00302     try:
00303       if self.aboxObject is None:
00304         self.aboxObject = srs_knowledge.msg.ABoxObject()
00305       if self.tboxObject is None:
00306         self.tboxObject = srs_knowledge.msg.TBoxObject()
00307       end = 0
00308       start = end
00309       end += 4
00310       (length,) = _struct_I.unpack(str[start:end])
00311       start = end
00312       end += length
00313       if python3:
00314         self.task = str[start:end].decode('utf-8')
00315       else:
00316         self.task = str[start:end]
00317       start = end
00318       end += 4
00319       (length,) = _struct_I.unpack(str[start:end])
00320       start = end
00321       end += length
00322       if python3:
00323         self.objectOrClass = str[start:end].decode('utf-8')
00324       else:
00325         self.objectOrClass = str[start:end]
00326       start = end
00327       end += 4
00328       (self.aboxObject.object_id,) = _struct_i.unpack(str[start:end])
00329       start = end
00330       end += 4
00331       (length,) = _struct_I.unpack(str[start:end])
00332       start = end
00333       end += length
00334       if python3:
00335         self.aboxObject.name = str[start:end].decode('utf-8')
00336       else:
00337         self.aboxObject.name = str[start:end]
00338       start = end
00339       end += 4
00340       (length,) = _struct_I.unpack(str[start:end])
00341       start = end
00342       end += length
00343       if python3:
00344         self.aboxObject.description = str[start:end].decode('utf-8')
00345       else:
00346         self.aboxObject.description = str[start:end]
00347       start = end
00348       end += 4
00349       (self.tboxObject.class_id,) = _struct_i.unpack(str[start:end])
00350       start = end
00351       end += 4
00352       (length,) = _struct_I.unpack(str[start:end])
00353       start = end
00354       end += length
00355       if python3:
00356         self.tboxObject.name = str[start:end].decode('utf-8')
00357       else:
00358         self.tboxObject.name = str[start:end]
00359       start = end
00360       end += 4
00361       (length,) = _struct_I.unpack(str[start:end])
00362       start = end
00363       end += length
00364       if python3:
00365         self.tboxObject.description = str[start:end].decode('utf-8')
00366       else:
00367         self.tboxObject.description = str[start:end]
00368       start = end
00369       end += 4
00370       (length,) = _struct_I.unpack(str[start:end])
00371       self.tboxObject.properties = []
00372       for i in range(0, length):
00373         start = end
00374         end += 4
00375         (length,) = _struct_I.unpack(str[start:end])
00376         start = end
00377         end += length
00378         if python3:
00379           val1 = str[start:end].decode('utf-8')
00380         else:
00381           val1 = str[start:end]
00382         self.tboxObject.properties.append(val1)
00383       start = end
00384       end += 4
00385       (length,) = _struct_I.unpack(str[start:end])
00386       pattern = '<%si'%length
00387       start = end
00388       end += struct.calcsize(pattern)
00389       self.tboxObject.subjects = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00390       return self
00391     except struct.error as e:
00392       raise genpy.DeserializationError(e) #most likely buffer underfill
00393 
00394 _struct_I = genpy.struct_I
00395 _struct_i = struct.Struct("<i")
00396 """autogenerated by genpy from srs_knowledge/GenerateSequenceResponse.msg. Do not edit."""
00397 import sys
00398 python3 = True if sys.hexversion > 0x03000000 else False
00399 import genpy
00400 import struct
00401 
00402 import srs_knowledge.msg
00403 
00404 class GenerateSequenceResponse(genpy.Message):
00405   _md5sum = "3ae845dd4707356c6abaa6d2a05e9ebb"
00406   _type = "srs_knowledge/GenerateSequenceResponse"
00407   _has_header = False #flag to mark the presence of a Header object
00408   _full_text = """
00409 CUAction[] actionSequence
00410 
00411 ================================================================================
00412 MSG: srs_knowledge/CUAction
00413 # still at alpha stage. not finalised yet. 
00414 
00415 # indicate if task finished successfully (1); no feasible solution (-1); continue executing the given actions in this message (0)
00416 int32 status
00417 
00418 # [ifNavigate, ifDetect, ifGrasp]. 0: yes, 1: no, 2: others (undefined)
00419 #int32[] actionFlags
00420 
00421 #MoveAction ma
00422 #PerceptionAction pa
00423 #GraspAction ga
00424 GenericAction generic
00425 
00426 # move, perception, grasp, or generic
00427 string actionType
00428 ================================================================================
00429 MSG: srs_knowledge/GenericAction
00430 # use a list as the information container of an action
00431 # BE CAREFUL WHEN USING IT. FOR FLEXIBILITY REASON OR TESTING NEW ADDED ACTION TYPE 
00432 # string[] actionInfo    # to deprecate
00433 string jsonActionInfo
00434 
00435 """
00436   __slots__ = ['actionSequence']
00437   _slot_types = ['srs_knowledge/CUAction[]']
00438 
00439   def __init__(self, *args, **kwds):
00440     """
00441     Constructor. Any message fields that are implicitly/explicitly
00442     set to None will be assigned a default value. The recommend
00443     use is keyword arguments as this is more robust to future message
00444     changes.  You cannot mix in-order arguments and keyword arguments.
00445 
00446     The available fields are:
00447        actionSequence
00448 
00449     :param args: complete set of field values, in .msg order
00450     :param kwds: use keyword arguments corresponding to message field names
00451     to set specific fields.
00452     """
00453     if args or kwds:
00454       super(GenerateSequenceResponse, self).__init__(*args, **kwds)
00455       #message fields cannot be None, assign default values for those that are
00456       if self.actionSequence is None:
00457         self.actionSequence = []
00458     else:
00459       self.actionSequence = []
00460 
00461   def _get_types(self):
00462     """
00463     internal API method
00464     """
00465     return self._slot_types
00466 
00467   def serialize(self, buff):
00468     """
00469     serialize message into buffer
00470     :param buff: buffer, ``StringIO``
00471     """
00472     try:
00473       length = len(self.actionSequence)
00474       buff.write(_struct_I.pack(length))
00475       for val1 in self.actionSequence:
00476         buff.write(_struct_i.pack(val1.status))
00477         _v1 = val1.generic
00478         _x = _v1.jsonActionInfo
00479         length = len(_x)
00480         if python3 or type(_x) == unicode:
00481           _x = _x.encode('utf-8')
00482           length = len(_x)
00483         buff.write(struct.pack('<I%ss'%length, length, _x))
00484         _x = val1.actionType
00485         length = len(_x)
00486         if python3 or type(_x) == unicode:
00487           _x = _x.encode('utf-8')
00488           length = len(_x)
00489         buff.write(struct.pack('<I%ss'%length, length, _x))
00490     except struct.error as se: self._check_types(se)
00491     except TypeError as te: self._check_types(te)
00492 
00493   def deserialize(self, str):
00494     """
00495     unpack serialized message in str into this message instance
00496     :param str: byte array of serialized message, ``str``
00497     """
00498     try:
00499       if self.actionSequence is None:
00500         self.actionSequence = None
00501       end = 0
00502       start = end
00503       end += 4
00504       (length,) = _struct_I.unpack(str[start:end])
00505       self.actionSequence = []
00506       for i in range(0, length):
00507         val1 = srs_knowledge.msg.CUAction()
00508         start = end
00509         end += 4
00510         (val1.status,) = _struct_i.unpack(str[start:end])
00511         _v2 = val1.generic
00512         start = end
00513         end += 4
00514         (length,) = _struct_I.unpack(str[start:end])
00515         start = end
00516         end += length
00517         if python3:
00518           _v2.jsonActionInfo = str[start:end].decode('utf-8')
00519         else:
00520           _v2.jsonActionInfo = str[start:end]
00521         start = end
00522         end += 4
00523         (length,) = _struct_I.unpack(str[start:end])
00524         start = end
00525         end += length
00526         if python3:
00527           val1.actionType = str[start:end].decode('utf-8')
00528         else:
00529           val1.actionType = str[start:end]
00530         self.actionSequence.append(val1)
00531       return self
00532     except struct.error as e:
00533       raise genpy.DeserializationError(e) #most likely buffer underfill
00534 
00535 
00536   def serialize_numpy(self, buff, numpy):
00537     """
00538     serialize message with numpy array types into buffer
00539     :param buff: buffer, ``StringIO``
00540     :param numpy: numpy python module
00541     """
00542     try:
00543       length = len(self.actionSequence)
00544       buff.write(_struct_I.pack(length))
00545       for val1 in self.actionSequence:
00546         buff.write(_struct_i.pack(val1.status))
00547         _v3 = val1.generic
00548         _x = _v3.jsonActionInfo
00549         length = len(_x)
00550         if python3 or type(_x) == unicode:
00551           _x = _x.encode('utf-8')
00552           length = len(_x)
00553         buff.write(struct.pack('<I%ss'%length, length, _x))
00554         _x = val1.actionType
00555         length = len(_x)
00556         if python3 or type(_x) == unicode:
00557           _x = _x.encode('utf-8')
00558           length = len(_x)
00559         buff.write(struct.pack('<I%ss'%length, length, _x))
00560     except struct.error as se: self._check_types(se)
00561     except TypeError as te: self._check_types(te)
00562 
00563   def deserialize_numpy(self, str, numpy):
00564     """
00565     unpack serialized message in str into this message instance using numpy for array types
00566     :param str: byte array of serialized message, ``str``
00567     :param numpy: numpy python module
00568     """
00569     try:
00570       if self.actionSequence is None:
00571         self.actionSequence = None
00572       end = 0
00573       start = end
00574       end += 4
00575       (length,) = _struct_I.unpack(str[start:end])
00576       self.actionSequence = []
00577       for i in range(0, length):
00578         val1 = srs_knowledge.msg.CUAction()
00579         start = end
00580         end += 4
00581         (val1.status,) = _struct_i.unpack(str[start:end])
00582         _v4 = val1.generic
00583         start = end
00584         end += 4
00585         (length,) = _struct_I.unpack(str[start:end])
00586         start = end
00587         end += length
00588         if python3:
00589           _v4.jsonActionInfo = str[start:end].decode('utf-8')
00590         else:
00591           _v4.jsonActionInfo = str[start:end]
00592         start = end
00593         end += 4
00594         (length,) = _struct_I.unpack(str[start:end])
00595         start = end
00596         end += length
00597         if python3:
00598           val1.actionType = str[start:end].decode('utf-8')
00599         else:
00600           val1.actionType = str[start:end]
00601         self.actionSequence.append(val1)
00602       return self
00603     except struct.error as e:
00604       raise genpy.DeserializationError(e) #most likely buffer underfill
00605 
00606 _struct_I = genpy.struct_I
00607 _struct_i = struct.Struct("<i")
00608 class GenerateSequence(object):
00609   _type          = 'srs_knowledge/GenerateSequence'
00610   _md5sum = '57423689670151932a208b25e4d16c4f'
00611   _request_class  = GenerateSequenceRequest
00612   _response_class = GenerateSequenceResponse


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