def trajectory(flags, data): """ Returns a set of lines connecting each camera poses world frame position. returns: [open3d.geometry.LineSet] """ line_sets = [] previous_pose = None for i, T_WC in enumerate(data['poses']): if previous_pose is not None: points = o3d.utility.Vector3dVector([previous_pose[:3, 3], T_WC[:3, 3]]) lines = o3d.utility.Vector2iVector([[0, 1]]) line = o3d.geometry.LineSet(points=points, lines=lines) line_sets.append(line) previous_pose = T_WC return line_sets