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