latched_talker.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 def talker():
00007     pub = rospy.Publisher('chatter', String, latch=True)
00008     rospy.init_node('talker')
00009     while not rospy.is_shutdown():
00010         str = "dude"
00011         rospy.loginfo(str)
00012         pub.publish(String(str))
00013         rospy.rostime.wallsleep(1.0)
00014 
00015 if __name__ == '__main__':
00016     try:
00017         talker()
00018     except rospy.ROSInterruptException:
00019         pass


rocon_python_comms
Author(s): Daniel Stonier
autogenerated on Fri May 2 2014 10:35:42