def _start(self, spin):
for args, kwargs in self.subscribers:
self.subscribers_init.append(rospy.Subscriber(*args, **kwargs))
is_func = isinstance(self.cl, types.FunctionType)
is_class = isinstance(self.cl, types.TypeType)
if is_class:
targ = self.__start_class
elif is_func:
targ = self.__start_func
self.thread = threading.Thread(target=targ,
args=(self.cl,) + self.cl_args,
kwargs=self.cl_kwargs)
self.thread.daemon = True
self.thread.start()
if spin:
rospy.spin()
return self
评论列表
文章目录