Created
March 22, 2018 00:16
-
-
Save chaonan99/717f96d58aaad169388332cfafe60725 to your computer and use it in GitHub Desktop.
A ROS publisher publishing increasing int number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import rospy | |
from std_msgs.msg import String | |
pub = rospy.Publisher('addup_number', String, queue_size=10) | |
rospy.init_node('repub_test_pub', anonymous=True) | |
r = rospy.Rate(1) | |
i = 0 | |
while not rospy.is_shutdown(): | |
pub.publish(str(i)) | |
rospy.loginfo("Publish {}".format(i)) | |
i += 1 | |
r.sleep() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment