rospy and Subscriber/Publisher garbage collection
Do I need to store a reference to rospy subscribers and publishers to avoid these objects to be garbage collected?
class SomeClass:
def __init__(self):
# option 1, without reference
rospy.Subscriber("/some/topic1", SomeMessageType, self.some_topic1_callback)
# option 2, with reference
self.my_subscriber = rospy.Subscriber("/some/topic2", SomeMessageType, self.some_topic2_callback)