filter.cpp
Go to the documentation of this file.
00001 // $Id$
00002 // Copyright (C) 2003 Klaas Gadeyne <first dot last at gmail dot com>
00003 //
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU Lesser General Public License as published by
00006 // the Free Software Foundation; either version 2.1 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 //
00018 
00019 #include "filter.h"
00020 
00021 #define StateVar SVar
00022 #define MeasVar MVar
00023 
00024 // Constructor
00025 template<typename SVar, typename MVar>
00026 Filter<SVar,MVar>::Filter(Pdf<SVar>* prior)
00027   : _prior(prior),
00028     _timestep(0)
00029 {}
00030 
00031 template<typename SVar, typename MVar>
00032 Filter<SVar,MVar>::~Filter(){}
00033 
00036 template<typename SVar, typename MVar>
00037 Filter<SVar,MVar>::Filter(const Filter<SVar,MVar>& filt)
00038 {}
00039 
00040 template<typename SVar, typename MVar>  void
00041 Filter<SVar,MVar>::Reset(Pdf<SVar> * prior)
00042 {
00043   _prior = prior;
00044   _post = prior;
00045   // cout << "Filter::Reset() Post = " << _post->ExpectedValueGet() << endl;
00046 }
00047 
00048 template<typename SVar, typename MVar> int
00049 Filter<SVar,MVar>::TimeStepGet() const
00050 {
00051   return _timestep;
00052 }
00053 
00054 template<typename SVar, typename MVar> bool
00055 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00056                           const SVar& u,
00057                           MeasurementModel<MVar,SVar>* const measmodel,
00058                           const MVar& z,
00059                           const SVar& s)
00060 {
00061   return this->UpdateInternal(sysmodel,u,measmodel,z,s);
00062 }
00063 
00064 template<typename SVar, typename MVar> bool
00065 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00066                           MeasurementModel<MVar,SVar>* const measmodel,
00067                           const MVar& z,
00068                           const SVar& s)
00069 {
00070   SVar u;
00071   return this->UpdateInternal(sysmodel,u,measmodel,z,s);
00072 }
00073 
00074 template<typename SVar, typename MVar> bool
00075 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00076                           MeasurementModel<MVar,SVar>* const measmodel,
00077                           const MVar& z)
00078 {
00079   SVar s; SVar u;
00080   return this->UpdateInternal(sysmodel,u,measmodel,z,s);
00081 }
00082 
00083 template<typename SVar, typename MVar> bool
00084 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00085                           const SVar& u,
00086                           MeasurementModel<MVar,SVar>* const measmodel,
00087                           const MVar& z)
00088 {
00089   SVar s;
00090   return this->UpdateInternal(sysmodel,u,measmodel,z,s);
00091 }
00092 
00093 template<typename SVar, typename MVar> bool
00094 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00095                           const SVar& u)
00096 {
00097   SVar s; MVar z;
00098   return this->UpdateInternal(sysmodel,u,NULL,z,s);
00099 }
00100 
00101 template<typename SVar, typename MVar> bool
00102 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel)
00103 {
00104   SVar s; MVar z; SVar u;
00105   return this->UpdateInternal(sysmodel,u,NULL,z,s);
00106 }
00107 
00108 template<typename SVar, typename MVar> bool
00109 Filter<SVar,MVar>::Update(MeasurementModel<MVar,SVar>* const measmodel,
00110                           const MVar& z,
00111                           const SVar& s)
00112 {
00113   SVar u;
00114   return this->UpdateInternal(NULL,u,measmodel,z,s);
00115 }
00116 
00117 template<typename SVar, typename MVar> bool
00118 Filter<SVar,MVar>:: Update(MeasurementModel<MVar,SVar>* const measmodel,
00119                            const MVar& z)
00120 {
00121   SVar u; SVar s;
00122   return this->UpdateInternal(NULL,u,measmodel,z,s);
00123 }
00124 
00125 template<typename SVar, typename MVar> Pdf<SVar> *
00126 Filter<SVar,MVar>::PostGet()
00127 {
00128   return _post;
00129 }


bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Mon Feb 11 2019 03:45:12