filter.h
Go to the documentation of this file.
1 // $Id$
2 // Copyright (C) 2002 Klaas Gadeyne <first dot last at gmail dot com>
3 //
4  /***************************************************************************
5  * This library is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public *
7  * License as published by the Free Software Foundation; *
8  * version 2 of the License. *
9  * *
10  * As a special exception, you may use this file as part of a free *
11  * software library without restriction. Specifically, if other files *
12  * instantiate templates or use macros or inline functions from this *
13  * file, or you compile this file and link it with other files to *
14  * produce an executable, this file does not by itself cause the *
15  * resulting executable to be covered by the GNU General Public *
16  * License. This exception does not however invalidate any other *
17  * reasons why the executable file might be covered by the GNU General *
18  * Public License. *
19  * *
20  * This library is distributed in the hope that it will be useful, *
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
23  * Lesser General Public License for more details. *
24  * *
25  * You should have received a copy of the GNU General Public *
26  * License along with this library; if not, write to the Free Software *
27  * Foundation, Inc., 59 Temple Place, *
28  * Suite 330, Boston, MA 02111-1307 USA *
29  * *
30  ***************************************************************************/
31 
32 #ifndef __FILTER__
33 #define __FILTER__
34 
35 #include "../model/systemmodel.h"
36 #include "../model/measurementmodel.h"
37 #include "../pdf/pdf.h"
38 
39 namespace BFL
40 {
41  using namespace std;
42 
44 
77  template <typename StateVar, typename MeasVar> class Filter
78  {
79  protected:
80 
83 
85 
95  Pdf<StateVar> * _post;
96 
98 
101 
109  virtual bool UpdateInternal(SystemModel<StateVar>* const sysmodel,
110  const StateVar& u,
111  MeasurementModel<MeasVar,StateVar>* const measmodel,
112  const MeasVar& z,
113  const StateVar& s)=0;
114 
115  public:
117 
120  Filter(Pdf<StateVar> * prior);
121 
123 
125  Filter(const Filter<StateVar,MeasVar>& filt);
126 
128  virtual ~Filter();
129 
131  virtual void Reset(Pdf<StateVar> * prior);
132 
134 
140  virtual bool Update(SystemModel<StateVar>* const sysmodel,
141  const StateVar& u,
142  MeasurementModel<MeasVar,StateVar>* const measmodel,
143  const MeasVar& z,
144  const StateVar& s);
145 
147 
154  virtual bool Update(SystemModel<StateVar>* const sysmodel,
155  MeasurementModel<MeasVar,StateVar>* const measmodel,
156  const MeasVar& z,
157  const StateVar& s);
159 
165  virtual bool Update(SystemModel<StateVar>* const sysmodel,
166  MeasurementModel<MeasVar,StateVar>* const measmodel,
167  const MeasVar& z);
169 
175  virtual bool Update(SystemModel<StateVar>* const sysmodel,
176  const StateVar& u,
177  MeasurementModel<MeasVar,StateVar>* const measmodel,
178  const MeasVar& z);
179 
181 
184  virtual bool Update(SystemModel<StateVar>* const sysmodel,
185  const StateVar& u);
187 
189  virtual bool Update(SystemModel<StateVar>* const sysmodel);
190 
192 
197  virtual bool Update(MeasurementModel<MeasVar,StateVar>* const measmodel,
198  const MeasVar& z,
199  const StateVar& s);
201 
205  virtual bool Update(MeasurementModel<MeasVar,StateVar>* const measmodel,
206  const MeasVar& z);
207 
209 
212  virtual Pdf<StateVar> * PostGet();
213 
215 
218  int TimeStepGet() const;
219  };
220 
221  // For template instantiation
222 #include "filter.cpp"
223 
224 } // End namespace BFL
225 
226 #endif // __FILTER__
Abstract class representing an interface for Bayesian Filters.
Definition: filter.h:77
Class PDF: Virtual Base class representing Probability Density Functions.
Definition: pdf.h:53
#define StateVar
virtual bool Update(MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Measurement Update (system with "sensing params")
Definition: filter.h:110
int _timestep
Represents the current timestep of the filter.
Definition: filter.h:100
#define MeasVar
Pdf< StateVar > * _prior
prior Pdf
Definition: filter.h:82


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 Jun 10 2019 12:47:59