(pose_path)
| 2 | import numpy as np |
| 3 | |
| 4 | def load_poses(pose_path): |
| 5 | poses = [] |
| 6 | try: |
| 7 | if '.txt' in pose_path: |
| 8 | with open(pose_path, 'r') as f: |
| 9 | lines = f.readlines() |
| 10 | for line in lines: |
| 11 | T_w_cam0 = np.fromstring(line, dtype=float, sep=' ') |
| 12 | T_w_cam0 = T_w_cam0.reshape(3, 4) |
| 13 | T_w_cam0 = np.vstack((T_w_cam0, [0, 0, 0, 1])) |
| 14 | poses.append(T_w_cam0) |
| 15 | else: |
| 16 | poses = np.load(pose_path)['arr_0'] |
| 17 | |
| 18 | except FileNotFoundError: |
| 19 | print('Ground truth poses are not avaialble.') |
| 20 | |
| 21 | return np.array(poses) |
| 22 | |
| 23 | |
| 24 | def load_calib(calib_path): |
no outgoing calls
no test coverage detected