Fawkes API  Fawkes Development Version
fawkes::KalmanFilter1D Class Reference

One-dimensional Kalman filter implementation for single-precision floats. More...

#include <>>

Public Member Functions

 KalmanFilter1D (float noise_x=1.0, float noise_z=1.0, float mu=0.0, float sig=1.0)
 Constructor. More...
 
 ~KalmanFilter1D ()
 Destructor. More...
 
void filter (float observe)
 Filters an observation. More...
 
void filter (float observe, float &mu, float &sig)
 Filters an observation. More...
 
float predict () const
 Predicts the next position based on the past observations. More...
 
float predict (float vel) const
 Predicts the next position based on the past observations. More...
 
float predict (float vel, int steps, float noise_z) const
 Predicts the next position based on the past observations. More...
 
float predict (float mu, float vel, int steps, float noise_z) const
 Predicts the next position based on the past observations. More...
 

Detailed Description

One-dimensional Kalman filter implementation for single-precision floats.

Author
Bahram Maleki-Fard

Definition at line 25 of file kalman_1d.h.

Constructor & Destructor Documentation

◆ KalmanFilter1D()

fawkes::KalmanFilter1D::KalmanFilter1D ( float  noise_x = 1.0,
float  noise_z = 1.0,
float  mu = 0.0,
float  sig = 1.0 
)

Constructor.

Parameters
noise_xTransition noise, by default 1.0.
noise_zSensor noise, by default 1.0.
muInitial mu, by default 0.0.
sigStandard deviation, by default 1.0.

Definition at line 39 of file kalman_1d.cpp.

◆ ~KalmanFilter1D()

fawkes::KalmanFilter1D::~KalmanFilter1D ( )

Destructor.

Definition at line 48 of file kalman_1d.cpp.

Member Function Documentation

◆ filter() [1/2]

void fawkes::KalmanFilter1D::filter ( float  observe)

Filters an observation.

The internal mean and deviation are updated.

Parameters
observeThe observation.

Definition at line 56 of file kalman_1d.cpp.

◆ filter() [2/2]

void fawkes::KalmanFilter1D::filter ( float  observe,
float &  mu,
float &  sig 
)

Filters an observation.

The resulting mu and sig are not only stored internally, but also in the given parameters mean and deviation.

Parameters
observeThe observation.
muThe mean (out parameter).
sigThe deviation (out parameter)

Definition at line 71 of file kalman_1d.cpp.

◆ predict() [1/4]

float fawkes::KalmanFilter1D::predict ( ) const

Predicts the next position based on the past observations.

Equivalent to predict(0.0), i.e. velocity 0.0.

Returns
predicted value

Definition at line 82 of file kalman_1d.cpp.

Referenced by predict().

◆ predict() [2/4]

float fawkes::KalmanFilter1D::predict ( float  vel) const

Predicts the next position based on the past observations.

Equivalent to predict(vel, 1, 0.0).

Parameters
velThe velocity of the object, 0.0 by default.
Returns
predicted value

Definition at line 94 of file kalman_1d.cpp.

References predict().

◆ predict() [3/4]

float fawkes::KalmanFilter1D::predict ( float  vel,
int  steps,
float  noise_z 
) const

Predicts the next position based on the past observations.

Parameters
velThe velocity of the object.
stepsThe steps to look into the future.
noise_zSensor noise.
Returns
predicted value

Definition at line 107 of file kalman_1d.cpp.

References predict().

◆ predict() [4/4]

float fawkes::KalmanFilter1D::predict ( float  mu,
float  vel,
int  steps,
float  noise_z 
) const

Predicts the next position based on the past observations.

Parameters
muExplicitely
velThe velocity of the object, 0.0 by default.
stepsThe steps to look into the future, 1 by default.
noise_zSensor noise.
Returns
predicted value

Definition at line 120 of file kalman_1d.cpp.


The documentation for this class was generated from the following files: