Skip to content

Commit

Permalink
Fixed remaining tests.
Browse files Browse the repository at this point in the history
For robustness test, I had to increase the tolerance by an order of magnitude. I explain this because this test uses the new tracking set up. This one uses the actual event of rising above the horizon to find when to start tracking. It causes the OD propagator and the truth propagator to take a different step size.
  • Loading branch information
ChristopherRabotin committed Dec 23, 2023
1 parent c2eea25 commit 5dce943
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 35 deletions.
8 changes: 4 additions & 4 deletions tests/orbit_determination/robust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,11 @@ fn od_robust_test_ekf_realistic_two_way() {
);

assert!(
delta.rmag_km() < 0.01,
"Position error should be less than 10 meters"
delta.rmag_km() < 0.2,
"Position error should be less than 200 meters (down from >3 km)"
);
assert!(
delta.vmag_km_s() < 1e-5,
"Velocity error should be on centimeter level"
delta.vmag_km_s() < 1e-4,
"Velocity error should be on decimeter level"
);
}
29 changes: 14 additions & 15 deletions tests/orbit_determination/spacecraft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,30 @@ fn od_val_sc_mb_srp_reals_duals_models() {
iau_earth,
);

let epoch = Epoch::from_gregorian_tai_at_midnight(2020, 1, 1);
let prop_time = 1 * Unit::Day;

// Define the tracking configurations
let mut configs = HashMap::new();
configs.insert(
dss65_madrid.name.clone(),
TrkConfig::from_sample_rate(10.seconds()),
);
configs.insert(
dss34_canberra.name.clone(),
TrkConfig::from_sample_rate(10.seconds()),
);
configs.insert(
dss13_goldstone.name.clone(),
TrkConfig::from_sample_rate(10.seconds()),
);
let cfg = TrkConfig::builder()
.strands(vec![EpochRanges {
start: epoch,
end: epoch + prop_time,
}])
.build();

configs.insert(dss65_madrid.name.clone(), cfg.clone());
configs.insert(dss34_canberra.name.clone(), cfg.clone());
configs.insert(dss13_goldstone.name.clone(), cfg);

let all_stations = vec![dss65_madrid, dss34_canberra, dss13_goldstone];

// Define the propagator information.
let prop_time = 1 * Unit::Day;
let step_size = 10.0 * Unit::Second;
let opts = PropOpts::with_fixed_step(step_size);

// Define state information.
let eme2k = cosm.frame("EME2000");
let epoch = Epoch::from_gregorian_tai_at_midnight(2020, 1, 1);
let initial_state = Orbit::keplerian(22000.0, 0.01, 30.0, 80.0, 40.0, 0.0, epoch, eme2k);

let dry_mass_kg = 100.0; // in kg
Expand Down Expand Up @@ -216,7 +215,7 @@ fn od_val_sc_mb_srp_reals_duals_models() {
);

assert!(
est.covar.diagonal().norm() < 1e-5,
est.covar.diagonal().norm() < 1e-4,
"estimate covariance norm should be small (perfect dynamics) ({:e})",
est.covar.diagonal().norm()
);
Expand Down
20 changes: 4 additions & 16 deletions tests/orbit_determination/two_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,7 @@ fn od_tb_ckf_fixed_step_iteration_test() {
);

// Define the tracking configurations
let cfg = TrkConfig::builder()
.sampling(10.seconds())
.scheduler(Scheduler::builder().sample_alignment(10.seconds()).build())
.build();
let cfg = TrkConfig::from_sample_rate(10.seconds());

let mut configs = HashMap::new();
configs.insert(dss65_madrid.name.clone(), cfg.clone());
Expand Down Expand Up @@ -778,10 +775,7 @@ fn od_tb_ckf_fixed_step_perfect_stations_snc_covar_map() {

// Define the tracking configurations
let mut configs = HashMap::new();
let cfg = TrkConfig::builder()
.sampling(10.seconds())
.scheduler(Scheduler::builder().sample_alignment(10.seconds()).build())
.build();
let cfg = TrkConfig::from_sample_rate(10.seconds());
configs.insert(dss65_madrid.name.clone(), cfg.clone());
configs.insert(dss34_canberra.name.clone(), cfg.clone());
configs.insert(dss13_goldstone.name.clone(), cfg);
Expand Down Expand Up @@ -997,10 +991,7 @@ fn od_tb_val_harmonics_ckf_fixed_step_perfect() {

// Define the tracking configurations
let mut configs = HashMap::new();
let cfg = TrkConfig::builder()
.sampling(10.seconds())
.scheduler(Scheduler::builder().sample_alignment(10.seconds()).build())
.build();
let cfg = TrkConfig::from_sample_rate(10.seconds());
configs.insert(dss65_madrid.name.clone(), cfg.clone());
configs.insert(dss34_canberra.name.clone(), cfg.clone());
configs.insert(dss13_goldstone.name.clone(), cfg);
Expand Down Expand Up @@ -1127,10 +1118,7 @@ fn od_tb_ckf_fixed_step_perfect_stations_several_snc_covar_map() {

// Define the tracking configurations
let mut configs = HashMap::new();
let cfg = TrkConfig::builder()
.sampling(10.seconds())
.scheduler(Scheduler::builder().sample_alignment(10.seconds()).build())
.build();
let cfg = TrkConfig::from_sample_rate(10.seconds());
configs.insert(dss65_madrid.name.clone(), cfg.clone());
configs.insert(dss34_canberra.name.clone(), cfg.clone());
configs.insert(dss13_goldstone.name.clone(), cfg);
Expand Down

0 comments on commit 5dce943

Please sign in to comment.