Skip to content

Commit c9bff7a

Browse files
BLSE is finicky, but I think it actually works.
1 parent 281b1e4 commit c9bff7a

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/od/blse/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ where
156156
num_measurements >= 2,
157157
TooFewMeasurementsSnafu {
158158
need: 2_usize,
159-
action: "bLSE"
159+
action: "BLSE"
160160
}
161161
);
162162

@@ -194,15 +194,9 @@ where
194194
// Store the STM to the start of the batch.
195195
let mut stm = StateMatrix::<D>::identity();
196196

197-
for (cnt, (epoch_ref, msr)) in measurements.iter().enumerate() {
197+
for (epoch_ref, msr) in measurements.iter() {
198198
let msr_epoch = *epoch_ref;
199199

200-
if cnt > 1 { // HACK.
201-
println!("end batch at {epoch_ref}");
202-
break;
203-
}
204-
println!("processing {epoch_ref}");
205-
206200
loop {
207201
let delta_t = msr_epoch - epoch;
208202
if delta_t <= Duration::ZERO {

tests/orbit_determination/blse.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ fn almanac() -> Arc<Almanac> {
2929
/// Tests the robustness of the Batch least squares estimator against large initial state errors.
3030
#[allow(clippy::identity_op)]
3131
#[rstest]
32-
// #[case(BLSSolver::NormalEquations)]
33-
#[case(BLSSolver::LevenbergMarquardt)]
34-
fn blse_robust_large_disp_test(#[case] solver: BLSSolver, almanac: Arc<Almanac>) {
32+
#[case(BLSSolver::NormalEquations, 60.seconds(), 2.minutes())]
33+
#[case(BLSSolver::LevenbergMarquardt, 10.seconds(), 10.minutes())]
34+
fn blse_robust_large_disp_cov_test(
35+
#[case] solver: BLSSolver,
36+
#[case] sample: Duration,
37+
#[case] offset: Duration,
38+
almanac: Arc<Almanac>,
39+
) {
3540
let _ = pretty_env_logger::try_init();
3641

3742
let iau_earth = almanac.frame_from_uid(IAU_EARTH_FRAME).unwrap();
@@ -63,8 +68,14 @@ fn blse_robust_large_disp_test(#[case] solver: BLSSolver, almanac: Arc<Almanac>)
6368

6469
// Define the tracking configurations
6570
let configs = BTreeMap::from([
66-
(dss65_madrid.name.clone(), TrkConfig::default()),
67-
(dss34_canberra.name.clone(), TrkConfig::default()),
71+
(
72+
dss65_madrid.name.clone(),
73+
TrkConfig::from_sample_rate(sample),
74+
),
75+
(
76+
dss34_canberra.name.clone(),
77+
TrkConfig::from_sample_rate(sample),
78+
),
6879
]);
6980

7081
// Note that we do not have Goldstone so we can test enabling and disabling the EKF.
@@ -121,7 +132,10 @@ fn blse_robust_large_disp_test(#[case] solver: BLSSolver, almanac: Arc<Almanac>)
121132
.build();
122133

123134
let blse_solution = blse
124-
.estimate(initial_estimate.nominal_state, &arc)
135+
.estimate(
136+
initial_estimate.nominal_state,
137+
&arc.filter_by_offset(..offset),
138+
)
125139
.expect("blse should not fail");
126140

127141
println!("{blse_solution}");

0 commit comments

Comments
 (0)