37 from __future__
import print_function
39 PKG =
'rospy_tutorials'
40 NAME =
'peer_subscribe_notify_test'
48 import roslib.scriptutil
as scriptutil
54 super(TestOnShutdown, self).
__init__(*args)
58 print(rospy.get_caller_id(),
"I heard %s" % data.data)
60 if "I'm dead" in data.data:
64 rospy.Subscriber(
"chatter", String, self.
callback)
65 rospy.init_node(NAME, anonymous=
True)
66 timeout_t = time.time() + 10.0*1000
67 while not rospy.is_shutdown()
and not self.
success and time.time() < timeout_t:
71 if __name__ ==
'__main__':
72 rostest.rosrun(PKG, NAME, TestOnShutdown, sys.argv)