#!/usr/bin/env python
"""
Publishes a count that increases once per second
This example uses a loop and rospy.Rate to publish at a fixed frequency

PUBLISHERS:
   count (Count) ~ Publishes the count
"""

import rospy
from counter.msg import Count

def main():
   rospy.init_node('count_up')
   pub = rospy.Publisher("count", Count, queue_size = 10)
   rate = rospy.Rate(1)

   i = 0
   while not rospy.is_shutdown():
      pub.publish(Count(mode=rospy.get_name(), count = i))
      i += 1
      rate.sleep()

if __name__ == "__main__":
   try:
      main()
   except rospy.ROSInterruptException:
      pass

         
