Exemplo n.º 1
0
    def read_from_bag(self, bagfile):
        bag_info = rosbag_info(bagfile)

        known = topics_in_bag(bag_info)

        self._match_topics_with_known(known)
        
        source = read_bag_stats(bagfile, topics=self.resolved)
        show_progress = read_bag_stats_progress(source, logger, interval=5)

        # Topic to last message
        self._topic2last = {} 
        self.iterator = show_progress.next
        self.read_one = True
Exemplo n.º 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(bagfile)
        res, _, asked2resolved = resolve_topics(self.baginfo, topics)
        self.info("Resolving:\n%s" % pformat(asked2resolved))
        return res