20 from diagnostic_msgs.msg
import DiagnosticArray, DiagnosticStatus
30 self.
_fake_diag_pub = rospy.Publisher(
'/diagnostics', DiagnosticArray, queue_size=1)
34 msg = DiagnosticArray()
35 msg.header.stamp = rospy.get_rostime()
37 status = DiagnosticStatus()
38 status.name = rospy.get_name()
39 status.level = DiagnosticStatus.OK
40 status.message =
"fake diagnostics" 41 status.hardware_id = rospy.get_name()
42 msg.status.append(status)
44 self._fake_diag_pub.publish(msg)
47 resp = TriggerResponse()
52 if __name__ ==
"__main__":
53 rospy.init_node(
'fake_driver')
55 rospy.loginfo(
"fake_driver running")
def publish_diagnostics(self, event)