Skip to content

Instantly share code, notes, and snippets.

@chaonan99
Created March 22, 2018 00:16
Show Gist options
  • Select an option

  • Save chaonan99/717f96d58aaad169388332cfafe60725 to your computer and use it in GitHub Desktop.

Select an option

Save chaonan99/717f96d58aaad169388332cfafe60725 to your computer and use it in GitHub Desktop.

Revisions

  1. chaonan99 created this gist Mar 22, 2018.
    14 changes: 14 additions & 0 deletions addup_number_publisher.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/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()