hello.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import rospy
00004 from std_msgs.msg import String
00005 
00006 
00007 def main():
00008     rospy.init_node('minimal')
00009     pub = rospy.Publisher('chatter', String, queue_size=1000)
00010     start = rospy.Time.now()
00011     while not rospy.is_shutdown() and (rospy.Time.now() - start).to_sec() < 10:
00012         log = "hello world %s" % rospy.get_time()
00013         rospy.loginfo(log)
00014         pub.publish(String(log))
00015         rospy.sleep(1.0)
00016 
00017 
00018 if __name__ == '__main__':
00019     try:
00020         main()
00021     except rospy.ROSInterruptException:
00022         pass


roch_capabilities
Author(s): Carl
autogenerated on Sat Jun 8 2019 20:32:45