DAEKF.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // $Id$
00004 //
00005 // Copyright 2008, 2009, 2010, 2011, 2012  Antonio Franchi and Paolo Stegagno    
00006 //
00007 // This file is part of MIP.
00008 //
00009 // MIP 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 3 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // MIP is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with MIP. If not, see <http://www.gnu.org/licenses/>.
00021 //
00022 // Contact info: antonio.franchi@tuebingen.mpg.de stegagno@diag.uniroma1.it
00023 //
00024 // ----------------------------------------------------------------------------
00025 
00026 
00030 
00032 /* @{ */
00033 
00034 #ifndef __DAEKF_H
00035 #define __DAEKF_H
00036 
00037 #include "MutLoc.h"
00038 
00039 #define CLMEMORY       100
00040 #define KILLPERCENT    0.85
00041 #define INITVALUE      0.8
00042 #define MAXCLSTNUMBER  500
00043 
00044 namespace MipAlgorithms{
00048  class Cluster{
00049   public:
00051    Pose     mean;
00053    MIPMatrix  *cov;
00055    Decimal              value;
00057    bool                miss[CLMEMORY];
00059    int                 firstIn;
00061    int                 life;
00063    int                 id;
00064    
00066    Cluster();
00067    
00073    Cluster(Pose tMean, MIPMatrix &tCov, Decimal tValue = INITVALUE*((Decimal)CLMEMORY), int ID = 0);
00074    
00077    Cluster(const Cluster &C);
00078    
00080    ~Cluster();
00081    
00084    void operator=(Cluster C);
00085    
00087    string print();
00088  };
00089 };// end MipAlgorithms
00090 
00091 
00092 namespace MipAlgorithms{
00097  class DAEKFilParams {
00098   public:
00100    Decimal minProbTh;
00102    Decimal maxDistTh;
00104    Decimal minSurvTh;
00106    FilterType filterType;
00108    int secsForPhase2;
00109    
00111    DAEKFilParams();
00112    
00114    DAEKFilParams(Decimal p, Decimal d, Decimal s, FilterType t, int secs);
00115    
00117    DAEKFilParams(const DAEKFilParams &A);
00118    
00120    void operator= (const DAEKFilParams &A);
00121  };
00122 };// end namespace MipAlgorithms
00123 
00124 
00125 namespace MipAlgorithms{
00129  class DAEKFilVariables{
00130   public:
00132    int step;
00134    int phase;
00136    int clustersNumber;
00138    vector<Cluster> clusters;
00140    MIPMatrix *Vjacobian;
00142    MIPMatrix *VjacobianTrans;
00144    vector<MIPMatrix>  VRVT;
00146    Decimal       wrongClustProb;
00148    Decimal       bestValue;
00150    int createdClusterNumber;
00152    timeval startTime;
00153   
00155    DAEKFilVariables();
00156    
00158    DAEKFilVariables(const DAEKFilVariables &A);
00159    
00161    void operator=(DAEKFilVariables &A);
00162    
00164    ~DAEKFilVariables();
00165  };
00166 };//end namespace MipAlgorithms
00167 
00168 namespace MipAlgorithms{
00172  class DAEKFilter : public MutLocFilter{
00173   public:
00174    
00176    DAEKFilter();
00177    
00179    DAEKFilter(DAEKFilParams in);
00180    
00182    void step(MutLocFilInput &input);
00183    
00186    void reset();
00187    
00190    int getEstimate(Pose *best);
00191    
00194    int getAllEstimates(vector<Pose> &all, vector<Decimal> &allMarks);
00195    
00198    string print();
00199    
00202    void reset(DAEKFilParams inPar);
00203    
00205    int getStep();
00206    
00208    int getPhase();
00209    
00211    int getClustersNumber();
00212    
00216    Pose getClustersMean(int num);
00217    
00221    Decimal getClustersValue(int num);
00222    
00223   protected:
00225    DAEKFilParams    par;
00227    DAEKFilVariables *var;
00228    
00229   private:
00230    inline Decimal lfilComputeError(Pose delta);
00231    inline void   lfilEvaluate(Decimal error, int partNum);
00232    inline void   lfilNormalize();
00233    inline Decimal lfilComputeDistance(Pose measure, Pose clusterMean, int numMeas);
00234    void lfilKalman(int clNum, Pose meas,int numMeas);
00235    void lfilAddCluster(Pose t,int numMeas);
00236    
00237    void lfilVjacobiansUpdate(MutLocFilInput &input);
00238    void lfilVRVTUpdate(MutLocFilInput &input);
00239    
00240    void lfilKInitStep(MutLocFilInput &input); //filtraggio di tipo Kalman
00241    void lfilKAlgoStep(MutLocFilInput &input); //filtraggio di tipo Kalman
00242  };
00243 };//end namespace MipAlgorithms
00244 
00245 
00246 
00247 
00248 #endif
00249 
00250 
00251 
00252 
00253 
00254 /* @} */
00255 
00256 
00257 
00258 
00259 
00260 
00261 
00262 
00263 
00264 
00265 
00266 
00267 
00268 
00269 
00270 
00271 
00272 
00273 
00274 
00275 
00276 
00277 
00278 
00279 
00280 
00281 
00282 
00283 
00284 
00285 
00286 
00287 
00288 
00289 
00290 
00291 
00292 
00293 

Generated on Mon Feb 20 07:01:06 2017 for MIP by  doxygen 1.5.6