00001 #!/usr/bin/python 00002 00003 import time 00004 00005 import roslib 00006 roslib.load_manifest( 'rosgraph_msgs' ) 00007 roslib.load_manifest( 'rospy' ) 00008 import rospy 00009 00010 from rosgraph_msgs.msg import Clock 00011 00012 rospy.init_node( 'clock_pub' ) 00013 time.sleep( 0.2 ) 00014 00015 pub = rospy.Publisher( '/clock', Clock ) 00016 00017 while not rospy.is_shutdown(): 00018 pub.publish( Clock().clock.from_sec( time.time() ) ) 00019 time.sleep( 0.001 )