Struct nyx_space::od::kalman::KF

source ·
pub struct KF<T, A, M>where
    A: DimName,
    M: DimName,
    T: State,
    DefaultAllocator: Allocator<f64, M> + Allocator<f64, <T as State>::Size> + Allocator<f64, <T as State>::VecLength> + Allocator<f64, A> + Allocator<f64, M, M> + Allocator<f64, M, <T as State>::Size> + Allocator<f64, <T as State>::Size, <T as State>::Size> + Allocator<f64, A, A> + Allocator<f64, <T as State>::Size, A> + Allocator<f64, A, <T as State>::Size> + Allocator<usize, <T as State>::Size> + Allocator<usize, <T as State>::Size, <T as State>::Size>,{
    pub prev_estimate: KfEstimate<T>,
    pub measurement_noise: OMatrix<f64, M, M>,
    pub process_noise: Vec<SNC<A>>,
    pub ekf: bool,
    /* private fields */
}
Expand description

Defines both a Classical and an Extended Kalman filter (CKF and EKF) S: State size (not propagated vector size) A: Acceleration size (for SNC) M: Measurement size (used for the sensitivity matrix) T: Type of state P: Propagated vector size

Fields§

§prev_estimate: KfEstimate<T>

The previous estimate used in the KF computations.

§measurement_noise: OMatrix<f64, M, M>

Sets the Measurement noise (usually noted R)

§process_noise: Vec<SNC<A>>

A sets of process noise (usually noted Q), must be ordered chronologically

§ekf: bool

Determines whether this KF should operate as a Conventional/Classical Kalman filter or an Extended Kalman Filter. Recall that one should switch to an Extended KF only once the estimate is good (i.e. after a few good measurement updates on a CKF).

Implementations§

source§

impl<T, A, M> KF<T, A, M>where A: DimName, M: DimName, T: State, DefaultAllocator: Allocator<f64, M> + Allocator<f64, <T as State>::Size> + Allocator<f64, <T as State>::VecLength> + Allocator<f64, A> + Allocator<f64, M, M> + Allocator<f64, M, <T as State>::Size> + Allocator<f64, <T as State>::Size, M> + Allocator<f64, <T as State>::Size, <T as State>::Size> + Allocator<f64, A, A> + Allocator<f64, <T as State>::Size, A> + Allocator<f64, A, <T as State>::Size> + Allocator<usize, <T as State>::Size> + Allocator<usize, <T as State>::Size, <T as State>::Size>,

source

pub fn new( initial_estimate: KfEstimate<T>, process_noise: SNC<A>, measurement_noise: OMatrix<f64, M, M> ) -> Self

Initializes this KF with an initial estimate, measurement noise, and one process noise

source

pub fn with_sncs( initial_estimate: KfEstimate<T>, process_noises: Vec<SNC<A>>, measurement_noise: OMatrix<f64, M, M> ) -> Self

Initializes this KF with an initial estimate, measurement noise, and several process noise WARNING: SNCs MUST be ordered chronologically! They will be selected automatically by walking the list of SNCs backward until one can be applied!

source§

impl<T, M> KF<T, U3, M>where M: DimName, T: State, DefaultAllocator: Allocator<f64, M> + Allocator<f64, <T as State>::Size> + Allocator<f64, <T as State>::VecLength> + Allocator<f64, M, M> + Allocator<f64, M, <T as State>::Size> + Allocator<f64, <T as State>::Size, M> + Allocator<f64, <T as State>::Size, <T as State>::Size> + Allocator<f64, U3, U3> + Allocator<f64, <T as State>::Size, U3> + Allocator<f64, U3, <T as State>::Size> + Allocator<usize, <T as State>::Size> + Allocator<usize, <T as State>::Size, <T as State>::Size>,

source

pub fn no_snc( initial_estimate: KfEstimate<T>, measurement_noise: OMatrix<f64, M, M> ) -> Self

Initializes this KF without SNC

Trait Implementations§

source§

impl<T, A, M> Clone for KF<T, A, M>where A: DimName + Clone, M: DimName + Clone, T: State + Clone, DefaultAllocator: Allocator<f64, M> + Allocator<f64, <T as State>::Size> + Allocator<f64, <T as State>::VecLength> + Allocator<f64, A> + Allocator<f64, M, M> + Allocator<f64, M, <T as State>::Size> + Allocator<f64, <T as State>::Size, <T as State>::Size> + Allocator<f64, A, A> + Allocator<f64, <T as State>::Size, A> + Allocator<f64, A, <T as State>::Size> + Allocator<usize, <T as State>::Size> + Allocator<usize, <T as State>::Size, <T as State>::Size>,

source§

fn clone(&self) -> KF<T, A, M>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, A, M> Debug for KF<T, A, M>where A: DimName + Debug, M: DimName + Debug, T: State + Debug, DefaultAllocator: Allocator<f64, M> + Allocator<f64, <T as State>::Size> + Allocator<f64, <T as State>::VecLength> + Allocator<f64, A> + Allocator<f64, M, M> + Allocator<f64, M, <T as State>::Size> + Allocator<f64, <T as State>::Size, <T as State>::Size> + Allocator<f64, A, A> + Allocator<f64, <T as State>::Size, A> + Allocator<f64, A, <T as State>::Size> + Allocator<usize, <T as State>::Size> + Allocator<usize, <T as State>::Size, <T as State>::Size>,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, A, M> Filter<T, A, M> for KF<T, A, M>where A: DimName, M: DimName, T: State, DefaultAllocator: Allocator<f64, M> + Allocator<f64, <T as State>::Size> + Allocator<f64, <T as State>::VecLength> + Allocator<f64, A> + Allocator<f64, M, M> + Allocator<f64, M, <T as State>::Size> + Allocator<f64, <T as State>::Size, M> + Allocator<f64, <T as State>::Size, <T as State>::Size> + Allocator<f64, A, A> + Allocator<f64, <T as State>::Size, A> + Allocator<f64, A, <T as State>::Size> + Allocator<usize, <T as State>::Size> + Allocator<usize, <T as State>::Size, <T as State>::Size>,

source§

fn previous_estimate(&self) -> &Self::Estimate

Returns the previous estimate

source§

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.

source§

fn time_update(&mut self, nominal_state: T) -> Result<Self::Estimate, NyxError>

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.

source§

fn measurement_update( &mut self, nominal_state: T, real_obs: &OVector<f64, M>, computed_obs: &OVector<f64, M> ) -> Result<(Self::Estimate, Residual<M>), NyxError>

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.

source§

fn set_process_noise(&mut self, snc: SNC<A>)

Overwrites all of the process noises to the one provided

§

type Estimate = KfEstimate<T>

source§

fn measurement_noise(&self, _epoch: Epoch) -> &OMatrix<f64, M, M>

Returns the measurement noise used at this given epoch
source§

fn set_previous_estimate(&mut self, est: &Self::Estimate)

Set the previous estimate
source§

fn is_extended(&self) -> bool

Returns whether the filter is an extended filter (e.g. EKF)
source§

fn set_extended(&mut self, status: bool)

Sets the filter to be extended or not depending on the value of status

Auto Trait Implementations§

§

impl<T, A, M> !RefUnwindSafe for KF<T, A, M>

§

impl<T, A, M> !Send for KF<T, A, M>

§

impl<T, A, M> !Sync for KF<T, A, M>

§

impl<T, A, M> !Unpin for KF<T, A, M>

§

impl<T, A, M> !UnwindSafe for KF<T, A, M>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V