GMIDPHDUnicycle2DRCFilter.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 __GMIDPHD_UNICYCLE_2D_RC_FILTER_H
00032 #define __GMIDPHD_UNICYCLE_2D_RC_FILTER_H
00033 
00034 #include <Spaces.h>
00035 #include <GaussianMixture.h>
00036 #include "PHDFilter.h"
00037 
00038 #define NO_ID -1
00039 #define STEADY_ID -2
00040 
00041 using namespace MipBaselib;
00042 using namespace arma;
00043 
00044 namespace MipAlgorithms{
00045 
00047  /* @{ */
00048  
00052  class GMIDPHDUnicycle2DRCFilterPars:public PHDFilterPars{
00053   public:
00054    
00056    int myId;
00057 
00058    // system model
00060    DMat N_n_x;
00061 
00062    // measurement model
00064    DMat H;
00066    DMat N_n_z;
00067 
00068    // pruning thresholds
00071    Decimal truncThresh;
00073    int maxNumComponents;
00076    Decimal mergThresh;
00078    int partNumber;
00079 
00080    // parameters for the computation of the actual detection probability of a target.
00082    Decimal sensorDetectionRay;
00084    Decimal targetDimension;
00086    Decimal maxDetectionBearing;
00087 
00089    bool useNewNoMeasWeight;
00090 
00091    // constructors
00093    GMIDPHDUnicycle2DRCFilterPars();
00095    GMIDPHDUnicycle2DRCFilterPars(int mI, 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, bool unw=false);
00096  };
00097  
00098  
00099  
00103  class GMIDPHDUnicycle2DRCFilterVars:public PHDFilterVars{
00104 
00105   public:
00106 
00107    Pose myLastPose;
00108    Decimal lastMeasurementNumber;
00109    vector<Position> lastMeasurements;
00110 
00111    GaussianMixtureID prediction;
00112 
00113    vector<DCol> predictedMeasures;
00114    vector<Decimal> predictedMeasuresD;
00115    vector<Angle> predictedMeasuresB;
00116    vector<DMat> predictedCovariances;
00117    vector<DMat> kalmanGains;
00118    vector<DMat> stepKCovariances;
00119    vector<Decimal> detectionProbability;
00120    
00121    bool firstStepAfterMeasurements;
00122    
00123    GaussianMixtureID belief;
00124    
00125    vector<int> lastOtherRobotPoseNum;
00126    map<int,Pose> lastOtherRobotPose;
00127    map<int,Pose> odometries;
00128 
00129    GMIDPHDUnicycle2DRCFilterVars();
00130  };
00131  
00132  
00136  class GMIDPHDUnicycle2DRCFilter:public PHDFilter{
00137   protected:
00138    GMIDPHDUnicycle2DRCFilterVars* _gmvars;
00139    GMIDPHDUnicycle2DRCFilterPars* _gmpars;
00140 
00141   public:
00143    GMIDPHDUnicycle2DRCFilter();
00144 
00146    GMIDPHDUnicycle2DRCFilter(GMIDPHDUnicycle2DRCFilterPars inParams);
00147    
00148    void step(PHDFilterIn &in);
00149    
00150    string print();
00151    
00152    void getBelief(GaussianMixtureID &gm);
00153    Pose getMyBestPose();
00154    void setMyPose(Pose &p);
00155    
00156    string getObjectName() const {
00157     return "GMIDPHDUnicycle2DRCFilter";
00158    }
00159    
00160    PHDFilterOutputType getOutputType(){
00161     return PHD_OUT_GMID;
00162    }
00163    
00164   protected:
00165    void _computeOdometries(PHDFilterIn &in);
00166    
00167    void _predictBirthTarget(PHDFilterIn &in);
00168    void _predictExistingTarget();
00169    
00170    void _buildPHDUpdateComponents(PHDFilterIn &in);
00171    void _updateWithNoMeasurements(PHDFilterIn &in);
00172    void _updateWithMeasurements(PHDFilterIn &in);
00173    
00174    void _prune();
00175    void _pruneSimple();
00176    
00177    void _initialize(PHDFilterIn &in);
00178    void _normalStep(PHDFilterIn &in);
00179    
00180    Decimal _mahalanobisDist(GaussianComponent& a, GaussianComponent& b);
00181  };
00182 
00183  /* @} */
00184 
00185 }
00186 
00187 
00188 #endif
00189 
00190 
00191 
00192 
00193 
00194 
00195 
00196 

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