pub trait Filter<T, A, M>where
A: DimName,
M: DimName,
T: State,
DefaultAllocator: Allocator<M> + Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<M, M> + Allocator<M, <T as State>::Size> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,{
type Estimate: Estimate<T>;
// Required methods
fn previous_estimate(&self) -> &Self::Estimate;
fn set_previous_estimate(&mut self, est: &Self::Estimate);
fn update_h_tilde(&mut self, h_tilde: OMatrix<f64, M, <T as State>::Size>);
fn time_update(
&mut self,
nominal_state: T,
) -> Result<Self::Estimate, ODError>;
fn measurement_update(
&mut self,
nominal_state: T,
real_obs: &OVector<f64, M>,
computed_obs: &OVector<f64, M>,
measurement_covar: OMatrix<f64, M, M>,
resid_rejection: Option<ResidRejectCrit>,
) -> Result<(Self::Estimate, Residual<M>), ODError>;
fn is_extended(&self) -> bool;
fn set_extended(&mut self, status: bool);
fn set_process_noise(&mut self, snc: SNC<A>);
}
Expand description
Defines a Filter trait where S is the size of the estimated state, A the number of acceleration components of the EOMs (used for process noise matrix size), M the size of the measurements.
Required Associated Types§
Required Methods§
sourcefn previous_estimate(&self) -> &Self::Estimate
fn previous_estimate(&self) -> &Self::Estimate
Returns the previous estimate
sourcefn set_previous_estimate(&mut self, est: &Self::Estimate)
fn set_previous_estimate(&mut self, est: &Self::Estimate)
Set the previous estimate
sourcefn update_h_tilde(&mut self, h_tilde: OMatrix<f64, M, <T as State>::Size>)
fn update_h_tilde(&mut self, h_tilde: OMatrix<f64, M, <T as State>::Size>)
Update the sensitivity matrix (or “H tilde”). This function must be called prior to each
call to measurement_update
.
sourcefn time_update(&mut self, nominal_state: T) -> Result<Self::Estimate, ODError>
fn time_update(&mut self, nominal_state: T) -> Result<Self::Estimate, ODError>
Computes a time update/prediction at the provided nominal state (i.e. advances the filter estimate with the updated STM).
Returns an error if the STM was not updated.
sourcefn measurement_update(
&mut self,
nominal_state: T,
real_obs: &OVector<f64, M>,
computed_obs: &OVector<f64, M>,
measurement_covar: OMatrix<f64, M, M>,
resid_rejection: Option<ResidRejectCrit>,
) -> Result<(Self::Estimate, Residual<M>), ODError>
fn measurement_update( &mut self, nominal_state: T, real_obs: &OVector<f64, M>, computed_obs: &OVector<f64, M>, measurement_covar: OMatrix<f64, M, M>, resid_rejection: Option<ResidRejectCrit>, ) -> Result<(Self::Estimate, Residual<M>), ODError>
Computes the measurement update with a provided real observation and computed observation.
The nominal state is the state used for the computed observation. The real observation is the observation that was actually measured. The computed observation is the observation that was computed from the nominal state.
Returns the updated estimate and the residual. The residual may be zero if the residual ratio check prevented the ingestion of this measurement.
§Arguments
nominal_state
: the nominal state at which the observation was computed.real_obs
: the real observation that was measured.computed_obs
: the computed observation from the nominal state.measurement_covar
: the measurement covariance associated with this time update (i./e. the square of the standard deviation)resid_rejection
: the automatic residual rejection criteria, if enabled.
sourcefn is_extended(&self) -> bool
fn is_extended(&self) -> bool
Returns whether the filter is an extended filter (e.g. EKF)
sourcefn set_extended(&mut self, status: bool)
fn set_extended(&mut self, status: bool)
Sets the filter to be extended or not depending on the value of status
sourcefn set_process_noise(&mut self, snc: SNC<A>)
fn set_process_noise(&mut self, snc: SNC<A>)
Sets the process noise matrix of the estimated state