stray_visualize_7.py 697 B

123456789101112131415161718
  1. def show_frames(flags, data):
  2. """
  3. Returns a list of meshes of coordinate axes that have been transformed to represent the camera matrix
  4. at each --every:th frame.
  5. flags: Command line arguments
  6. data: dict with keys ['poses', 'intrinsics']
  7. returns: [open3d.geometry.TriangleMesh]
  8. """
  9. frames = [o3d.geometry.TriangleMesh.create_coordinate_frame().scale(0.25, np.zeros(3))]
  10. for i, T_WC in enumerate(data['poses']):
  11. if not i % flags.every == 0:
  12. continue
  13. print(f"Frame {i}", end="\r")
  14. mesh = o3d.geometry.TriangleMesh.create_coordinate_frame().scale(0.1, np.zeros(3))
  15. frames.append(mesh.transform(T_WC))
  16. return frames