#!/usr/bin/env python
import os

import rospy
from std_msgs.msg import String

from config import HELLO_STR

RATE = float(os.getenv("RATE", 10))

def talker():
	pub = rospy.Publisher('telemetry', String, queue_size=10)
	rospy.init_node('talker', anonymous=True)
	rate = rospy.Rate(RATE)
	while not rospy.is_shutdown():
		hello_str = "%s %s" % (HELLO_STR, rospy.get_time())
		rospy.loginfo(hello_str)
		pub.publish(hello_str)
		rate.sleep()

if __name__ == '__main__':
	try:
		talker()
	except rospy.ROSInterruptException:
		pass
