00001 """autogenerated by genmsg_py from TestInfo.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class TestInfo(roslib.message.Message):
00007 _md5sum = "594219b720ecaee963aa0b601d38b8f2"
00008 _type = "pr2_self_test_msgs/TestInfo"
00009 _has_header = False
00010 _full_text = """string serial
00011 string test_name
00012 byte test_status # 127, not launched, 0, ok; 1, warn; 2, error; 3, stale
00013 string bay_name
00014 string machine
00015 int32 board
00016 int32 breaker
00017 string power_status
00018 byte estop # 0, off; 1, on
00019 int32 elapsed
00020 string status_msg
00021 """
00022 __slots__ = ['serial','test_name','test_status','bay_name','machine','board','breaker','power_status','estop','elapsed','status_msg']
00023 _slot_types = ['string','string','byte','string','string','int32','int32','string','byte','int32','string']
00024
00025 def __init__(self, *args, **kwds):
00026 """
00027 Constructor. Any message fields that are implicitly/explicitly
00028 set to None will be assigned a default value. The recommend
00029 use is keyword arguments as this is more robust to future message
00030 changes. You cannot mix in-order arguments and keyword arguments.
00031
00032 The available fields are:
00033 serial,test_name,test_status,bay_name,machine,board,breaker,power_status,estop,elapsed,status_msg
00034
00035 @param args: complete set of field values, in .msg order
00036 @param kwds: use keyword arguments corresponding to message field names
00037 to set specific fields.
00038 """
00039 if args or kwds:
00040 super(TestInfo, self).__init__(*args, **kwds)
00041
00042 if self.serial is None:
00043 self.serial = ''
00044 if self.test_name is None:
00045 self.test_name = ''
00046 if self.test_status is None:
00047 self.test_status = 0
00048 if self.bay_name is None:
00049 self.bay_name = ''
00050 if self.machine is None:
00051 self.machine = ''
00052 if self.board is None:
00053 self.board = 0
00054 if self.breaker is None:
00055 self.breaker = 0
00056 if self.power_status is None:
00057 self.power_status = ''
00058 if self.estop is None:
00059 self.estop = 0
00060 if self.elapsed is None:
00061 self.elapsed = 0
00062 if self.status_msg is None:
00063 self.status_msg = ''
00064 else:
00065 self.serial = ''
00066 self.test_name = ''
00067 self.test_status = 0
00068 self.bay_name = ''
00069 self.machine = ''
00070 self.board = 0
00071 self.breaker = 0
00072 self.power_status = ''
00073 self.estop = 0
00074 self.elapsed = 0
00075 self.status_msg = ''
00076
00077 def _get_types(self):
00078 """
00079 internal API method
00080 """
00081 return self._slot_types
00082
00083 def serialize(self, buff):
00084 """
00085 serialize message into buffer
00086 @param buff: buffer
00087 @type buff: StringIO
00088 """
00089 try:
00090 _x = self.serial
00091 length = len(_x)
00092 buff.write(struct.pack('<I%ss'%length, length, _x))
00093 _x = self.test_name
00094 length = len(_x)
00095 buff.write(struct.pack('<I%ss'%length, length, _x))
00096 buff.write(_struct_b.pack(self.test_status))
00097 _x = self.bay_name
00098 length = len(_x)
00099 buff.write(struct.pack('<I%ss'%length, length, _x))
00100 _x = self.machine
00101 length = len(_x)
00102 buff.write(struct.pack('<I%ss'%length, length, _x))
00103 _x = self
00104 buff.write(_struct_2i.pack(_x.board, _x.breaker))
00105 _x = self.power_status
00106 length = len(_x)
00107 buff.write(struct.pack('<I%ss'%length, length, _x))
00108 _x = self
00109 buff.write(_struct_bi.pack(_x.estop, _x.elapsed))
00110 _x = self.status_msg
00111 length = len(_x)
00112 buff.write(struct.pack('<I%ss'%length, length, _x))
00113 except struct.error, se: self._check_types(se)
00114 except TypeError, te: self._check_types(te)
00115
00116 def deserialize(self, str):
00117 """
00118 unpack serialized message in str into this message instance
00119 @param str: byte array of serialized message
00120 @type str: str
00121 """
00122 try:
00123 end = 0
00124 start = end
00125 end += 4
00126 (length,) = _struct_I.unpack(str[start:end])
00127 start = end
00128 end += length
00129 self.serial = str[start:end]
00130 start = end
00131 end += 4
00132 (length,) = _struct_I.unpack(str[start:end])
00133 start = end
00134 end += length
00135 self.test_name = str[start:end]
00136 start = end
00137 end += 1
00138 (self.test_status,) = _struct_b.unpack(str[start:end])
00139 start = end
00140 end += 4
00141 (length,) = _struct_I.unpack(str[start:end])
00142 start = end
00143 end += length
00144 self.bay_name = str[start:end]
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 start = end
00149 end += length
00150 self.machine = str[start:end]
00151 _x = self
00152 start = end
00153 end += 8
00154 (_x.board, _x.breaker,) = _struct_2i.unpack(str[start:end])
00155 start = end
00156 end += 4
00157 (length,) = _struct_I.unpack(str[start:end])
00158 start = end
00159 end += length
00160 self.power_status = str[start:end]
00161 _x = self
00162 start = end
00163 end += 5
00164 (_x.estop, _x.elapsed,) = _struct_bi.unpack(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.status_msg = str[start:end]
00171 return self
00172 except struct.error, e:
00173 raise roslib.message.DeserializationError(e)
00174
00175
00176 def serialize_numpy(self, buff, numpy):
00177 """
00178 serialize message with numpy array types into buffer
00179 @param buff: buffer
00180 @type buff: StringIO
00181 @param numpy: numpy python module
00182 @type numpy module
00183 """
00184 try:
00185 _x = self.serial
00186 length = len(_x)
00187 buff.write(struct.pack('<I%ss'%length, length, _x))
00188 _x = self.test_name
00189 length = len(_x)
00190 buff.write(struct.pack('<I%ss'%length, length, _x))
00191 buff.write(_struct_b.pack(self.test_status))
00192 _x = self.bay_name
00193 length = len(_x)
00194 buff.write(struct.pack('<I%ss'%length, length, _x))
00195 _x = self.machine
00196 length = len(_x)
00197 buff.write(struct.pack('<I%ss'%length, length, _x))
00198 _x = self
00199 buff.write(_struct_2i.pack(_x.board, _x.breaker))
00200 _x = self.power_status
00201 length = len(_x)
00202 buff.write(struct.pack('<I%ss'%length, length, _x))
00203 _x = self
00204 buff.write(_struct_bi.pack(_x.estop, _x.elapsed))
00205 _x = self.status_msg
00206 length = len(_x)
00207 buff.write(struct.pack('<I%ss'%length, length, _x))
00208 except struct.error, se: self._check_types(se)
00209 except TypeError, te: self._check_types(te)
00210
00211 def deserialize_numpy(self, str, numpy):
00212 """
00213 unpack serialized message in str into this message instance using numpy for array types
00214 @param str: byte array of serialized message
00215 @type str: str
00216 @param numpy: numpy python module
00217 @type numpy: module
00218 """
00219 try:
00220 end = 0
00221 start = end
00222 end += 4
00223 (length,) = _struct_I.unpack(str[start:end])
00224 start = end
00225 end += length
00226 self.serial = str[start:end]
00227 start = end
00228 end += 4
00229 (length,) = _struct_I.unpack(str[start:end])
00230 start = end
00231 end += length
00232 self.test_name = str[start:end]
00233 start = end
00234 end += 1
00235 (self.test_status,) = _struct_b.unpack(str[start:end])
00236 start = end
00237 end += 4
00238 (length,) = _struct_I.unpack(str[start:end])
00239 start = end
00240 end += length
00241 self.bay_name = str[start:end]
00242 start = end
00243 end += 4
00244 (length,) = _struct_I.unpack(str[start:end])
00245 start = end
00246 end += length
00247 self.machine = str[start:end]
00248 _x = self
00249 start = end
00250 end += 8
00251 (_x.board, _x.breaker,) = _struct_2i.unpack(str[start:end])
00252 start = end
00253 end += 4
00254 (length,) = _struct_I.unpack(str[start:end])
00255 start = end
00256 end += length
00257 self.power_status = str[start:end]
00258 _x = self
00259 start = end
00260 end += 5
00261 (_x.estop, _x.elapsed,) = _struct_bi.unpack(str[start:end])
00262 start = end
00263 end += 4
00264 (length,) = _struct_I.unpack(str[start:end])
00265 start = end
00266 end += length
00267 self.status_msg = str[start:end]
00268 return self
00269 except struct.error, e:
00270 raise roslib.message.DeserializationError(e)
00271
00272 _struct_I = roslib.message.struct_I
00273 _struct_b = struct.Struct("<b")
00274 _struct_2i = struct.Struct("<2i")
00275 _struct_bi = struct.Struct("<bi")