#![allow(clippy::type_complexity)] #![allow(unused_imports)]
use crate::linalg::allocator::Allocator;
use crate::linalg::{DefaultAllocator, DimName, OMatrix, OVector, U1}; use crate::md::trajectory::{Interpolatable, Traj}; pub use crate::od::estimate::*;
pub use crate::od::ground_station::*;
pub use crate::od::snc::*; pub use crate::od::*;
use crate::propagators::Propagator;
pub use crate::time::{Duration, Epoch, Unit};
use anise::prelude::Almanac;
use indexmap::IndexSet;
use log::{debug, info, trace, warn};
use msr::sensitivity::TrackerSensitivity; use snafu::prelude::*;
use std::collections::BTreeMap;
use std::fmt;
use std::marker::PhantomData;
use std::ops::Add;
use std::sync::Arc;
use typed_builder::TypedBuilder;
#[derive(Debug, Clone)]
pub struct BLSSolution<StateType: State>
where
DefaultAllocator: Allocator<<StateType as State>::Size>
+ Allocator<<StateType as State>::Size, <StateType as State>::Size>
+ Allocator<<StateType as State>::VecLength>,
{
pub estimated_state: StateType,
pub covariance: OMatrix<f64, <StateType as State>::Size, <StateType as State>::Size>,
pub num_iterations: usize,
pub final_rms: f64,
pub final_corr_pos_km: f64,
pub converged: bool,
}
impl<StateType> fmt::Display for BLSSolution<StateType>
where
StateType: State,
DefaultAllocator: Allocator<<StateType as State>::Size>
+ Allocator<<StateType as State>::Size, <StateType as State>::Size>
+ Allocator<<StateType as State>::VecLength>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
writeln!(f, "Converged: {}", self.converged)?;
writeln!(f, "Iterations: {}", self.num_iterations)?;
writeln!(f, "Final RMS: {}", self.final_rms)?;
writeln!(f, "Final State: {}", self.estimated_state.orbit())?;
write!(f, "Final Covariance:\n{:.3e}", self.covariance)
}
}
impl<StateType: State> From<BLSSolution<StateType>> for KfEstimate<StateType>
where
DefaultAllocator: Allocator<<StateType as State>::Size>
+ Allocator<<StateType as State>::Size, <StateType as State>::Size>
+ Allocator<<StateType as State>::VecLength>,
<DefaultAllocator as Allocator<<StateType as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<StateType as State>::Size, <StateType as State>::Size>>::Buffer<
f64,
>: Copy,
{
fn from(mut bls: BLSSolution<StateType>) -> Self {
bls.covariance[(6, 6)] = 0.0;
bls.covariance[(7, 7)] = 0.0;
bls.covariance[(8, 8)] = 0.0;
Self::from_covar(bls.estimated_state, bls.covariance)
}
}