@@ -32,6 +32,7 @@ def define_subparser(subparsers):
32
32
return define_args (sub )
33
33
34
34
def interpolate_missing_properties (df_source , df_query , k_nearest = 3 ):
35
+ import pandas as pd
35
36
from scipy .spatial import KDTree
36
37
xyz = list ('xyz' )
37
38
@@ -271,17 +272,7 @@ def post_process_point_clouds(globalPointCloud, sparse_point_cloud_df):
271
272
272
273
return merged_df
273
274
274
- def onVioOutput (vioOutput ):
275
- nonlocal visualizer , isTracking
276
- wasTracking = isTracking
277
- isTracking = vioOutput .status == spectacularAI .TrackingStatus .TRACKING
278
- if wasTracking and not isTracking :
279
- print ('warning: Lost tracking!' )
280
-
281
- if visualizer is not None :
282
- visualizer .onVioOutput (vioOutput .getCameraPose (0 ), status = vioOutput .status )
283
-
284
- def onMappingOutput (output ):
275
+ def processMappingOutput (output ):
285
276
nonlocal savedKeyFrames
286
277
nonlocal pointClouds
287
278
nonlocal sparsePointColors
@@ -485,6 +476,23 @@ def write_colmap_csv(data, fn):
485
476
486
477
finalMapWritten = True
487
478
479
+ def onVioOutput (vioOutput ):
480
+ nonlocal visualizer , isTracking
481
+ wasTracking = isTracking
482
+ isTracking = vioOutput .status == spectacularAI .TrackingStatus .TRACKING
483
+ if wasTracking and not isTracking :
484
+ print ('warning: Lost tracking!' )
485
+
486
+ if visualizer is not None :
487
+ visualizer .onVioOutput (vioOutput .getCameraPose (0 ), status = vioOutput .status )
488
+
489
+ def onMappingOutput (output ):
490
+ try :
491
+ processMappingOutput (output )
492
+ except Exception as e :
493
+ print (f"ERROR: { e } " , flush = True )
494
+ raise e
495
+
488
496
def copy_input_to_tmp_safe (input_dir , tmp_input ):
489
497
# also works if tmp dir is inside the input directory
490
498
os .makedirs (tmp_input , exist_ok = True )
0 commit comments