Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions rospy_tutorials/001_talker_listener/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@
from std_msgs.msg import String

def callback(data):
rospy.loginfo(rospy.get_caller_id() + "I heard %s", data.data)
rospy.loginfo(rospy.get_caller_id() + 'I heard %s', data.data)

def listener():

# In ROS, nodes are uniquely named. If two nodes with the same
# node are launched, the previous one is kicked off. The
# name are launched, the previous one is kicked off. The
# anonymous=True flag means that rospy will choose a unique
# name for our 'talker' node so that multiple talkers can
# name for our 'listener' node so that multiple listeners can
# run simultaneously.
rospy.init_node('listener', anonymous=True)

rospy.Subscriber("chatter", String, callback)
rospy.Subscriber('chatter', String, callback)

# spin() simply keeps python from exiting until this node is stopped
rospy.spin()
Expand Down