Fawkes API  Fawkes Development Version
kalman_1d.h
1 /***************************************************************************
2  * kalman_1d.h - Kalman filter (one dimensional)
3  *
4  * Created: Mon Nov 10 2008
5  * Copyright 2008 Bahram Maleki-Fard
6  *
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version. A runtime exception applies to
13  * this software (see LICENSE.GPL_WRE file mentioned below for details).
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
21  */
22 
23 namespace fawkes {
24 
26 {
27  public:
28  KalmanFilter1D(float noise_x = 1.0, float noise_z = 1.0, float mu = 0.0,
29  float sig = 1.0);
31 
32  void filter(float observe);
33  void filter(float observe, float& mu, float& sig);
34  float predict() const;
35  float predict(float vel) const;
36  float predict(float vel, int steps, float noise_z) const;
37  float predict(float mu, float vel, int steps, float noise_z) const;
38 
39  private:
40  float __noise_x; /**< transition noise */
41  float __noise_z; /**< "sigma_z", sensor noise */
42  float __mu; /**< mean "mu" */
43  float __sig; /**< "sigma_0". sigma ~ standard deviation */
44 };
45 }
46 
float predict() const
Predicts the next position based on the past observations.
Definition: kalman_1d.cpp:82
Fawkes library namespace.
~KalmanFilter1D()
Destructor.
Definition: kalman_1d.cpp:48
void filter(float observe)
Filters an observation.
Definition: kalman_1d.cpp:56
KalmanFilter1D(float noise_x=1.0, float noise_z=1.0, float mu=0.0, float sig=1.0)
Constructor.
Definition: kalman_1d.cpp:39
One-dimensional Kalman filter implementation for single-precision floats.
Definition: kalman_1d.h:25