Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import rospy
from std_msgs.msg import String
def callback(data):
rospy.loginfo("I heard %s",
def callback2(data):
rospy.loginfo("222I heard %s",
for t in ['foo', 'bar']:
if t =='foo':
rospy.Subscriber(t, String, callback)
if t =='bar':
rospy.Subscriber(t, String, callback2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment