def __init__(self, loop_time = 0.1, pubs = {}, subs = {}):
"""init args: pubs: dict with topic / [type,], subs: dict with topic / [type, callback]"""
smp_thread.__init__(self, loop_time = loop_time)
# now init ros node
rospy.init_node(self.name, anonymous=True)
# loop frequency / sampling rate
self.rate = rospy.Rate(1./self.loop_time)
# local pub / sub
self.default_queue_size_pub = 2
self.default_queue_size_sub = 2
if len(pubs) == 0 and len(subs) == 0:
self.pub_sub_local_legacy()
else:
self.pub_sub_local(pubs, subs)
# print "smp_thread_ros pubs", self.pub
# print "smp_thread_ros subs", self.sub
评论列表
文章目录