EKparticlefilter.h
Go to the documentation of this file.
1 // $ Id: $
2 // Copyright (C) 2002 Klaas Gadeyne <first dot last at gmail dot com>
3 // 2008 Tinne De Laet <first dot last at mech dot kuleuven dot be>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation; either version 2.1 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 //
19 
20 #ifndef __EK_PARTICLE_FILTER__
21 #define __EK_PARTICLE_FILTER__
22 
23 #include "particlefilter.h"
24 #include "../pdf/EKF_proposaldensity.h"
25 #include "../pdf/mcpdf.h"
26 #include <list>
27 
28 namespace BFL
29 {
31 
36  : public ParticleFilter<ColumnVector,ColumnVector>
37  {
38  protected:
40  std::vector<SymmetricMatrix> _sampleCov;
41  std::vector<SymmetricMatrix>::iterator _cov_it;
42 
43  std::vector<SymmetricMatrix> _tmpCov;
44  std::vector<SymmetricMatrix>::iterator _tmpCovit;
45 
46  // helper variables for resampleing to prevent memory allocation on the heap
47  const int _dimension;
48  const int _num_samples;
49  std::vector<WeightedSample<ColumnVector> > _old_samples;
50  std::vector<WeightedSample<ColumnVector> >::iterator _oit;
51  std::vector<WeightedSample<ColumnVector> > _result_samples;
52  std::vector<WeightedSample<ColumnVector> >::iterator _rit;
53  std::vector<double> _unif_samples;
54  std::vector<double> _CumPDF;
55  std::vector<double>::const_iterator _CumPDFit;
56  ColumnVector _x_old;
58 
59  virtual bool UpdateInternal(SystemModel<ColumnVector>* const sysmodel,
60  const ColumnVector& u,
62  const ColumnVector& z,
63  const ColumnVector& s);
64 
67  virtual bool ProposalStepInternal(SystemModel<ColumnVector> * const sysmodel,
68  const ColumnVector & u,
70  const ColumnVector & z,
71  const ColumnVector & s);
72 
74  virtual bool Resample();
75 
76  public:
78 
88  int resampleperiod = 0,
89  double resamplethreshold = 0,
90  int resamplescheme = DEFAULT_RS);
91 
93  virtual ~EKParticleFilter();
94  };
95 
96 } // End namespace BFL
97 
98 #endif // __EK_PARTICLE_FILTER__
std::vector< WeightedSample< ColumnVector > > _old_samples
#define DEFAULT_RS
virtual bool UpdateInternal(SystemModel< ColumnVector > *const sysmodel, const ColumnVector &u, MeasurementModel< ColumnVector, ColumnVector > *const measmodel, const ColumnVector &z, const ColumnVector &s)
Actual implementation of Update, varies along filters.
std::vector< WeightedSample< ColumnVector > >::iterator _oit
std::vector< double > _unif_samples
EKParticleFilter(MCPdf< ColumnVector > *prior, int resampleperiod=0, double resamplethreshold=0, int resamplescheme=DEFAULT_RS)
Constructor.
std::vector< SymmetricMatrix > _tmpCov
Virtual Class representing all particle filters.
virtual ~EKParticleFilter()
Destructor.
virtual bool Resample()
Resample also redefined for the same reasons...
Particle filter using EKF for proposal step.
std::vector< SymmetricMatrix >::iterator _cov_it
std::vector< double > _CumPDF
Monte Carlo Pdf: Sample based implementation of Pdf.
Definition: mcpdf.h:49
std::vector< double >::const_iterator _CumPDFit
Sample< ColumnVector > _sample
std::vector< WeightedSample< ColumnVector > > _result_samples
virtual bool ProposalStepInternal(SystemModel< ColumnVector > *const sysmodel, const ColumnVector &u, MeasurementModel< ColumnVector, ColumnVector > *const measmodel, const ColumnVector &z, const ColumnVector &s)
std::vector< WeightedSample< ColumnVector > >::iterator _rit
std::vector< SymmetricMatrix > _sampleCov
Sample Covariances for use with EKF Proposal density.
std::vector< SymmetricMatrix >::iterator _tmpCovit


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