GMPHDUnicycle2DIdCentrFilter.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_ID_CENTR_FILTER_H
00032 #define __GMPHD_UNICYCLE_2D_ID_CENTR_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 GMPHDUnicycle2DIdCentrFilterPars: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;
00076    int partNumber;
00077 
00078    // parameters for the computation of the actual detection probability of a target.
00080    Decimal sensorDetectionRay;
00082    Decimal targetDimension;
00084    Decimal maxDetectionBearing;
00085 
00087    int sensorNum;
00089    vector<Pose> sensor;
00090 
00091    // Borders of the supervised area
00093    Decimal nBorder;
00095    Decimal sBorder;
00097    Decimal wBorder;
00099    Decimal eBorder;
00100 
00101 
00102    
00103    // constructors
00105    GMPHDUnicycle2DIdCentrFilterPars();
00107    GMPHDUnicycle2DIdCentrFilterPars(Decimal pS, Decimal pD, Time t, DMat& nx, DMat& h, DMat& nz, Decimal tt, int mc, Decimal mt, int pN, Decimal sdr, Decimal td, Decimal mdb, vector<Pose>& sP);
00108  };
00109  
00110  
00114  class GMPHDUnicycle2DIdCentrFilterVars:public PHDFilterVars{
00115    
00116   public:
00117 
00118    Pose myLastPose;
00119    Decimal lastMeasurementNumber;
00120    vector<Position> lastMeasurements;
00121 
00122    GaussianMixtureJointId prediction;
00123    
00124    vector<vector<DCol> > predictedMeasures;
00125    vector<vector<DMat> > predictedCovariances;
00126    vector<vector<DMat> > kalmanGains;
00127    vector<vector<DMat> > stepKCovariances;
00128    vector<vector<Decimal> > detectionProbability;
00129 
00130    bool firstStepAfterMeasurements;
00131    
00132    GaussianMixtureJointId belief;
00133    
00134    vector<int> lastOtherRobotPoseNum;
00135    map<int,Pose> lastOtherRobotPose;
00136    map<int,Pose> odometries;
00137 
00138    vector<vector <Position> > otherMeasures;
00139 
00140    GMPHDUnicycle2DIdCentrFilterVars(int nS);
00141  };
00142 
00143  
00147  class GMPHDUnicycle2DIdCentrFilter:public PHDFilter{
00148   private:
00149    GMPHDUnicycle2DIdCentrFilterVars* _gmvars;
00150    GMPHDUnicycle2DIdCentrFilterPars* _gmpars;
00151 
00152   public:
00153    GMPHDUnicycle2DIdCentrFilter();
00154    
00155    GMPHDUnicycle2DIdCentrFilter(GMPHDUnicycle2DIdCentrFilterPars inParams);
00156    
00157    void step(PHDFilterIn &in);
00158    
00159    string print();
00160 
00161    void getBelief(GaussianMixtureJointId &gm);
00162    
00163    string getObjectName() const {
00164     return "GMPHDUnicycle2DIdCentrFilter";
00165    }
00166    
00167    PHDFilterOutputType getOutputType(){
00168     return PHD_OUT_GMJID;
00169    }
00170 
00171   protected:
00172    void _computeOdometries(PHDFilterIn &in);
00173    
00174    void _predictBirthTarget(PHDFilterIn &in);
00175    void _predictExistingTarget();
00176    void _buildPHDUpdateComponents(PHDFilterIn &in, int n);
00177    void _updateWithNoDetection(PHDFilterIn &in);
00178    void _updateWithMeasurements(PHDFilterIn &in, int n);
00179    void _prune();
00180 //    void _prune2();
00181 
00182    void _initialize(PHDFilterIn &in);
00183    void _normalStep(PHDFilterIn &in);
00184    
00185    Decimal _mahalanobisDist(GaussianComponent& a, GaussianComponent& b);
00186 
00187  };
00188  
00189  /* @} */
00190  
00191 }
00192 
00193 
00194 #endif
00195 
00196 
00197 
00198 
00199 
00200 
00201 
00202 

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