00001 """autogenerated by genmsg_py from DashboardState.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006 import pr2_msgs.msg
00007 import std_msgs.msg
00008
00009 class DashboardState(roslib.message.Message):
00010 _md5sum = "db0cd0d535d75e0f6257b20c403e87f5"
00011 _type = "pr2_msgs/DashboardState"
00012 _has_header = False
00013 _full_text = """# This message communicates state information that might be used by a
00014 # dashboard application.
00015 std_msgs/Bool motors_halted
00016 bool motors_halted_valid
00017
00018 pr2_msgs/PowerBoardState power_board_state
00019 bool power_board_state_valid
00020
00021 pr2_msgs/PowerState power_state
00022 bool power_state_valid
00023
00024 pr2_msgs/AccessPoint access_point
00025 bool access_point_valid
00026
00027 ================================================================================
00028 MSG: std_msgs/Bool
00029 bool data
00030 ================================================================================
00031 MSG: pr2_msgs/PowerBoardState
00032 # This message communicates the state of the PR2's power board.
00033 int8 STATE_NOPOWER=0
00034 int8 STATE_STANDBY=1
00035 int8 STATE_PUMPING=2
00036 int8 STATE_ON=3
00037 int8 STATE_ENABLED=3 # Preferred over STATE_ON, keeping STATE_ON for backcompat
00038 int8 STATE_DISABLED=4
00039
00040 int8 MASTER_NOPOWER=0
00041 int8 MASTER_STANDBY=1
00042 int8 MASTER_ON=2
00043 int8 MASTER_OFF=3
00044 int8 MASTER_SHUTDOWN=4
00045
00046 Header header
00047 string name # Name with serial number
00048 uint32 serial_num # Serial number for this board's message
00049 float64 input_voltage # Input voltage to power board
00050
00051 # Master States:
00052 # MASTER_NOPOWER, MASTER_STANDBY, MASTER_ON, MASTER_OFF, MASTER_SHUTDOWN
00053 int8 master_state # The master state machine's state in the powerboard
00054
00055 # Circuit States:
00056 # STATE_NOPOWER, STATE_STANDBY, STATE_PUMPING, STATE_ON, STATE_DISABLED
00057 int8[3] circuit_state # One of the above states
00058 float64[3] circuit_voltage # Output voltage of each circuit
00059
00060 # True if robot should be enabled
00061 bool run_stop #Note - if the wireless run-stop is hit, this will be unobservable
00062 bool wireless_stop
00063
00064 ================================================================================
00065 MSG: std_msgs/Header
00066 # Standard metadata for higher-level stamped data types.
00067 # This is generally used to communicate timestamped data
00068 # in a particular coordinate frame.
00069 #
00070 # sequence ID: consecutively increasing ID
00071 uint32 seq
00072 #Two-integer timestamp that is expressed as:
00073 # * stamp.secs: seconds (stamp_secs) since epoch
00074 # * stamp.nsecs: nanoseconds since stamp_secs
00075 # time-handling sugar is provided by the client library
00076 time stamp
00077 #Frame this data is associated with
00078 # 0: no frame
00079 # 1: global frame
00080 string frame_id
00081
00082 ================================================================================
00083 MSG: pr2_msgs/PowerState
00084 # This message communicates the state of the PR2's power system.
00085 Header header
00086 float64 power_consumption ## Watts
00087 duration time_remaining ## estimated time to empty or full
00088 string prediction_method ## how time_remaining is being calculated
00089 int8 relative_capacity ## percent of capacity
00090 int8 AC_present ## number of packs detecting AC power, > 0 means plugged in
00091
00092 ================================================================================
00093 MSG: pr2_msgs/AccessPoint
00094 # This message communicates the state of the PR2's wifi access point.
00095 Header header
00096 string essid
00097 string macaddr
00098 int32 signal
00099 int32 noise
00100 int32 snr
00101 int32 channel
00102 string rate
00103 string tx_power
00104 int32 quality
00105
00106 """
00107 __slots__ = ['motors_halted','motors_halted_valid','power_board_state','power_board_state_valid','power_state','power_state_valid','access_point','access_point_valid']
00108 _slot_types = ['std_msgs/Bool','bool','pr2_msgs/PowerBoardState','bool','pr2_msgs/PowerState','bool','pr2_msgs/AccessPoint','bool']
00109
00110 def __init__(self, *args, **kwds):
00111 """
00112 Constructor. Any message fields that are implicitly/explicitly
00113 set to None will be assigned a default value. The recommend
00114 use is keyword arguments as this is more robust to future message
00115 changes. You cannot mix in-order arguments and keyword arguments.
00116
00117 The available fields are:
00118 motors_halted,motors_halted_valid,power_board_state,power_board_state_valid,power_state,power_state_valid,access_point,access_point_valid
00119
00120 @param args: complete set of field values, in .msg order
00121 @param kwds: use keyword arguments corresponding to message field names
00122 to set specific fields.
00123 """
00124 if args or kwds:
00125 super(DashboardState, self).__init__(*args, **kwds)
00126
00127 if self.motors_halted is None:
00128 self.motors_halted = std_msgs.msg.Bool()
00129 if self.motors_halted_valid is None:
00130 self.motors_halted_valid = False
00131 if self.power_board_state is None:
00132 self.power_board_state = pr2_msgs.msg.PowerBoardState()
00133 if self.power_board_state_valid is None:
00134 self.power_board_state_valid = False
00135 if self.power_state is None:
00136 self.power_state = pr2_msgs.msg.PowerState()
00137 if self.power_state_valid is None:
00138 self.power_state_valid = False
00139 if self.access_point is None:
00140 self.access_point = pr2_msgs.msg.AccessPoint()
00141 if self.access_point_valid is None:
00142 self.access_point_valid = False
00143 else:
00144 self.motors_halted = std_msgs.msg.Bool()
00145 self.motors_halted_valid = False
00146 self.power_board_state = pr2_msgs.msg.PowerBoardState()
00147 self.power_board_state_valid = False
00148 self.power_state = pr2_msgs.msg.PowerState()
00149 self.power_state_valid = False
00150 self.access_point = pr2_msgs.msg.AccessPoint()
00151 self.access_point_valid = False
00152
00153 def _get_types(self):
00154 """
00155 internal API method
00156 """
00157 return self._slot_types
00158
00159 def serialize(self, buff):
00160 """
00161 serialize message into buffer
00162 @param buff: buffer
00163 @type buff: StringIO
00164 """
00165 try:
00166 _x = self
00167 buff.write(_struct_2B3I.pack(_x.motors_halted.data, _x.motors_halted_valid, _x.power_board_state.header.seq, _x.power_board_state.header.stamp.secs, _x.power_board_state.header.stamp.nsecs))
00168 _x = self.power_board_state.header.frame_id
00169 length = len(_x)
00170 buff.write(struct.pack('<I%ss'%length, length, _x))
00171 _x = self.power_board_state.name
00172 length = len(_x)
00173 buff.write(struct.pack('<I%ss'%length, length, _x))
00174 _x = self
00175 buff.write(_struct_Idb.pack(_x.power_board_state.serial_num, _x.power_board_state.input_voltage, _x.power_board_state.master_state))
00176 buff.write(_struct_3b.pack(*self.power_board_state.circuit_state))
00177 buff.write(_struct_3d.pack(*self.power_board_state.circuit_voltage))
00178 _x = self
00179 buff.write(_struct_3B3I.pack(_x.power_board_state.run_stop, _x.power_board_state.wireless_stop, _x.power_board_state_valid, _x.power_state.header.seq, _x.power_state.header.stamp.secs, _x.power_state.header.stamp.nsecs))
00180 _x = self.power_state.header.frame_id
00181 length = len(_x)
00182 buff.write(struct.pack('<I%ss'%length, length, _x))
00183 _x = self
00184 buff.write(_struct_d2i.pack(_x.power_state.power_consumption, _x.power_state.time_remaining.secs, _x.power_state.time_remaining.nsecs))
00185 _x = self.power_state.prediction_method
00186 length = len(_x)
00187 buff.write(struct.pack('<I%ss'%length, length, _x))
00188 _x = self
00189 buff.write(_struct_2bB3I.pack(_x.power_state.relative_capacity, _x.power_state.AC_present, _x.power_state_valid, _x.access_point.header.seq, _x.access_point.header.stamp.secs, _x.access_point.header.stamp.nsecs))
00190 _x = self.access_point.header.frame_id
00191 length = len(_x)
00192 buff.write(struct.pack('<I%ss'%length, length, _x))
00193 _x = self.access_point.essid
00194 length = len(_x)
00195 buff.write(struct.pack('<I%ss'%length, length, _x))
00196 _x = self.access_point.macaddr
00197 length = len(_x)
00198 buff.write(struct.pack('<I%ss'%length, length, _x))
00199 _x = self
00200 buff.write(_struct_4i.pack(_x.access_point.signal, _x.access_point.noise, _x.access_point.snr, _x.access_point.channel))
00201 _x = self.access_point.rate
00202 length = len(_x)
00203 buff.write(struct.pack('<I%ss'%length, length, _x))
00204 _x = self.access_point.tx_power
00205 length = len(_x)
00206 buff.write(struct.pack('<I%ss'%length, length, _x))
00207 _x = self
00208 buff.write(_struct_iB.pack(_x.access_point.quality, _x.access_point_valid))
00209 except struct.error, se: self._check_types(se)
00210 except TypeError, te: self._check_types(te)
00211
00212 def deserialize(self, str):
00213 """
00214 unpack serialized message in str into this message instance
00215 @param str: byte array of serialized message
00216 @type str: str
00217 """
00218 try:
00219 if self.motors_halted is None:
00220 self.motors_halted = std_msgs.msg.Bool()
00221 if self.power_board_state is None:
00222 self.power_board_state = pr2_msgs.msg.PowerBoardState()
00223 if self.power_state is None:
00224 self.power_state = pr2_msgs.msg.PowerState()
00225 if self.access_point is None:
00226 self.access_point = pr2_msgs.msg.AccessPoint()
00227 end = 0
00228 _x = self
00229 start = end
00230 end += 14
00231 (_x.motors_halted.data, _x.motors_halted_valid, _x.power_board_state.header.seq, _x.power_board_state.header.stamp.secs, _x.power_board_state.header.stamp.nsecs,) = _struct_2B3I.unpack(str[start:end])
00232 self.motors_halted.data = bool(self.motors_halted.data)
00233 self.motors_halted_valid = bool(self.motors_halted_valid)
00234 start = end
00235 end += 4
00236 (length,) = _struct_I.unpack(str[start:end])
00237 start = end
00238 end += length
00239 self.power_board_state.header.frame_id = str[start:end]
00240 start = end
00241 end += 4
00242 (length,) = _struct_I.unpack(str[start:end])
00243 start = end
00244 end += length
00245 self.power_board_state.name = str[start:end]
00246 _x = self
00247 start = end
00248 end += 13
00249 (_x.power_board_state.serial_num, _x.power_board_state.input_voltage, _x.power_board_state.master_state,) = _struct_Idb.unpack(str[start:end])
00250 start = end
00251 end += 3
00252 self.power_board_state.circuit_state = _struct_3b.unpack(str[start:end])
00253 start = end
00254 end += 24
00255 self.power_board_state.circuit_voltage = _struct_3d.unpack(str[start:end])
00256 _x = self
00257 start = end
00258 end += 15
00259 (_x.power_board_state.run_stop, _x.power_board_state.wireless_stop, _x.power_board_state_valid, _x.power_state.header.seq, _x.power_state.header.stamp.secs, _x.power_state.header.stamp.nsecs,) = _struct_3B3I.unpack(str[start:end])
00260 self.power_board_state.run_stop = bool(self.power_board_state.run_stop)
00261 self.power_board_state.wireless_stop = bool(self.power_board_state.wireless_stop)
00262 self.power_board_state_valid = bool(self.power_board_state_valid)
00263 start = end
00264 end += 4
00265 (length,) = _struct_I.unpack(str[start:end])
00266 start = end
00267 end += length
00268 self.power_state.header.frame_id = str[start:end]
00269 _x = self
00270 start = end
00271 end += 16
00272 (_x.power_state.power_consumption, _x.power_state.time_remaining.secs, _x.power_state.time_remaining.nsecs,) = _struct_d2i.unpack(str[start:end])
00273 start = end
00274 end += 4
00275 (length,) = _struct_I.unpack(str[start:end])
00276 start = end
00277 end += length
00278 self.power_state.prediction_method = str[start:end]
00279 _x = self
00280 start = end
00281 end += 15
00282 (_x.power_state.relative_capacity, _x.power_state.AC_present, _x.power_state_valid, _x.access_point.header.seq, _x.access_point.header.stamp.secs, _x.access_point.header.stamp.nsecs,) = _struct_2bB3I.unpack(str[start:end])
00283 self.power_state_valid = bool(self.power_state_valid)
00284 start = end
00285 end += 4
00286 (length,) = _struct_I.unpack(str[start:end])
00287 start = end
00288 end += length
00289 self.access_point.header.frame_id = str[start:end]
00290 start = end
00291 end += 4
00292 (length,) = _struct_I.unpack(str[start:end])
00293 start = end
00294 end += length
00295 self.access_point.essid = str[start:end]
00296 start = end
00297 end += 4
00298 (length,) = _struct_I.unpack(str[start:end])
00299 start = end
00300 end += length
00301 self.access_point.macaddr = str[start:end]
00302 _x = self
00303 start = end
00304 end += 16
00305 (_x.access_point.signal, _x.access_point.noise, _x.access_point.snr, _x.access_point.channel,) = _struct_4i.unpack(str[start:end])
00306 start = end
00307 end += 4
00308 (length,) = _struct_I.unpack(str[start:end])
00309 start = end
00310 end += length
00311 self.access_point.rate = str[start:end]
00312 start = end
00313 end += 4
00314 (length,) = _struct_I.unpack(str[start:end])
00315 start = end
00316 end += length
00317 self.access_point.tx_power = str[start:end]
00318 _x = self
00319 start = end
00320 end += 5
00321 (_x.access_point.quality, _x.access_point_valid,) = _struct_iB.unpack(str[start:end])
00322 self.access_point_valid = bool(self.access_point_valid)
00323 return self
00324 except struct.error, e:
00325 raise roslib.message.DeserializationError(e)
00326
00327
00328 def serialize_numpy(self, buff, numpy):
00329 """
00330 serialize message with numpy array types into buffer
00331 @param buff: buffer
00332 @type buff: StringIO
00333 @param numpy: numpy python module
00334 @type numpy module
00335 """
00336 try:
00337 _x = self
00338 buff.write(_struct_2B3I.pack(_x.motors_halted.data, _x.motors_halted_valid, _x.power_board_state.header.seq, _x.power_board_state.header.stamp.secs, _x.power_board_state.header.stamp.nsecs))
00339 _x = self.power_board_state.header.frame_id
00340 length = len(_x)
00341 buff.write(struct.pack('<I%ss'%length, length, _x))
00342 _x = self.power_board_state.name
00343 length = len(_x)
00344 buff.write(struct.pack('<I%ss'%length, length, _x))
00345 _x = self
00346 buff.write(_struct_Idb.pack(_x.power_board_state.serial_num, _x.power_board_state.input_voltage, _x.power_board_state.master_state))
00347 buff.write(self.power_board_state.circuit_state.tostring())
00348 buff.write(self.power_board_state.circuit_voltage.tostring())
00349 _x = self
00350 buff.write(_struct_3B3I.pack(_x.power_board_state.run_stop, _x.power_board_state.wireless_stop, _x.power_board_state_valid, _x.power_state.header.seq, _x.power_state.header.stamp.secs, _x.power_state.header.stamp.nsecs))
00351 _x = self.power_state.header.frame_id
00352 length = len(_x)
00353 buff.write(struct.pack('<I%ss'%length, length, _x))
00354 _x = self
00355 buff.write(_struct_d2i.pack(_x.power_state.power_consumption, _x.power_state.time_remaining.secs, _x.power_state.time_remaining.nsecs))
00356 _x = self.power_state.prediction_method
00357 length = len(_x)
00358 buff.write(struct.pack('<I%ss'%length, length, _x))
00359 _x = self
00360 buff.write(_struct_2bB3I.pack(_x.power_state.relative_capacity, _x.power_state.AC_present, _x.power_state_valid, _x.access_point.header.seq, _x.access_point.header.stamp.secs, _x.access_point.header.stamp.nsecs))
00361 _x = self.access_point.header.frame_id
00362 length = len(_x)
00363 buff.write(struct.pack('<I%ss'%length, length, _x))
00364 _x = self.access_point.essid
00365 length = len(_x)
00366 buff.write(struct.pack('<I%ss'%length, length, _x))
00367 _x = self.access_point.macaddr
00368 length = len(_x)
00369 buff.write(struct.pack('<I%ss'%length, length, _x))
00370 _x = self
00371 buff.write(_struct_4i.pack(_x.access_point.signal, _x.access_point.noise, _x.access_point.snr, _x.access_point.channel))
00372 _x = self.access_point.rate
00373 length = len(_x)
00374 buff.write(struct.pack('<I%ss'%length, length, _x))
00375 _x = self.access_point.tx_power
00376 length = len(_x)
00377 buff.write(struct.pack('<I%ss'%length, length, _x))
00378 _x = self
00379 buff.write(_struct_iB.pack(_x.access_point.quality, _x.access_point_valid))
00380 except struct.error, se: self._check_types(se)
00381 except TypeError, te: self._check_types(te)
00382
00383 def deserialize_numpy(self, str, numpy):
00384 """
00385 unpack serialized message in str into this message instance using numpy for array types
00386 @param str: byte array of serialized message
00387 @type str: str
00388 @param numpy: numpy python module
00389 @type numpy: module
00390 """
00391 try:
00392 if self.motors_halted is None:
00393 self.motors_halted = std_msgs.msg.Bool()
00394 if self.power_board_state is None:
00395 self.power_board_state = pr2_msgs.msg.PowerBoardState()
00396 if self.power_state is None:
00397 self.power_state = pr2_msgs.msg.PowerState()
00398 if self.access_point is None:
00399 self.access_point = pr2_msgs.msg.AccessPoint()
00400 end = 0
00401 _x = self
00402 start = end
00403 end += 14
00404 (_x.motors_halted.data, _x.motors_halted_valid, _x.power_board_state.header.seq, _x.power_board_state.header.stamp.secs, _x.power_board_state.header.stamp.nsecs,) = _struct_2B3I.unpack(str[start:end])
00405 self.motors_halted.data = bool(self.motors_halted.data)
00406 self.motors_halted_valid = bool(self.motors_halted_valid)
00407 start = end
00408 end += 4
00409 (length,) = _struct_I.unpack(str[start:end])
00410 start = end
00411 end += length
00412 self.power_board_state.header.frame_id = str[start:end]
00413 start = end
00414 end += 4
00415 (length,) = _struct_I.unpack(str[start:end])
00416 start = end
00417 end += length
00418 self.power_board_state.name = str[start:end]
00419 _x = self
00420 start = end
00421 end += 13
00422 (_x.power_board_state.serial_num, _x.power_board_state.input_voltage, _x.power_board_state.master_state,) = _struct_Idb.unpack(str[start:end])
00423 start = end
00424 end += 3
00425 self.power_board_state.circuit_state = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=3)
00426 start = end
00427 end += 24
00428 self.power_board_state.circuit_voltage = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3)
00429 _x = self
00430 start = end
00431 end += 15
00432 (_x.power_board_state.run_stop, _x.power_board_state.wireless_stop, _x.power_board_state_valid, _x.power_state.header.seq, _x.power_state.header.stamp.secs, _x.power_state.header.stamp.nsecs,) = _struct_3B3I.unpack(str[start:end])
00433 self.power_board_state.run_stop = bool(self.power_board_state.run_stop)
00434 self.power_board_state.wireless_stop = bool(self.power_board_state.wireless_stop)
00435 self.power_board_state_valid = bool(self.power_board_state_valid)
00436 start = end
00437 end += 4
00438 (length,) = _struct_I.unpack(str[start:end])
00439 start = end
00440 end += length
00441 self.power_state.header.frame_id = str[start:end]
00442 _x = self
00443 start = end
00444 end += 16
00445 (_x.power_state.power_consumption, _x.power_state.time_remaining.secs, _x.power_state.time_remaining.nsecs,) = _struct_d2i.unpack(str[start:end])
00446 start = end
00447 end += 4
00448 (length,) = _struct_I.unpack(str[start:end])
00449 start = end
00450 end += length
00451 self.power_state.prediction_method = str[start:end]
00452 _x = self
00453 start = end
00454 end += 15
00455 (_x.power_state.relative_capacity, _x.power_state.AC_present, _x.power_state_valid, _x.access_point.header.seq, _x.access_point.header.stamp.secs, _x.access_point.header.stamp.nsecs,) = _struct_2bB3I.unpack(str[start:end])
00456 self.power_state_valid = bool(self.power_state_valid)
00457 start = end
00458 end += 4
00459 (length,) = _struct_I.unpack(str[start:end])
00460 start = end
00461 end += length
00462 self.access_point.header.frame_id = str[start:end]
00463 start = end
00464 end += 4
00465 (length,) = _struct_I.unpack(str[start:end])
00466 start = end
00467 end += length
00468 self.access_point.essid = str[start:end]
00469 start = end
00470 end += 4
00471 (length,) = _struct_I.unpack(str[start:end])
00472 start = end
00473 end += length
00474 self.access_point.macaddr = str[start:end]
00475 _x = self
00476 start = end
00477 end += 16
00478 (_x.access_point.signal, _x.access_point.noise, _x.access_point.snr, _x.access_point.channel,) = _struct_4i.unpack(str[start:end])
00479 start = end
00480 end += 4
00481 (length,) = _struct_I.unpack(str[start:end])
00482 start = end
00483 end += length
00484 self.access_point.rate = str[start:end]
00485 start = end
00486 end += 4
00487 (length,) = _struct_I.unpack(str[start:end])
00488 start = end
00489 end += length
00490 self.access_point.tx_power = str[start:end]
00491 _x = self
00492 start = end
00493 end += 5
00494 (_x.access_point.quality, _x.access_point_valid,) = _struct_iB.unpack(str[start:end])
00495 self.access_point_valid = bool(self.access_point_valid)
00496 return self
00497 except struct.error, e:
00498 raise roslib.message.DeserializationError(e)
00499
00500 _struct_I = roslib.message.struct_I
00501 _struct_2B3I = struct.Struct("<2B3I")
00502 _struct_4i = struct.Struct("<4i")
00503 _struct_3B3I = struct.Struct("<3B3I")
00504 _struct_d2i = struct.Struct("<d2i")
00505 _struct_2bB3I = struct.Struct("<2bB3I")
00506 _struct_3b = struct.Struct("<3b")
00507 _struct_iB = struct.Struct("<iB")
00508 _struct_Idb = struct.Struct("<Idb")
00509 _struct_3d = struct.Struct("<3d")