Fawkes API Fawkes Development Version
|
00001 /*************************************************************************** 00002 * kalman_1d.h - Kalman filter (one dimensional) 00003 * 00004 * Created: Mon Nov 10 2008 00005 * Copyright 2008 Bahram Maleki-Fard 00006 * 00007 ****************************************************************************/ 00008 00009 /* This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. A runtime exception applies to 00013 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00021 */ 00022 00023 namespace fawkes { 00024 00025 class KalmanFilter1D 00026 { 00027 public: 00028 KalmanFilter1D(float noise_x = 1.0, float noise_z = 1.0, float mu = 0.0, 00029 float sig = 1.0); 00030 ~KalmanFilter1D(); 00031 00032 void filter(float observe); 00033 void filter(float observe, float& mu, float& sig); 00034 float predict() const; 00035 float predict(float vel) const; 00036 float predict(float vel, int steps, float noise_z) const; 00037 float predict(float mu, float vel, int steps, float noise_z) const; 00038 00039 private: 00040 float __noise_x; /**< transition noise */ 00041 float __noise_z; /**< "sigma_z", sensor noise */ 00042 float __mu; /**< mean "mu" */ 00043 float __sig; /**< "sigma_0". sigma ~ standard deviation */ 00044 }; 00045 } 00046