pub struct KalmanFilter<T, A>where
A: DimName,
T: State,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,{
pub prev_estimate: KfEstimate<T>,
pub process_noise: Vec<ProcessNoise<A>>,
pub variant: KalmanVariant,
pub prev_used_snc: usize,
}
Expand description
Defines both a Classical and an Extended Kalman filter (CKF and EKF) T: Type of state A: Acceleration size (for SNC) M: Measurement size (used for the sensitivity matrix)
Fields§
§prev_estimate: KfEstimate<T>
The previous estimate used in the KF computations.
process_noise: Vec<ProcessNoise<A>>
A sets of process noise (usually noted Q), must be ordered chronologically
variant: KalmanVariant
The variant of this Kalman filter.
prev_used_snc: usize
Implementations§
Source§impl<T, A> KalmanFilter<T, A>where
A: DimName,
T: State,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
impl<T, A> KalmanFilter<T, A>where
A: DimName,
T: State,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
Sourcepub fn previous_estimate(&self) -> &KfEstimate<T>
pub fn previous_estimate(&self) -> &KfEstimate<T>
Returns the previous estimate
pub fn set_previous_estimate(&mut self, est: &KfEstimate<T>)
Sourcepub fn time_update(
&mut self,
nominal_state: T,
) -> Result<KfEstimate<T>, ODError>
pub fn time_update( &mut self, nominal_state: T, ) -> Result<KfEstimate<T>, ODError>
Computes a time update/prediction (i.e. advances the filter estimate with the updated STM).
May return a FilterError if the STM was not updated.
Sourcepub fn measurement_update<M: DimName>(
&mut self,
nominal_state: T,
real_obs: OVector<f64, M>,
computed_obs: OVector<f64, M>,
r_k: OMatrix<f64, M, M>,
h_tilde: OMatrix<f64, M, <T as State>::Size>,
resid_rejection: Option<ResidRejectCrit>,
) -> Result<(KfEstimate<T>, Residual<M>, Option<OMatrix<f64, <T as State>::Size, M>>), ODError>
pub fn measurement_update<M: DimName>( &mut self, nominal_state: T, real_obs: OVector<f64, M>, computed_obs: OVector<f64, M>, r_k: OMatrix<f64, M, M>, h_tilde: OMatrix<f64, M, <T as State>::Size>, resid_rejection: Option<ResidRejectCrit>, ) -> Result<(KfEstimate<T>, Residual<M>, Option<OMatrix<f64, <T as State>::Size, M>>), ODError>
Computes the measurement update with a provided real observation and computed observation.
May return a FilterError if the STM or sensitivity matrices were not updated.
pub fn replace_state(&self) -> bool
Sourcepub fn set_process_noise(&mut self, snc: ProcessNoise<A>)
pub fn set_process_noise(&mut self, snc: ProcessNoise<A>)
Overwrites all of the process noises to the one provided
Source§impl<T> KalmanFilter<T, U3>where
T: State,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<U3> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<U3, U3> + Allocator<<T as State>::Size, U3> + Allocator<U3, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
impl<T> KalmanFilter<T, U3>where
T: State,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<U3> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<U3, U3> + Allocator<<T as State>::Size, U3> + Allocator<U3, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
Sourcepub fn new(initial_estimate: KfEstimate<T>, variant: KalmanVariant) -> Self
pub fn new(initial_estimate: KfEstimate<T>, variant: KalmanVariant) -> Self
Initializes this KF with an initial estimate, measurement noise, and one process noise
Source§impl<T, A> KalmanFilter<T, A>where
T: State,
A: DimName,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
impl<T, A> KalmanFilter<T, A>where
T: State,
A: DimName,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
Sourcepub fn from_process_noise(
initial_estimate: KfEstimate<T>,
variant: KalmanVariant,
process_noise: ProcessNoise<A>,
) -> Self
pub fn from_process_noise( initial_estimate: KfEstimate<T>, variant: KalmanVariant, process_noise: ProcessNoise<A>, ) -> Self
Set (or replaces) the existing process noise configuration.
Sourcepub fn with_process_noise(self, process_noise: ProcessNoise<A>) -> Self
pub fn with_process_noise(self, process_noise: ProcessNoise<A>) -> Self
Set (or replaces) the existing process noise configuration.
Sourcepub fn and_with_process_noise(self, process_noise: ProcessNoise<A>) -> Self
pub fn and_with_process_noise(self, process_noise: ProcessNoise<A>) -> Self
Pushes the provided process noise to the list the existing process noise configurations.
Trait Implementations§
Source§impl<T, A> Clone for KalmanFilter<T, A>where
A: DimName + Clone,
T: State + Clone,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
impl<T, A> Clone for KalmanFilter<T, A>where
A: DimName + Clone,
T: State + Clone,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
Source§fn clone(&self) -> KalmanFilter<T, A>
fn clone(&self) -> KalmanFilter<T, A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T, A> Debug for KalmanFilter<T, A>where
A: DimName + Debug,
T: State + Debug,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
impl<T, A> Debug for KalmanFilter<T, A>where
A: DimName + Debug,
T: State + Debug,
DefaultAllocator: Allocator<<T as State>::Size> + Allocator<<T as State>::VecLength> + Allocator<A> + Allocator<<T as State>::Size, <T as State>::Size> + Allocator<A, A> + Allocator<<T as State>::Size, A> + Allocator<A, <T as State>::Size>,
<DefaultAllocator as Allocator<<T as State>::Size>>::Buffer<f64>: Copy,
<DefaultAllocator as Allocator<<T as State>::Size, <T as State>::Size>>::Buffer<f64>: Copy,
Auto Trait Implementations§
impl<T, A> !Freeze for KalmanFilter<T, A>
impl<T, A> !RefUnwindSafe for KalmanFilter<T, A>
impl<T, A> !Send for KalmanFilter<T, A>
impl<T, A> !Sync for KalmanFilter<T, A>
impl<T, A> !Unpin for KalmanFilter<T, A>
impl<T, A> !UnwindSafe for KalmanFilter<T, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.