Created
          November 6, 2017 11:46 
        
      - 
      
 - 
        
Save marcoarruda/45b19eb801cb9f040ef3e962e9306195 to your computer and use it in GitHub Desktop.  
    Rospy publisher
  
        
  
    
      This file contains hidden or 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