stray_visualize_6.py 585 B

12345678910111213141516
  1. def trajectory(flags, data):
  2. """
  3. Returns a set of lines connecting each camera poses world frame position.
  4. returns: [open3d.geometry.LineSet]
  5. """
  6. line_sets = []
  7. previous_pose = None
  8. for i, T_WC in enumerate(data['poses']):
  9. if previous_pose is not None:
  10. points = o3d.utility.Vector3dVector([previous_pose[:3, 3], T_WC[:3, 3]])
  11. lines = o3d.utility.Vector2iVector([[0, 1]])
  12. line = o3d.geometry.LineSet(points=points, lines=lines)
  13. line_sets.append(line)
  14. previous_pose = T_WC
  15. return line_sets