@@ -29,12 +29,15 @@ fn almanac() -> Arc<Almanac> {
29
29
/// Tests the robustness of the Batch least squares estimator against large initial state errors.
30
30
#[ allow( clippy:: identity_op) ]
31
31
#[ rstest]
32
- #[ case( BLSSolver :: NormalEquations , 60 . seconds( ) , 2 . minutes( ) ) ]
33
- #[ case( BLSSolver :: LevenbergMarquardt , 10 . seconds( ) , 10 . minutes( ) ) ]
32
+ #[ case( BLSSolver :: NormalEquations , 60 . seconds( ) , 2 . minutes( ) , false ) ]
33
+ #[ case( BLSSolver :: LevenbergMarquardt , 10 . seconds( ) , 10 . minutes( ) , false ) ]
34
+ #[ case( BLSSolver :: NormalEquations , 60 . seconds( ) , 2 . minutes( ) , true ) ]
35
+ #[ case( BLSSolver :: LevenbergMarquardt , 10 . seconds( ) , 10 . minutes( ) , true ) ]
34
36
fn blse_robust_large_disp_cov_test (
35
37
#[ case] solver : BLSSolver ,
36
38
#[ case] sample : Duration ,
37
39
#[ case] offset : Duration ,
40
+ #[ case] disperse : bool ,
38
41
almanac : Arc < Almanac > ,
39
42
) {
40
43
let _ = pretty_env_logger:: try_init ( ) ;
@@ -133,7 +136,11 @@ fn blse_robust_large_disp_cov_test(
133
136
134
137
let blse_solution = blse
135
138
. estimate (
136
- initial_estimate. nominal_state ,
139
+ if disperse {
140
+ initial_estimate. nominal_state
141
+ } else {
142
+ initial_state
143
+ } ,
137
144
& arc. filter_by_offset ( ..offset) ,
138
145
)
139
146
. expect ( "blse should not fail" ) ;
@@ -159,10 +166,18 @@ fn blse_robust_large_disp_cov_test(
159
166
vmag_km_s_imp * 1e3 ,
160
167
) ;
161
168
162
- assert ! (
163
- rmag_km_imp > 0.0 ,
164
- "Position estimate not any better after BLSE"
165
- ) ;
169
+ if disperse {
170
+ assert ! (
171
+ rmag_km_imp > 0.0 ,
172
+ "Position estimate not any better after BLSE"
173
+ ) ;
174
+ } else {
175
+ // The RMAG error should be centimeter level, roughly the noise.
176
+ assert ! (
177
+ delta. rmag_km( ) < 0.1 ,
178
+ "Position estimate without dispersions too large"
179
+ ) ;
180
+ }
166
181
167
182
let kf_est: KfEstimate < Spacecraft > = blse_solution. into ( ) ;
168
183
println ! ( "{kf_est}" ) ;
0 commit comments