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)
Originally posted by knxa on ROS Answers with karma: 811 on 2023-05-10
Post score: 0