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


pr2_self_test_msgs
Author(s): Kevin Watts
autogenerated on Sat Dec 28 2013 17:29:33