39 PKG =
'diagnostic_aggregator'
41 import roslib; roslib.load_manifest(PKG)
45 from time
import sleep
47 from diagnostic_msgs.msg
import DiagnosticArray, DiagnosticStatus
49 if __name__ ==
'__main__':
50 rospy.init_node(
'diag_pub')
51 pub = rospy.Publisher(
'/diagnostics', DiagnosticArray, queue_size=10)
53 array = DiagnosticArray()
56 DiagnosticStatus(0,
'pref1a',
'OK',
'', []),
57 DiagnosticStatus(1,
'pref1b',
'Warning',
'', []),
58 DiagnosticStatus(0,
'contains1a',
'OK',
'', []),
59 DiagnosticStatus(0,
'prefix1: contains1b',
'OK',
'', []),
60 DiagnosticStatus(0,
'name1',
'OK',
'', []),
61 DiagnosticStatus(0,
'prefix1: expected1a',
'OK',
'', []),
62 DiagnosticStatus(0,
'prefix1: expected1b',
'OK',
'', []),
63 DiagnosticStatus(0,
'prefix1: expected1c',
'OK',
'', []),
64 DiagnosticStatus(0,
'prefix1: expected1d',
'OK',
'', []),
65 DiagnosticStatus(0,
'find1_items: find_remove1a',
'OK',
'', []),
66 DiagnosticStatus(0,
'find1_items: find_remove1b',
'OK',
'', []),
69 DiagnosticStatus(0,
'contain2a',
'OK',
'', []),
70 DiagnosticStatus(0,
'contain2b',
'OK',
'', []),
71 DiagnosticStatus(0,
'name2',
'OK',
'', []),
74 DiagnosticStatus(2,
'other1',
'Error',
'', []),
75 DiagnosticStatus(0,
'other2',
'OK',
'', []),
76 DiagnosticStatus(0,
'other3',
'OK',
'', [])]
77 array.header.stamp = rospy.get_rostime()
79 while not rospy.is_shutdown():