string_publisher.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 from ros import rospy
00003 from ros import std_msgs
00004 import std_msgs.msg
00005 
00006 def publisher():
00007   rospy.init_node('string_publisher')
00008   pub = rospy.Publisher('string_in', std_msgs.msg.String)
00009   m = std_msgs.msg.String(rospy.get_name())
00010   r = rospy.Rate(10)
00011   while not rospy.is_shutdown():
00012     pub.publish(m)
00013     r.sleep()
00014 
00015 if __name__ == '__main__':
00016   publisher()


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:49