def iter_tango_logs(directory, logs, topics=[]):
for log in logs:
directory = os.path.expanduser(os.path.join(args.directory, log))
print('Accessing Tango directory {:}'.format(directory))
dataset = TangoLogReader(directory=directory, scale=im_scale)
for item in dataset.iterframes(topics=topics):
bboxes = item.bboxes
targets = item.coords
# # If RGB_VIO, RGB, RGB_VIO in stream, then interpolate pose
# # b/w the 1st and 3rd timestamps to match RGB timestamps
# if len(self.__item_q) >= 3 and \
# self.__item_q[-1][0] == self.__item_q[-3][0] == 1 and \
# self.__item_q[-2][0] == 0:
# t1,t2,t3 = self.__item_q[-3][1], self.__item_q[-2][1], self.__item_q[-1][1]
# w2, w1 = np.float32([t2-t1, t3-t2]) / (t3-t1)
# p1,p3 = self.__item_q[-3][2], self.__item_q[-1][2]
# p2 = p1.interpolate(p3, w1)
# self.on_frame(t2, t2, p2, self.__item_q[-2][2])
# print np.array_str(np.float64([t1, t2, t3]) * 1e-14, precision=6, suppress_small=True), \
# (t2-t1) * 1e-6, (t3-t2) * 1e-6, w1, w2, p2
评论列表
文章目录