[−][src]Struct filter::gh::GHKFilter
A g-h-k filter.
Example
use filter::gh::GHFilter; use assert_approx_eq::assert_approx_eq; let mut fgh: GHFilter<f32> = GHFilter::new(0.0, 0.0, 0.8, 0.2, 1.0); assert_approx_eq!(0.8, fgh.update(1.0)); assert_approx_eq!(0.2, fgh.dxt); fgh.g = 1.0; fgh.h = 0.01; assert_approx_eq!(2.0, fgh.update(2.0));
References
- Brookner, "Tracking and Kalman Filters Made Easy". John Wiley and Sons, 1998.
Fields
g: T
Filter g gain parameter.
h: T
Filter h gain parameter.
k: T
Filter k gain parameter.
dt: T
Timestep (time between sample)
xt: T
State of the filter.
dxt: T
First Derivative of the filter state.
ddxt: T
Second derivative of the filter state.
x_p: T
Predicted filter state.
dx_p: T
Predicted first derivative of the filter state.
ddx_p: T
Predicted second derivative of the filter state.
Methods
impl<T: FloatCore> GHKFilter<T>
[src]
pub fn new(x0: T, dx0: T, ddx0: T, g: T, h: T, k: T, dt: T) -> GHKFilter<T>
[src]
Returns a g-h-k filter with the given initialisation parameters.
Arguments
x0
- initial value for the filter state.dx0
- initial value for the first derivative of the filter state.ddx0
- initial value for the second derivative of the filter state.g
- filter g gain parameter.h
- filter h gain parameter.k
- filter k gain parameter.dt
- time between samples.
Example
use filter::gh::GHFilter; let fgh = GHFilter::new(0.0, 0.0, 0.2 ,0.2, 0.01);
pub fn update(&mut self, z: T) -> T
[src]
Performs the g-h filter predict and update step on the measurement z. Returns the new value for x.
pub fn vrf_prediction(&self) -> T
[src]
Returns the Variance Reduction Factor for x of the prediction step of the filter.
References
- Asquith and Woods, "Total Error Minimization in First and Second Order Prediction Filters" Report No RE-TR-70-17, U.S. Army Missle Command. Redstone Arsenal, Al. November 24, 1970.
pub fn vrf(&self) -> (T, T, T)
[src]
Returns the Variance Reduction Factor (VRF) of the state variable of the filter (x) and its derivatives (dx, ddx).
pub fn bias_error(&self, dddx: T) -> T
[src]
Returns the bias error given the specified constant jerk(dddx).
References
- Asquith and Woods, "Total Error Minimization in First and Second Order Prediction Filters" Report No RE-TR-70-17, U.S. Army Missle Command. Redstone Arsenal, Al. November 24, 1970.
Trait Implementations
Auto Trait Implementations
impl<T> Sync for GHKFilter<T> where
T: Sync,
T: Sync,
impl<T> Unpin for GHKFilter<T> where
T: Unpin,
T: Unpin,
impl<T> Send for GHKFilter<T> where
T: Send,
T: Send,
impl<T> UnwindSafe for GHKFilter<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for GHKFilter<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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>,