Skip to content

Commit 679c2dc

Browse files
committed
add option to use sparser ROMAN trajectory or full pose data
in association video
1 parent 85be2cc commit 679c2dc

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

demo/association_vid.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def rotate_pixel_coords(coords, img_w, img_h, rotation_code):
7171
help='Manual time adjustment for the two submaps. Use this if the time ranges of the submap videos does not work well.')
7272
parser.add_argument('--max-associations', '-m', action='store_true',
7373
help='If set, will choose the pair of submaps with the maximum number of associations.')
74+
parser.add_argument('--original-pose-data', action='store_true',
75+
help='If set, will use the original pose data from the data params. ' +
76+
'Otherwise, the sparser trajectory from the ROMAN map will be used for speed.')
7477

7578
args = parser.parse_args()
7679
results_dir = get_path(args.results_dir)
@@ -156,12 +159,14 @@ def rotate_pixel_coords(coords, img_w, img_h, rotation_code):
156159
for i in range(2):
157160
os.environ[data_params[i].run_env] = args.runs[i]
158161
# for now, use the sparser trajectory from roman map for faster load time
159-
# pose_data.append(data_params[i].load_pose_data())
160-
# pose_data[-1].time_tol = 20.0
161-
new_pose_data = rdp.data.PoseData.from_times_and_poses(roman_maps[i].times, roman_maps[i].trajectory)
162-
new_pose_data.time_tol = 20.0
163-
new_pose_data.T_postmultiply = np.linalg.inv(data_params[i].pose_data_params.T_camera_flu)
164-
pose_data.append(new_pose_data)
162+
if args.original_pose_data:
163+
pose_data.append(data_params[i].load_pose_data())
164+
pose_data[-1].time_tol = 20.0
165+
else:
166+
new_pose_data = rdp.data.PoseData.from_times_and_poses(roman_maps[i].times, roman_maps[i].trajectory)
167+
new_pose_data.time_tol = 20.0
168+
new_pose_data.T_postmultiply = np.linalg.inv(data_params[i].pose_data_params.T_camera_flu)
169+
pose_data.append(new_pose_data)
165170

166171
print(f"Loading image data...")
167172
img_data = []

0 commit comments

Comments
 (0)