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
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
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
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 _x = val1.image
00115 length = len(_x)
00116
00117 if type(_x) in [list, tuple]:
00118 buff.write(struct.pack('<I%sB'%length, length, *_x))
00119 else:
00120 buff.write(struct.pack('<I%ss'%length, length, _x))
00121 _x = val1.image_format
00122 length = len(_x)
00123 buff.write(struct.pack('<I%ss'%length, length, _x))
00124 length = len(self.params)
00125 buff.write(_struct_I.pack(length))
00126 for val1 in self.params:
00127 _x = val1.key
00128 length = len(_x)
00129 buff.write(struct.pack('<I%ss'%length, length, _x))
00130 _x = val1.value
00131 length = len(_x)
00132 buff.write(struct.pack('<I%ss'%length, length, _x))
00133 length = len(self.values)
00134 buff.write(_struct_I.pack(length))
00135 for val1 in self.values:
00136 _x = val1.key
00137 length = len(_x)
00138 buff.write(struct.pack('<I%ss'%length, length, _x))
00139 _x = val1.value
00140 length = len(_x)
00141 buff.write(struct.pack('<I%ss'%length, length, _x))
00142 _x = val1.min
00143 length = len(_x)
00144 buff.write(struct.pack('<I%ss'%length, length, _x))
00145 _x = val1.max
00146 length = len(_x)
00147 buff.write(struct.pack('<I%ss'%length, length, _x))
00148 except struct.error, se: self._check_types(se)
00149 except TypeError, te: self._check_types(te)
00150
00151 def deserialize(self, str):
00152 """
00153 unpack serialized message in str into this message instance
00154 @param str: byte array of serialized message
00155 @type str: str
00156 """
00157 try:
00158 end = 0
00159 start = end
00160 end += 4
00161 (length,) = _struct_I.unpack(str[start:end])
00162 start = end
00163 end += length
00164 self.html_result = str[start:end]
00165 start = end
00166 end += 4
00167 (length,) = _struct_I.unpack(str[start:end])
00168 start = end
00169 end += length
00170 self.text_summary = str[start:end]
00171 start = end
00172 end += 1
00173 (self.result,) = _struct_b.unpack(str[start:end])
00174 start = end
00175 end += 4
00176 (length,) = _struct_I.unpack(str[start:end])
00177 self.plots = []
00178 for i in xrange(0, length):
00179 val1 = pr2_self_test_msgs.msg.Plot()
00180 start = end
00181 end += 4
00182 (length,) = _struct_I.unpack(str[start:end])
00183 start = end
00184 end += length
00185 val1.title = str[start:end]
00186 start = end
00187 end += 4
00188 (length,) = _struct_I.unpack(str[start:end])
00189 start = end
00190 end += length
00191 val1.image = str[start:end]
00192 start = end
00193 end += 4
00194 (length,) = _struct_I.unpack(str[start:end])
00195 start = end
00196 end += length
00197 val1.image_format = str[start:end]
00198 self.plots.append(val1)
00199 start = end
00200 end += 4
00201 (length,) = _struct_I.unpack(str[start:end])
00202 self.params = []
00203 for i in xrange(0, length):
00204 val1 = pr2_self_test_msgs.msg.TestParam()
00205 start = end
00206 end += 4
00207 (length,) = _struct_I.unpack(str[start:end])
00208 start = end
00209 end += length
00210 val1.key = str[start:end]
00211 start = end
00212 end += 4
00213 (length,) = _struct_I.unpack(str[start:end])
00214 start = end
00215 end += length
00216 val1.value = str[start:end]
00217 self.params.append(val1)
00218 start = end
00219 end += 4
00220 (length,) = _struct_I.unpack(str[start:end])
00221 self.values = []
00222 for i in xrange(0, length):
00223 val1 = pr2_self_test_msgs.msg.TestValue()
00224 start = end
00225 end += 4
00226 (length,) = _struct_I.unpack(str[start:end])
00227 start = end
00228 end += length
00229 val1.key = str[start:end]
00230 start = end
00231 end += 4
00232 (length,) = _struct_I.unpack(str[start:end])
00233 start = end
00234 end += length
00235 val1.value = str[start:end]
00236 start = end
00237 end += 4
00238 (length,) = _struct_I.unpack(str[start:end])
00239 start = end
00240 end += length
00241 val1.min = str[start:end]
00242 start = end
00243 end += 4
00244 (length,) = _struct_I.unpack(str[start:end])
00245 start = end
00246 end += length
00247 val1.max = str[start:end]
00248 self.values.append(val1)
00249 return self
00250 except struct.error, e:
00251 raise roslib.message.DeserializationError(e)
00252
00253
00254 def serialize_numpy(self, buff, numpy):
00255 """
00256 serialize message with numpy array types into buffer
00257 @param buff: buffer
00258 @type buff: StringIO
00259 @param numpy: numpy python module
00260 @type numpy module
00261 """
00262 try:
00263 _x = self.html_result
00264 length = len(_x)
00265 buff.write(struct.pack('<I%ss'%length, length, _x))
00266 _x = self.text_summary
00267 length = len(_x)
00268 buff.write(struct.pack('<I%ss'%length, length, _x))
00269 buff.write(_struct_b.pack(self.result))
00270 length = len(self.plots)
00271 buff.write(_struct_I.pack(length))
00272 for val1 in self.plots:
00273 _x = val1.title
00274 length = len(_x)
00275 buff.write(struct.pack('<I%ss'%length, length, _x))
00276 _x = val1.image
00277 length = len(_x)
00278
00279 if type(_x) in [list, tuple]:
00280 buff.write(struct.pack('<I%sB'%length, length, *_x))
00281 else:
00282 buff.write(struct.pack('<I%ss'%length, length, _x))
00283 _x = val1.image_format
00284 length = len(_x)
00285 buff.write(struct.pack('<I%ss'%length, length, _x))
00286 length = len(self.params)
00287 buff.write(_struct_I.pack(length))
00288 for val1 in self.params:
00289 _x = val1.key
00290 length = len(_x)
00291 buff.write(struct.pack('<I%ss'%length, length, _x))
00292 _x = val1.value
00293 length = len(_x)
00294 buff.write(struct.pack('<I%ss'%length, length, _x))
00295 length = len(self.values)
00296 buff.write(_struct_I.pack(length))
00297 for val1 in self.values:
00298 _x = val1.key
00299 length = len(_x)
00300 buff.write(struct.pack('<I%ss'%length, length, _x))
00301 _x = val1.value
00302 length = len(_x)
00303 buff.write(struct.pack('<I%ss'%length, length, _x))
00304 _x = val1.min
00305 length = len(_x)
00306 buff.write(struct.pack('<I%ss'%length, length, _x))
00307 _x = val1.max
00308 length = len(_x)
00309 buff.write(struct.pack('<I%ss'%length, length, _x))
00310 except struct.error, se: self._check_types(se)
00311 except TypeError, te: self._check_types(te)
00312
00313 def deserialize_numpy(self, str, numpy):
00314 """
00315 unpack serialized message in str into this message instance using numpy for array types
00316 @param str: byte array of serialized message
00317 @type str: str
00318 @param numpy: numpy python module
00319 @type numpy: module
00320 """
00321 try:
00322 end = 0
00323 start = end
00324 end += 4
00325 (length,) = _struct_I.unpack(str[start:end])
00326 start = end
00327 end += length
00328 self.html_result = str[start:end]
00329 start = end
00330 end += 4
00331 (length,) = _struct_I.unpack(str[start:end])
00332 start = end
00333 end += length
00334 self.text_summary = str[start:end]
00335 start = end
00336 end += 1
00337 (self.result,) = _struct_b.unpack(str[start:end])
00338 start = end
00339 end += 4
00340 (length,) = _struct_I.unpack(str[start:end])
00341 self.plots = []
00342 for i in xrange(0, length):
00343 val1 = pr2_self_test_msgs.msg.Plot()
00344 start = end
00345 end += 4
00346 (length,) = _struct_I.unpack(str[start:end])
00347 start = end
00348 end += length
00349 val1.title = str[start:end]
00350 start = end
00351 end += 4
00352 (length,) = _struct_I.unpack(str[start:end])
00353 start = end
00354 end += length
00355 val1.image = str[start:end]
00356 start = end
00357 end += 4
00358 (length,) = _struct_I.unpack(str[start:end])
00359 start = end
00360 end += length
00361 val1.image_format = str[start:end]
00362 self.plots.append(val1)
00363 start = end
00364 end += 4
00365 (length,) = _struct_I.unpack(str[start:end])
00366 self.params = []
00367 for i in xrange(0, length):
00368 val1 = pr2_self_test_msgs.msg.TestParam()
00369 start = end
00370 end += 4
00371 (length,) = _struct_I.unpack(str[start:end])
00372 start = end
00373 end += length
00374 val1.key = str[start:end]
00375 start = end
00376 end += 4
00377 (length,) = _struct_I.unpack(str[start:end])
00378 start = end
00379 end += length
00380 val1.value = str[start:end]
00381 self.params.append(val1)
00382 start = end
00383 end += 4
00384 (length,) = _struct_I.unpack(str[start:end])
00385 self.values = []
00386 for i in xrange(0, length):
00387 val1 = pr2_self_test_msgs.msg.TestValue()
00388 start = end
00389 end += 4
00390 (length,) = _struct_I.unpack(str[start:end])
00391 start = end
00392 end += length
00393 val1.key = str[start:end]
00394 start = end
00395 end += 4
00396 (length,) = _struct_I.unpack(str[start:end])
00397 start = end
00398 end += length
00399 val1.value = str[start:end]
00400 start = end
00401 end += 4
00402 (length,) = _struct_I.unpack(str[start:end])
00403 start = end
00404 end += length
00405 val1.min = str[start:end]
00406 start = end
00407 end += 4
00408 (length,) = _struct_I.unpack(str[start:end])
00409 start = end
00410 end += length
00411 val1.max = str[start:end]
00412 self.values.append(val1)
00413 return self
00414 except struct.error, e:
00415 raise roslib.message.DeserializationError(e)
00416
00417 _struct_I = roslib.message.struct_I
00418 _struct_b = struct.Struct("<b")
00419 """autogenerated by genmsg_py from TestResultResponse.msg. Do not edit."""
00420 import roslib.message
00421 import struct
00422
00423
00424 class TestResultResponse(roslib.message.Message):
00425 _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00426 _type = "pr2_self_test_msgs/TestResultResponse"
00427 _has_header = False
00428 _full_text = """
00429
00430 """
00431 __slots__ = []
00432 _slot_types = []
00433
00434 def __init__(self, *args, **kwds):
00435 """
00436 Constructor. Any message fields that are implicitly/explicitly
00437 set to None will be assigned a default value. The recommend
00438 use is keyword arguments as this is more robust to future message
00439 changes. You cannot mix in-order arguments and keyword arguments.
00440
00441 The available fields are:
00442
00443
00444 @param args: complete set of field values, in .msg order
00445 @param kwds: use keyword arguments corresponding to message field names
00446 to set specific fields.
00447 """
00448 if args or kwds:
00449 super(TestResultResponse, self).__init__(*args, **kwds)
00450
00451 def _get_types(self):
00452 """
00453 internal API method
00454 """
00455 return self._slot_types
00456
00457 def serialize(self, buff):
00458 """
00459 serialize message into buffer
00460 @param buff: buffer
00461 @type buff: StringIO
00462 """
00463 try:
00464 pass
00465 except struct.error, se: self._check_types(se)
00466 except TypeError, te: self._check_types(te)
00467
00468 def deserialize(self, str):
00469 """
00470 unpack serialized message in str into this message instance
00471 @param str: byte array of serialized message
00472 @type str: str
00473 """
00474 try:
00475 end = 0
00476 return self
00477 except struct.error, e:
00478 raise roslib.message.DeserializationError(e)
00479
00480
00481 def serialize_numpy(self, buff, numpy):
00482 """
00483 serialize message with numpy array types into buffer
00484 @param buff: buffer
00485 @type buff: StringIO
00486 @param numpy: numpy python module
00487 @type numpy module
00488 """
00489 try:
00490 pass
00491 except struct.error, se: self._check_types(se)
00492 except TypeError, te: self._check_types(te)
00493
00494 def deserialize_numpy(self, str, numpy):
00495 """
00496 unpack serialized message in str into this message instance using numpy for array types
00497 @param str: byte array of serialized message
00498 @type str: str
00499 @param numpy: numpy python module
00500 @type numpy: module
00501 """
00502 try:
00503 end = 0
00504 return self
00505 except struct.error, e:
00506 raise roslib.message.DeserializationError(e)
00507
00508 _struct_I = roslib.message.struct_I
00509 class TestResult(roslib.message.ServiceDefinition):
00510 _type = 'pr2_self_test_msgs/TestResult'
00511 _md5sum = '3bc5fb8af85db1b7baaa0efa94b53344'
00512 _request_class = TestResultRequest
00513 _response_class = TestResultResponse