Created
December 27, 2014 06:42
-
-
Save detik19/cfb5712830681935c205 to your computer and use it in GitHub Desktop.
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 | |
import roslib; roslib.load_manifest('beginner_tutorials') | |
import rospy | |
from std_msgs.msg import String | |
def callback(data): | |
rospy.loginfo(rospy.get_name()+"I heard %s", data.data) | |
def listener(): | |
rospy.init_node('listener', anonymous=True) | |
rospy.Subscriber("chatter", String, callback) | |
rospy.spin() | |
if __name__=='__main__': | |
listener() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment