Created
December 3, 2014 11:16
-
-
Save awesomebytes/75b13431f4b833748df2 to your computer and use it in GitHub Desktop.
Simple header publisher
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/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Created on 03/12/14 | |
@author: Sam Pfeiffer | |
A simple publisher of Header messages | |
with seq numbers increasing. | |
""" | |
import rospy | |
from std_msgs.msg import Header | |
if __name__=="__main__": | |
rospy.init_node('test_topic_queue_') | |
pub = rospy.Publisher('/header_test', Header, queue_size=1) | |
seq_num = 1 | |
while not rospy.is_shutdown(): | |
h = Header() | |
h.seq = seq_num | |
pub.publish(h) | |
rospy.loginfo("Published: " + str(h.seq)) | |
seq_num += 1 | |
rospy.sleep(0.001) | |
# rostopic hz /header_test | |
# subscribed to [/header_test] | |
# average rate: 517.697 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment