#include <ekfFilter.hpp>
|
| | EKFFilter (double iQ=0.0001, double iR=ipow(0.2, 2)) |
| | One dimensional extended Kalman filter.
|
| |
| double | filter (double ireading) override |
| | Filters a value, like a sensor reading.
|
| |
| virtual double | filter (double ireading, double icontrol) |
| | Filters a reading with a control input.
|
| |
| double | getOutput () const override |
| | Returns the previous output from filter.
|
| |
| virtual | ~Filter () |
| |
Definition at line 12 of file ekfFilter.hpp.
◆ EKFFilter()
| okapi::EKFFilter::EKFFilter |
( |
double |
iQ = 0.0001, |
|
|
double |
iR = ipow(0.2, 2) |
|
) |
| |
|
explicit |
One dimensional extended Kalman filter.
The default arguments should work fine for most signal filtering. It won't hurt to graph your signal and the filtered result, and check if the filter is doing its job.
Q is the covariance of the process noise and R is the covariance of the observation noise. The default values for Q and R should be a modest balance between trust in the sensor and FIR filtering.
Think of R as how noisy your sensor is. Its value can be found mathematically by computing the standard deviation of your sensor reading vs. "truth" (of course, "truth" is still an estimate; try to calibrate your robot in a controlled setting where you can minimize the error in what "truth" is).
Think of Q as how noisy your model is. It decides how much "smoothing" the filter does and how far it lags behind the true signal. This parameter is most often used as a "tuning" parameter to adjust the response of the filter.
- Parameters
-
| iQ | process noise covariance |
| iR | measurement noise covariance |
◆ filter() [1/2]
| double okapi::EKFFilter::filter |
( |
double |
ireading | ) |
|
|
overridevirtual |
Filters a value, like a sensor reading.
Assumes the control input is zero.
- Parameters
-
- Returns
- filtered result
Implements okapi::Filter.
◆ filter() [2/2]
| virtual double okapi::EKFFilter::filter |
( |
double |
ireading, |
|
|
double |
icontrol |
|
) |
| |
|
virtual |
Filters a reading with a control input.
- Parameters
-
| ireading | new measurement |
| icontrol | control input |
- Returns
- filtered result
◆ getOutput()
| double okapi::EKFFilter::getOutput |
( |
| ) |
const |
|
overridevirtual |
Returns the previous output from filter.
- Returns
- the previous output from filter
Implements okapi::Filter.
| double okapi::EKFFilter::K = 0 |
|
protected |
| double okapi::EKFFilter::P = 0 |
|
protected |
◆ Pminus
| double okapi::EKFFilter::Pminus = 0 |
|
protected |
◆ Pprev
| double okapi::EKFFilter::Pprev = 1 |
|
protected |
| const double okapi::EKFFilter::Q |
|
protected |
| const double okapi::EKFFilter::R |
|
protected |
◆ xHat
| double okapi::EKFFilter::xHat = 0 |
|
protected |
◆ xHatMinus
| double okapi::EKFFilter::xHatMinus = 0 |
|
protected |
◆ xHatPrev
| double okapi::EKFFilter::xHatPrev = 0 |
|
protected |
The documentation for this class was generated from the following file: