示例#1
0
 def _match_topics_with_known(self, known):
     a = self.adapter
     all_topics = a.get_relevant_topics() + a.get_published_topics()
     self.asked = [name for name, _ in all_topics]          
     match = resolve_topics(known, self.asked) 
     self.resolved, self.resolved2asked, self.asked2resolved = match
         
     self.info('   asked: %s ' % self.asked)
     self.info('resolved: %s ' % self.resolved)
示例#2
0
    def get_topics(self):
        bagfile = self.config.file
        if self.config.topics is not None:
            given_topics = self.config.topics.strip()
        else:
            given_topics = None
  
        if given_topics:
            topics = given_topics.split(',')
        else:
            all_topics = [c.topic for c in self.bag._get_connections()]
            topics = sorted(set(all_topics))

        self.baginfo = rosbag_info_cached(bagfile)
        res, _, asked2resolved = resolve_topics(self.baginfo, topics)
        self.info('Resolving:\n%s' % pformat(asked2resolved))
        return res
示例#3
0
    def get_topics(self):
        bagfile = self.config.file
        if self.config.topics is not None:
            given_topics = self.config.topics.strip()
        else:
            given_topics = None

        if given_topics:
            topics = given_topics.split(',')
        else:
            all_topics = [c.topic for c in self.bag._get_connections()]
            topics = sorted(set(all_topics))

        self.baginfo = rosbag_info_cached(bagfile)
        res, _, asked2resolved = resolve_topics(self.baginfo, topics)
        self.info('Resolving:\n%s' % pformat(asked2resolved))
        return res