pub struct UDState<N: RealField, D: Dim>
where DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
{ pub x: OVector<N, D>, pub UD: OMatrix<N, D, D>, /* private fields */ }
Expand description

UD State representation.

Linear representation as a state vector and ‘square root’ factorisation of the state covariance matrix. Numerically the this ‘square root’ factorisation is advantageous as conditioning for inverting is improved by the square root.

The state covariance is represented as a U.d.U’ factorisation, where U is upper triangular matrix (0 diagonal) and d is a diagonal vector. U and d are packed into a single UD Matrix, the lower Triangle ist not part of state representation.

Fields§

§x: OVector<N, D>

State vector

§UD: OMatrix<N, D, D>

UD matrix representation of state covariance

Implementations§

source§

impl<N: Copy + RealField, D: Dim> UDState<N, D>
where DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,

source

pub fn new(UD: OMatrix<N, D, D>, x: OVector<N, D>) -> Self

Create a UDState for given state dimensions.

D is the size of states vector and rows in UD.

source

pub fn predict<QD: Dim>( &mut self, fx: &OMatrix<N, D, D>, x_pred: &OVector<N, D>, noise: &CoupledNoise<N, D, QD> ) -> Result<N, &str>
where D: DimAdd<QD>, DefaultAllocator: Allocator<N, DimSum<D, QD>, U1> + Allocator<N, D, QD> + Allocator<N, QD>,

source

pub fn observe_innovation<ZD: Dim>( &mut self, s: &OVector<N, ZD>, hx: &OMatrix<N, ZD, D>, noise: &UncorrelatedNoise<N, ZD> ) -> Result<N, &str>
where DefaultAllocator: Allocator<N, ZD, D> + Allocator<N, ZD>,

Implement observe using sequential observation updates.

Uncorrelated observations are applied sequentially in the order they appear in z.

source§

impl<N: Copy + RealField, D: Dim> UDState<N, D>
where DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,

source

pub fn observe_linear_correlated<ZD: Dim>( &mut self, z: &OVector<N, ZD>, hx: &OMatrix<N, ZD, D>, h_normalize: fn(_: &mut OVector<N, ZD>, _: &OVector<N, ZD>), noise_factor: &CorrelatedFactorNoise<N, ZD> ) -> Result<N, &str>
where DefaultAllocator: Allocator<N, ZD, ZD> + Allocator<N, ZD, D> + Allocator<N, ZD>,

Special Linear ‘hx’ observe for correlated factorised noise.

Observation predictions are made with the linear ‘hx’. This allows the observation noise to be decorrelated. Observations can then be applied for each element in the order they appear in z.

Return: Minimum ‘rcond’ of all sequential observations

source§

impl<N: Copy + RealField, D: Dim> UDState<N, D>
where DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,

source

pub fn new_predict_scratch<QD: Dim>(&self, qd: QD) -> PredictScratch<N, D, QD>
where D: DimAdd<QD>, DefaultAllocator: Allocator<N, D, QD> + Allocator<N, DimSum<D, QD>, U1>,

source

pub fn new_observe_scratch(&self) -> ObserveScratch<N, D>

source

pub fn predict_use_scratch<QD: Dim>( &mut self, scratch: &mut PredictScratch<N, D, QD>, x_pred: &OVector<N, D>, fx: &OMatrix<N, D, D>, noise: &CoupledNoise<N, D, QD> ) -> Result<N, &str>
where D: DimAdd<QD>, DefaultAllocator: Allocator<N, DimSum<D, QD>> + Allocator<N, D, QD> + Allocator<N, QD>,

source

pub fn observe_innovation_use_scratch<ZD: Dim>( &mut self, scratch: &mut ObserveScratch<N, D>, s: &OVector<N, ZD>, hx: &OMatrix<N, ZD, D>, noise: &UncorrelatedNoise<N, ZD> ) -> Result<N, &str>
where DefaultAllocator: Allocator<N, ZD, D> + Allocator<N, ZD>,

Trait Implementations§

source§

impl<N: Copy + RealField, D: Dim> Estimator<N, D> for UDState<N, D>
where DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,

source§

fn state(&self) -> Result<OVector<N, D>, &str>

The estimator’s estimate of the system’s state.
source§

impl<N: Copy + RealField, D: Dim> KalmanEstimator<N, D> for UDState<N, D>
where DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,

source§

fn kalman_state(&self) -> Result<KalmanState<N, D>, &str>

Derive the KalmanState from the UDState.

The covariance matrix X is recomposed from U.d.U’ in the UD matrix.

source§

impl<N: Copy + RealField, D: Dim> TryFrom<KalmanState<N, D>> for UDState<N, D>
where DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,

source§

fn try_from(state: KalmanState<N, D>) -> Result<Self, Self::Error>

Construct the UDState with a KalmanState.

The covariance matrix X is factorised into a U.d.U’ as a UD matrix.

§

type Error = &'static str

The type returned in the event of a conversion error.

Auto Trait Implementations§

§

impl<N, D> !RefUnwindSafe for UDState<N, D>

§

impl<N, D> !Send for UDState<N, D>

§

impl<N, D> !Sync for UDState<N, D>

§

impl<N, D> !Unpin for UDState<N, D>

§

impl<N, D> !UnwindSafe for UDState<N, D>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where 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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
§

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

§

fn vzip(self) -> V