GMPHDUnicycle2DNoIdFilter.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 
00030 
00031 #ifndef __GMPHD_UNICYCLE_2D_NO_ID_FILTER_H
00032 #define __GMPHD_UNICYCLE_2D_NO_ID_FILTER_H
00033 
00034 #include <Spaces.h>
00035 #include <GaussianMixture.h>
00036 #include "PHDFilter.h"
00037 #include <map>
00038 
00039 #define NO_ID -1
00040 #define STEADY_ID -2
00041 
00042 using namespace MipBaselib;
00043 using namespace arma;
00044 
00045 namespace MipAlgorithms{
00046  
00048  /* @{ */
00049  
00053  class GMPHDUnicycle2DNoIdFilterPars:public PHDFilterPars{
00054   public:
00055    
00056    // system model
00058    DMat N_n_x;
00059    
00060    // measurement model
00062    DMat H;
00064    DMat N_n_z;
00065    
00066    // pruning thresholds
00069    Decimal truncThresh;
00071    int maxNumComponents;
00074    Decimal mergThresh;
00075 
00077    int partNumber;
00078    
00079    // constructors
00081    GMPHDUnicycle2DNoIdFilterPars();
00083    GMPHDUnicycle2DNoIdFilterPars(Decimal pS, Decimal pD, Time t, DMat& nx, DMat& h, DMat& nz, Decimal tt, int mc, Decimal mt, int pN);
00084  };
00085  
00086  
00090  class GMPHDUnicycle2DNoIdFilterVars:public PHDFilterVars{
00091    
00092   public:
00093 
00094    Pose myLastPose;
00095    Decimal lastMeasurementNumber;
00096 
00097    GaussianMixtureJointId prediction;
00098    
00099    vector<DCol> predictedMeasures;
00100    vector<DMat> predictedCovariances;
00101    vector<DMat> kalmanGains;
00102    vector<DMat> stepKCovariances;
00103    bool firstStepAfterMeasurements;
00104    
00105    GaussianMixtureJointId belief;
00106    
00107    GMPHDUnicycle2DNoIdFilterVars();
00108    
00109    vector<int> lastOtherRobotPoseNum;
00110    map<int,Pose> lastOtherRobotPose;
00111    map<int,Pose> odometries;
00112  };
00113  
00114  
00118  class GMPHDUnicycle2DNoIdFilter:public PHDFilter{
00119   private:
00120    GMPHDUnicycle2DNoIdFilterVars* _gmvars;
00121    GMPHDUnicycle2DNoIdFilterPars* _gmpars;
00122 
00123   public:
00124    GMPHDUnicycle2DNoIdFilter();
00125    
00126    GMPHDUnicycle2DNoIdFilter(GMPHDUnicycle2DNoIdFilterPars inParams);
00127    
00128    void step(PHDFilterIn &in);
00129    
00130    string print();
00131 
00132    void getBelief(GaussianMixtureJointId &gm);
00133 
00134    string getObjectName() const {
00135     return "GMPHDUnicycle2DNoIdFilter";
00136    }
00137    
00138    PHDFilterOutputType getOutputType(){
00139     return PHD_OUT_GM;
00140    }
00141    
00142    
00143   protected:
00144    void _computeOdometries(PHDFilterIn &in);
00145    
00146    void _predictBirthTarget(PHDFilterIn &in);
00147    void _predictExistingTarget();
00148    void _buildPHDUpdateComponents(PHDFilterIn &in);
00149    void _updateWithMeasurements(PHDFilterIn &in);
00150    void _prune();
00151 //    void _prune2();
00152 
00153    void _initialize(PHDFilterIn &in);
00154    void _normalStep(PHDFilterIn &in);
00155    
00156    Decimal _mahalanobisDist(GaussianComponent& a, GaussianComponent& b);
00157 
00158  };
00159  
00160  /* @} */
00161  
00162 }
00163 
00164 
00165 #endif
00166 
00167 
00168 
00169 
00170 
00171 
00172 
00173 

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