Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

For future viewer reference, the second line could also be written as:

SUBSCRIPTIONS = map(lambda topic: rospy.Subscriber(topic, AnyMsg, callback=bag, callback_args=topic), TOPICS)

with or without the "callback" and "callback_args". I would say that this follows the ROS convention more closely than the previous answer, although it is excellent and also works.