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