__init__.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:lidapy-framework 作者: CognitiveComputingResearchGroup 项目源码 文件源码
def __init__(self, topic_name, msg_type=None, queue_size=None, postprocessor=None):
        super(RosTopicSubscriber, self).__init__(topic_name=topic_name,
                                                 msg_type=std_msgs.String if msg_type is None else msg_type,
                                                 queue_size=1 if queue_size is None else queue_size,
                                                 postprocessor=postprocessor)

        if postprocessor is None:
            if self.msg_type is std_msgs.String:
                def default_postprocessor(msg):
                    return MsgUtils.deserialize(RosMsgUtils.unwrap(msg, 'data'))

                self.postprocessor = default_postprocessor

        self._subscriber = rospy.Subscriber(name=self.topic_name,
                                            data_class=self.msg_type,
                                            callback=self._subscribe,
                                            callback_args=None,
                                            queue_size=self.queue_size)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号