#!/usr/bin/env python

# License: BSD
#   https://raw.github.com/robotics-in-concert/rocon_app_platform/license/LICENSE

## Simple talker demo that published std_msgs/Strings messages
## to the 'chatter' topic
## Message and frequency are configurable with params

import rospy
from std_msgs.msg import String

def talker():
    pub = rospy.Publisher('chatter', String, queue_size=10)
    rospy.init_node('talker', anonymous=True)
    
    message = rospy.get_param('~message', 'hello world')
    freq = rospy.get_param('~frequency', 10)
    
    r = rospy.Rate(freq) # 10hz
    
    while not rospy.is_shutdown():
        str = "%s %s"%(message, rospy.get_time())
        rospy.loginfo(str)
        pub.publish(str)
        r.sleep()
        
if __name__ == '__main__':
    try:
        talker()
    except rospy.ROSInterruptException: pass
