39 from time
import sleep
41 from diagnostic_msgs.msg
import DiagnosticArray, DiagnosticStatus
45 if __name__ ==
'__main__':
46 rospy.init_node(
'diag_pub')
47 pub = rospy.Publisher(
'/diagnostics', DiagnosticArray, queue_size=10)
49 start_time = rospy.get_time()
51 while not rospy.is_shutdown():
52 array = DiagnosticArray()
53 array.header.stamp = rospy.get_rostime()
56 if rospy.get_time() - start_time < 3:
57 array.status = [DiagnosticStatus(1,
'nonexistent2',
'WARN',
'', [])]