_TaskRequest.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_knowledge/TaskRequestRequest.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 TaskRequestRequest(genpy.Message):
00009   _md5sum = "7e3d775419da798c607d4939563bd225"
00010   _type = "srs_knowledge/TaskRequestRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 
00016 string task
00017 
00018 
00019 string content
00020 
00021 string json_parameters
00022 
00023 
00024 
00025 
00026 
00027 string userPose
00028 
00029 
00030 """
00031   __slots__ = ['task','content','json_parameters','userPose']
00032   _slot_types = ['string','string','string','string']
00033 
00034   def __init__(self, *args, **kwds):
00035     """
00036     Constructor. Any message fields that are implicitly/explicitly
00037     set to None will be assigned a default value. The recommend
00038     use is keyword arguments as this is more robust to future message
00039     changes.  You cannot mix in-order arguments and keyword arguments.
00040 
00041     The available fields are:
00042        task,content,json_parameters,userPose
00043 
00044     :param args: complete set of field values, in .msg order
00045     :param kwds: use keyword arguments corresponding to message field names
00046     to set specific fields.
00047     """
00048     if args or kwds:
00049       super(TaskRequestRequest, self).__init__(*args, **kwds)
00050       #message fields cannot be None, assign default values for those that are
00051       if self.task is None:
00052         self.task = ''
00053       if self.content is None:
00054         self.content = ''
00055       if self.json_parameters is None:
00056         self.json_parameters = ''
00057       if self.userPose is None:
00058         self.userPose = ''
00059     else:
00060       self.task = ''
00061       self.content = ''
00062       self.json_parameters = ''
00063       self.userPose = ''
00064 
00065   def _get_types(self):
00066     """
00067     internal API method
00068     """
00069     return self._slot_types
00070 
00071   def serialize(self, buff):
00072     """
00073     serialize message into buffer
00074     :param buff: buffer, ``StringIO``
00075     """
00076     try:
00077       _x = self.task
00078       length = len(_x)
00079       if python3 or type(_x) == unicode:
00080         _x = _x.encode('utf-8')
00081         length = len(_x)
00082       buff.write(struct.pack('<I%ss'%length, length, _x))
00083       _x = self.content
00084       length = len(_x)
00085       if python3 or type(_x) == unicode:
00086         _x = _x.encode('utf-8')
00087         length = len(_x)
00088       buff.write(struct.pack('<I%ss'%length, length, _x))
00089       _x = self.json_parameters
00090       length = len(_x)
00091       if python3 or type(_x) == unicode:
00092         _x = _x.encode('utf-8')
00093         length = len(_x)
00094       buff.write(struct.pack('<I%ss'%length, length, _x))
00095       _x = self.userPose
00096       length = len(_x)
00097       if python3 or type(_x) == unicode:
00098         _x = _x.encode('utf-8')
00099         length = len(_x)
00100       buff.write(struct.pack('<I%ss'%length, length, _x))
00101     except struct.error as se: self._check_types(se)
00102     except TypeError as te: self._check_types(te)
00103 
00104   def deserialize(self, str):
00105     """
00106     unpack serialized message in str into this message instance
00107     :param str: byte array of serialized message, ``str``
00108     """
00109     try:
00110       end = 0
00111       start = end
00112       end += 4
00113       (length,) = _struct_I.unpack(str[start:end])
00114       start = end
00115       end += length
00116       if python3:
00117         self.task = str[start:end].decode('utf-8')
00118       else:
00119         self.task = str[start:end]
00120       start = end
00121       end += 4
00122       (length,) = _struct_I.unpack(str[start:end])
00123       start = end
00124       end += length
00125       if python3:
00126         self.content = str[start:end].decode('utf-8')
00127       else:
00128         self.content = str[start:end]
00129       start = end
00130       end += 4
00131       (length,) = _struct_I.unpack(str[start:end])
00132       start = end
00133       end += length
00134       if python3:
00135         self.json_parameters = str[start:end].decode('utf-8')
00136       else:
00137         self.json_parameters = str[start:end]
00138       start = end
00139       end += 4
00140       (length,) = _struct_I.unpack(str[start:end])
00141       start = end
00142       end += length
00143       if python3:
00144         self.userPose = str[start:end].decode('utf-8')
00145       else:
00146         self.userPose = str[start:end]
00147       return self
00148     except struct.error as e:
00149       raise genpy.DeserializationError(e) #most likely buffer underfill
00150 
00151 
00152   def serialize_numpy(self, buff, numpy):
00153     """
00154     serialize message with numpy array types into buffer
00155     :param buff: buffer, ``StringIO``
00156     :param numpy: numpy python module
00157     """
00158     try:
00159       _x = self.task
00160       length = len(_x)
00161       if python3 or type(_x) == unicode:
00162         _x = _x.encode('utf-8')
00163         length = len(_x)
00164       buff.write(struct.pack('<I%ss'%length, length, _x))
00165       _x = self.content
00166       length = len(_x)
00167       if python3 or type(_x) == unicode:
00168         _x = _x.encode('utf-8')
00169         length = len(_x)
00170       buff.write(struct.pack('<I%ss'%length, length, _x))
00171       _x = self.json_parameters
00172       length = len(_x)
00173       if python3 or type(_x) == unicode:
00174         _x = _x.encode('utf-8')
00175         length = len(_x)
00176       buff.write(struct.pack('<I%ss'%length, length, _x))
00177       _x = self.userPose
00178       length = len(_x)
00179       if python3 or type(_x) == unicode:
00180         _x = _x.encode('utf-8')
00181         length = len(_x)
00182       buff.write(struct.pack('<I%ss'%length, length, _x))
00183     except struct.error as se: self._check_types(se)
00184     except TypeError as te: self._check_types(te)
00185 
00186   def deserialize_numpy(self, str, numpy):
00187     """
00188     unpack serialized message in str into this message instance using numpy for array types
00189     :param str: byte array of serialized message, ``str``
00190     :param numpy: numpy python module
00191     """
00192     try:
00193       end = 0
00194       start = end
00195       end += 4
00196       (length,) = _struct_I.unpack(str[start:end])
00197       start = end
00198       end += length
00199       if python3:
00200         self.task = str[start:end].decode('utf-8')
00201       else:
00202         self.task = str[start:end]
00203       start = end
00204       end += 4
00205       (length,) = _struct_I.unpack(str[start:end])
00206       start = end
00207       end += length
00208       if python3:
00209         self.content = str[start:end].decode('utf-8')
00210       else:
00211         self.content = str[start:end]
00212       start = end
00213       end += 4
00214       (length,) = _struct_I.unpack(str[start:end])
00215       start = end
00216       end += length
00217       if python3:
00218         self.json_parameters = str[start:end].decode('utf-8')
00219       else:
00220         self.json_parameters = str[start:end]
00221       start = end
00222       end += 4
00223       (length,) = _struct_I.unpack(str[start:end])
00224       start = end
00225       end += length
00226       if python3:
00227         self.userPose = str[start:end].decode('utf-8')
00228       else:
00229         self.userPose = str[start:end]
00230       return self
00231     except struct.error as e:
00232       raise genpy.DeserializationError(e) #most likely buffer underfill
00233 
00234 _struct_I = genpy.struct_I
00235 """autogenerated by genpy from srs_knowledge/TaskRequestResponse.msg. Do not edit."""
00236 import sys
00237 python3 = True if sys.hexversion > 0x03000000 else False
00238 import genpy
00239 import struct
00240 
00241 
00242 class TaskRequestResponse(genpy.Message):
00243   _md5sum = "db978a873040c67d04a65b0bd9ae7146"
00244   _type = "srs_knowledge/TaskRequestResponse"
00245   _has_header = False #flag to mark the presence of a Header object
00246   _full_text = """
00247 
00248 int32 result
00249 
00250 
00251 int32 sessionId
00252 
00253 
00254 string description
00255 
00256 
00257 """
00258   __slots__ = ['result','sessionId','description']
00259   _slot_types = ['int32','int32','string']
00260 
00261   def __init__(self, *args, **kwds):
00262     """
00263     Constructor. Any message fields that are implicitly/explicitly
00264     set to None will be assigned a default value. The recommend
00265     use is keyword arguments as this is more robust to future message
00266     changes.  You cannot mix in-order arguments and keyword arguments.
00267 
00268     The available fields are:
00269        result,sessionId,description
00270 
00271     :param args: complete set of field values, in .msg order
00272     :param kwds: use keyword arguments corresponding to message field names
00273     to set specific fields.
00274     """
00275     if args or kwds:
00276       super(TaskRequestResponse, self).__init__(*args, **kwds)
00277       #message fields cannot be None, assign default values for those that are
00278       if self.result is None:
00279         self.result = 0
00280       if self.sessionId is None:
00281         self.sessionId = 0
00282       if self.description is None:
00283         self.description = ''
00284     else:
00285       self.result = 0
00286       self.sessionId = 0
00287       self.description = ''
00288 
00289   def _get_types(self):
00290     """
00291     internal API method
00292     """
00293     return self._slot_types
00294 
00295   def serialize(self, buff):
00296     """
00297     serialize message into buffer
00298     :param buff: buffer, ``StringIO``
00299     """
00300     try:
00301       _x = self
00302       buff.write(_struct_2i.pack(_x.result, _x.sessionId))
00303       _x = self.description
00304       length = len(_x)
00305       if python3 or type(_x) == unicode:
00306         _x = _x.encode('utf-8')
00307         length = len(_x)
00308       buff.write(struct.pack('<I%ss'%length, length, _x))
00309     except struct.error as se: self._check_types(se)
00310     except TypeError as te: self._check_types(te)
00311 
00312   def deserialize(self, str):
00313     """
00314     unpack serialized message in str into this message instance
00315     :param str: byte array of serialized message, ``str``
00316     """
00317     try:
00318       end = 0
00319       _x = self
00320       start = end
00321       end += 8
00322       (_x.result, _x.sessionId,) = _struct_2i.unpack(str[start:end])
00323       start = end
00324       end += 4
00325       (length,) = _struct_I.unpack(str[start:end])
00326       start = end
00327       end += length
00328       if python3:
00329         self.description = str[start:end].decode('utf-8')
00330       else:
00331         self.description = str[start:end]
00332       return self
00333     except struct.error as e:
00334       raise genpy.DeserializationError(e) #most likely buffer underfill
00335 
00336 
00337   def serialize_numpy(self, buff, numpy):
00338     """
00339     serialize message with numpy array types into buffer
00340     :param buff: buffer, ``StringIO``
00341     :param numpy: numpy python module
00342     """
00343     try:
00344       _x = self
00345       buff.write(_struct_2i.pack(_x.result, _x.sessionId))
00346       _x = self.description
00347       length = len(_x)
00348       if python3 or type(_x) == unicode:
00349         _x = _x.encode('utf-8')
00350         length = len(_x)
00351       buff.write(struct.pack('<I%ss'%length, length, _x))
00352     except struct.error as se: self._check_types(se)
00353     except TypeError as te: self._check_types(te)
00354 
00355   def deserialize_numpy(self, str, numpy):
00356     """
00357     unpack serialized message in str into this message instance using numpy for array types
00358     :param str: byte array of serialized message, ``str``
00359     :param numpy: numpy python module
00360     """
00361     try:
00362       end = 0
00363       _x = self
00364       start = end
00365       end += 8
00366       (_x.result, _x.sessionId,) = _struct_2i.unpack(str[start:end])
00367       start = end
00368       end += 4
00369       (length,) = _struct_I.unpack(str[start:end])
00370       start = end
00371       end += length
00372       if python3:
00373         self.description = str[start:end].decode('utf-8')
00374       else:
00375         self.description = str[start:end]
00376       return self
00377     except struct.error as e:
00378       raise genpy.DeserializationError(e) #most likely buffer underfill
00379 
00380 _struct_I = genpy.struct_I
00381 _struct_2i = struct.Struct("<2i")
00382 class TaskRequest(object):
00383   _type          = 'srs_knowledge/TaskRequest'
00384   _md5sum = '1c55d07cc3cf6a5f7566797040a765f2'
00385   _request_class  = TaskRequestRequest
00386   _response_class = TaskRequestResponse


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