7 from rosgraph_msgs.msg
import Log
12 rospy.init_node(
'test_rosout_output', anonymous=
True)
14 rospy.Subscriber(
'/rosout', Log, self.
callback)
17 print(
"received rosout message with level = {}".format(msg.level))
18 if msg.level == Log.ERROR
or msg.level == Log.FATAL:
22 rospy.wait_for_message(
'/rosout', Log, timeout=5)
23 wait_time = float(rospy.get_param(
'~wait_time', 10.))
24 start_time = rospy.Time.now()
25 while not rospy.is_shutdown()
and (rospy.Time.now() - start_time).to_sec() < wait_time:
29 if __name__ ==
'__main__':
30 rostest.run(
'smach_viewer',
'test_rosout_output', TestRosoutOutput, sys.argv)