Created
February 17, 2019 10:25
-
-
Save SweiLz/ec738d7d35bb601e1dcde8bf0f254915 to your computer and use it in GitHub Desktop.
Rospy 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
import rospy | |
from std_msgs.msg import String | |
pub = rospy.Publisher('topic_name', String, queue_size=10) | |
rospy.init_node('node_name') | |
r = rospy.Rate(10) # 10hz | |
while not rospy.is_shutdown(): | |
pub.publish("hello world") | |
r.sleep() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment