34 from diagnostic_msgs.msg
import DiagnosticStatus
35 from python_qt_binding.QtCore
import QMutex, QMutexLocker, QSize, QTimer, Signal
37 from .icon_tool_button
import IconToolButton
42 A widget which brings up the rqt_robot_monitor. 44 Times out after certain period of time (set as 5 sec as of Apr 2013) 45 without receiving diagnostics msg ('/diagnostics_toplevel_state' of 46 DiagnosticStatus type), status becomes as 'stale'. 48 :param context: The plugin context to create the monitor in. 49 :type context: qt_gui.plugin_context.PluginContext 51 _msg_trigger = Signal()
55 ok_icon = [
'bg-green.svg',
'ic-diagnostics.svg']
56 warn_icon = [
'bg-yellow.svg',
'ic-diagnostics.svg',
58 err_icon = [
'bg-red.svg',
'ic-diagnostics.svg',
'ol-err-badge.svg']
59 stale_icon = [
'bg-grey.svg',
'ic-diagnostics.svg',
62 icons = [ok_icon, warn_icon, err_icon, stale_icon]
64 super(MonitorDashWidget, self).
__init__(
'MonitorWidget', icons,
65 icon_paths=icon_paths)
67 self.setFixedSize(self.
_icons[0].actualSize(QSize(50, 30)))
79 self.setToolTip(
'Diagnostics')
82 'diagnostics_toplevel_state',
99 self.setToolTip(
"Diagnostics: Error")
100 elif (msg.level == 1):
102 self.setToolTip(
"Diagnostics: Warning")
105 self.setToolTip(
"Diagnostics: OK")
116 self.setToolTip(
"Diagnostics: Stale\nNo message received on " 117 "/diagnostics_agg in the last 5 seconds")