45 roslib.load_manifest(PKG)
46 roslib.load_manifest(
'rostest')
49 import os, os.path, threading, time
52 from tf.msg
import tfMessage
53 from pr2_mechanism_msgs.msg
import MechanismState
56 TEST_TIMEOUT = 100000000000.0
60 super(MyHzTest, self).
__init__(*args)
74 print " got first message at: ",self.
start_time,
" sec" 77 if self.
count >= MIN_MSGS:
78 self.
end_time = rospy.get_rostime().to_sec()
87 rospy.Subscriber(
"/mechanism_state", MechanismState, self.
Input)
88 rospy.init_node(NAME, anonymous=
True)
89 timeout_t = time.time() + TEST_TIMEOUT
90 while not rospy.is_shutdown()
and not self.
success and time.time() < timeout_t:
95 if __name__ ==
'__main__':
96 rostest.run(PKG, sys.argv[0], MyHzTest, sys.argv)