@@ -84,6 +84,7 @@ def solve_wls(measurements, weight_type = None, only_bias = False,
8484 rx_rows_to_find ,
8585 max_allow = 1 )
8686 states = []
87+ runtime_error_idxs = {}
8788
8889 position = np .zeros ((4 ,1 ))
8990 for timestamp , _ , measurement_subset in measurements .loop_time ("gps_millis" , delta_t_decimals = delta_t_decimals ):
@@ -120,9 +121,10 @@ def solve_wls(measurements, weight_type = None, only_bias = False,
120121 only_bias , tol , max_count )
121122 states .append ([timestamp ] + np .squeeze (position ).tolist ())
122123 except RuntimeError as error :
123- warnings .warn ("RuntimeError encountered at gps_millis: " \
124- + str (int (timestamp )) + " RuntimeError: " \
125- + str (error ), RuntimeWarning )
124+ if str (error ) not in runtime_error_idxs :
125+ runtime_error_idxs [str (error )] = [str (int (timestamp ))]
126+ else :
127+ runtime_error_idxs [str (error )].append (str (int (timestamp )))
126128 states .append ([timestamp , np .nan , np .nan , np .nan , np .nan ])
127129
128130 states = np .array (states )
@@ -134,6 +136,11 @@ def solve_wls(measurements, weight_type = None, only_bias = False,
134136 state_estimate ["z_rx_wls_m" ] = states [:,3 ]
135137 state_estimate ["b_rx_wls_m" ] = states [:,4 ]
136138
139+ for error ,timestamps in runtime_error_idxs .items ():
140+ warnings .warn (error + " Encountered at " + str (len (timestamps ))\
141+ + " gps_millis of: " \
142+ + ", " .join (timestamps ), RuntimeWarning )
143+
137144 if np .isnan (states [:,1 :]).all ():
138145 warnings .warn ("No valid state estimate computed in WLS, " \
139146 + "returning NaNs." , RuntimeWarning )
0 commit comments