[−][src]Struct filter::kalman::kalman_filter::KalmanFilter
Implements a Kalman filter. For a detailed explanation, see the excellent book Kalman and Bayesian Filters in Python [1]_. The book applies also for this Rust implementation and all functions should works similar with minor changes due to language differences.
References
.. [1] Roger Labbe. "Kalman and Bayesian Filters in Python" https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
Fields
x: VectorN<F, DimX>
Current state estimate.
P: MatrixMN<F, DimX, DimX>
Current state covariance matrix.
x_prior: VectorN<F, DimX>
Prior (predicted) state estimate.
P_prior: MatrixMN<F, DimX, DimX>
Prior (predicted) state covariance matrix.
x_post: VectorN<F, DimX>
Posterior (updated) state estimate.
P_post: MatrixMN<F, DimX, DimX>
Posterior (updated) state covariance matrix.
z: Option<VectorN<F, DimZ>>
Last measurement
R: MatrixMN<F, DimZ, DimZ>
Measurement noise matrix.
Q: MatrixMN<F, DimX, DimX>
MatrixMN<F, DimZ, DimZ>,
B: Option<MatrixMN<F, DimX, DimU>>
Control transition matrix
F: MatrixMN<F, DimX, DimX>
State Transition matrix.
H: MatrixMN<F, DimZ, DimX>
Measurement function.
y: VectorN<F, DimZ>
Residual of the update step.
K: MatrixMN<F, DimX, DimZ>
Kalman gain of the update step.
S: MatrixMN<F, DimZ, DimZ>
System uncertainty (P projected to measurement space).
SI: MatrixMN<F, DimZ, DimZ>
Inverse system uncertainty.
alpha_sq: F
Fading memory setting.
Methods
impl<F, DimX, DimZ, DimU> KalmanFilter<F, DimX, DimZ, DimU> where
F: RealField,
DimX: DimName,
DimZ: DimName,
DimU: DimName,
DefaultAllocator: Allocator<F, DimX> + Allocator<F, DimZ> + Allocator<F, DimX, DimZ> + Allocator<F, DimZ, DimX> + Allocator<F, DimZ, DimZ> + Allocator<F, DimX, DimX> + Allocator<F, DimU> + Allocator<F, DimX, DimU>,
[src]
F: RealField,
DimX: DimName,
DimZ: DimName,
DimU: DimName,
DefaultAllocator: Allocator<F, DimX> + Allocator<F, DimZ> + Allocator<F, DimX, DimZ> + Allocator<F, DimZ, DimX> + Allocator<F, DimZ, DimZ> + Allocator<F, DimX, DimX> + Allocator<F, DimU> + Allocator<F, DimX, DimU>,
pub fn predict(
&mut self,
u: Option<&VectorN<F, DimU>>,
B: Option<&MatrixMN<F, DimX, DimU>>,
F: Option<&MatrixMN<F, DimX, DimX>>,
Q: Option<&MatrixMN<F, DimX, DimX>>
)
[src]
&mut self,
u: Option<&VectorN<F, DimU>>,
B: Option<&MatrixMN<F, DimX, DimU>>,
F: Option<&MatrixMN<F, DimX, DimX>>,
Q: Option<&MatrixMN<F, DimX, DimX>>
)
Predict next state (prior) using the Kalman filter state propagation equations.
pub fn update(
&mut self,
z: &VectorN<F, DimZ>,
R: Option<&MatrixMN<F, DimZ, DimZ>>,
H: Option<&MatrixMN<F, DimZ, DimX>>
)
[src]
&mut self,
z: &VectorN<F, DimZ>,
R: Option<&MatrixMN<F, DimZ, DimZ>>,
H: Option<&MatrixMN<F, DimZ, DimX>>
)
Add a new measurement (z) to the Kalman filter.
pub fn predict_steadystate(
&mut self,
u: Option<&VectorN<F, DimU>>,
B: Option<&MatrixMN<F, DimX, DimU>>
)
[src]
&mut self,
u: Option<&VectorN<F, DimU>>,
B: Option<&MatrixMN<F, DimX, DimU>>
)
Predict state (prior) using the Kalman filter state propagation equations. Only x is updated, P is left unchanged.
pub fn update_steadystate(&mut self, z: &VectorN<F, DimZ>)
[src]
Add a new measurement (z) to the Kalman filter without recomputing the Kalman gain K, the state covariance P, or the system uncertainty S.
pub fn get_prediction(
&self,
u: Option<&VectorN<F, DimU>>
) -> (VectorN<F, DimX>, MatrixMN<F, DimX, DimX>)
[src]
&self,
u: Option<&VectorN<F, DimU>>
) -> (VectorN<F, DimX>, MatrixMN<F, DimX, DimX>)
Predicts the next state of the filter and returns it without altering the state of the filter.
pub fn get_update(
&self,
z: &VectorN<F, DimZ>
) -> (VectorN<F, DimX>, MatrixMN<F, DimX, DimX>)
[src]
&self,
z: &VectorN<F, DimZ>
) -> (VectorN<F, DimX>, MatrixMN<F, DimX, DimX>)
Computes the new estimate based on measurement z
and returns it without altering the state of the filter.
pub fn residual_of(&self, z: &VectorN<F, DimZ>) -> VectorN<F, DimZ>
[src]
Returns the residual for the given measurement (z). Does not alter the state of the filter.
pub fn measurement_of_state(&self, x: &VectorN<F, DimX>) -> VectorN<F, DimZ>
[src]
Helper function that converts a state into a measurement.
Trait Implementations
impl<F, DimX, DimZ, DimU> Default for KalmanFilter<F, DimX, DimZ, DimU> where
F: RealField,
DimX: DimName,
DimZ: DimName,
DimU: DimName,
DefaultAllocator: Allocator<F, DimX> + Allocator<F, DimZ> + Allocator<F, DimX, DimZ> + Allocator<F, DimZ, DimX> + Allocator<F, DimZ, DimZ> + Allocator<F, DimX, DimX> + Allocator<F, DimU> + Allocator<F, DimX, DimU>,
[src]
F: RealField,
DimX: DimName,
DimZ: DimName,
DimU: DimName,
DefaultAllocator: Allocator<F, DimX> + Allocator<F, DimZ> + Allocator<F, DimX, DimZ> + Allocator<F, DimZ, DimX> + Allocator<F, DimZ, DimZ> + Allocator<F, DimX, DimX> + Allocator<F, DimU> + Allocator<F, DimX, DimU>,
impl<F: Debug, DimX: Debug, DimZ: Debug, DimU: Debug> Debug for KalmanFilter<F, DimX, DimZ, DimU> where
F: RealField,
DimX: DimName,
DimZ: DimName,
DimU: DimName,
DefaultAllocator: Allocator<F, DimX> + Allocator<F, DimZ> + Allocator<F, DimX, DimZ> + Allocator<F, DimZ, DimX> + Allocator<F, DimZ, DimZ> + Allocator<F, DimX, DimX> + Allocator<F, DimU> + Allocator<F, DimX, DimU>,
[src]
F: RealField,
DimX: DimName,
DimZ: DimName,
DimU: DimName,
DefaultAllocator: Allocator<F, DimX> + Allocator<F, DimZ> + Allocator<F, DimX, DimZ> + Allocator<F, DimZ, DimX> + Allocator<F, DimZ, DimZ> + Allocator<F, DimX, DimX> + Allocator<F, DimU> + Allocator<F, DimX, DimU>,
Auto Trait Implementations
impl<F, DimX, DimZ, DimU> !Sync for KalmanFilter<F, DimX, DimZ, DimU>
impl<F, DimX, DimZ, DimU> !Send for KalmanFilter<F, DimX, DimZ, DimU>
impl<F, DimX, DimZ, DimU> !Unpin for KalmanFilter<F, DimX, DimZ, DimU>
impl<F, DimX, DimZ, DimU> !RefUnwindSafe for KalmanFilter<F, DimX, DimZ, DimU>
impl<F, DimX, DimZ, DimU> !UnwindSafe for KalmanFilter<F, DimX, DimZ, DimU>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,