MutLoc.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 
00034 
00036 /* @{ */
00037 
00038 #ifndef __MUT_LOC_H
00039 #define __MUT_LOC_H
00040 
00041 #include <Spaces.h>
00042 #include <MIPMatrix.h>
00043 
00044 namespace MipAlgorithms{
00047  enum FilterType{
00048   FINITE_MEM,
00049   PARFIL,
00050   INFINITE_MEM,
00051   NUM_FILTER_TYPE
00052  };
00053  
00056  static const char* FilterTypeName[NUM_FILTER_TYPE] ={
00057   "FINITE_MEM",
00058   "PAFIL",
00059   "INFINITE_MEM",
00060  };
00061 };// end namespace MipAlgorithms
00062 
00063 
00064 namespace MipAlgorithms{
00068  class MutLocFilInput{
00069   public:
00071    int        numMeas;
00073    vector<Pose>   measure;
00075    vector<MIPMatrix> measCov;
00077    Pose       myConf;
00079    MIPMatrix*    myCov;
00081    Pose       hisConf;
00083    MIPMatrix*    hisCov;
00085    Decimal      rightProb;
00090    bool       updateValue;
00091 
00093                         pair<bool,Decimal>                                      actualTime;
00094 
00096                         vector<Decimal>                                         priorWeights;
00097   
00099    MutLocFilInput();
00100   
00102    ~MutLocFilInput();
00103    
00105    string print();
00106  };
00107  
00111  class MutLocFilInput3D{
00112   public:
00114    int            numMeas;
00116    vector<Pose3D>      measure;
00118    vector<MIPMatrix>     measCov;
00120    Acceleration3D      myConfAcc;
00122    Velocity3D        myConfAngVel;
00124    Velocity3D        myConfLinVel;
00126    MIPMatrix*        myCov;
00128    Acceleration3D      hisConfAcc;
00130    Velocity3D        hisConfAngVel;
00132    Velocity3D        hisConfLinVel;
00134    MIPMatrix*        hisCov;
00136    Decimal          rightProb;
00138    bool           useVelMeasurements;
00139    
00141 //    Acceleration3D      myPrevConfAcc;
00143 //    Velocity3D      myPrevConfAngVel;
00145 //    Acceleration3D      hisPrevConfAcc;
00147 //    Velocity3D      hisPrevConfAngVel;
00148    
00149    
00154    bool       updateValue;
00155    
00156    bool        sysMeasUpdate;
00157    
00158    Velocity3D      myOmegaVel;
00159    
00161    pair<bool,Decimal>                                      actualTime;
00162    
00164    vector<Decimal>                                         priorWeights;
00165    
00167    MutLocFilInput3D();
00168    
00170    ~MutLocFilInput3D();
00171    
00173    string print();
00174  };
00175 }; // end namespace MipAlgorithms
00176 
00177 
00178 namespace MipAlgorithms{
00182  class MutLocFilter{
00183   
00184   public:
00185    
00188    virtual void step(MutLocFilInput &input)=0;  //filtraggio di tipo Kalman
00189    
00191    virtual void reset()=0;
00192    
00196    virtual int getEstimate(Pose *best)=0;
00197    
00201    virtual int getCovariance(MIPMatrix* cov){}
00202    
00206    virtual int getAllEstimates(vector<Pose> &all, vector<Decimal> &allMarks)=0;
00207    
00209    virtual string print()=0;
00210  
00212    MutLocFilter();
00213    
00215    ~MutLocFilter();
00216    
00218    void init();
00219    
00221    void uninit();
00222    
00224    bool initialized();
00225   
00227    bool firstPosteriorComputed(){
00228     return _firstPostComputed;
00229    }
00230    
00232    void setFirstPosteriorComputed(){
00233     _firstPostComputed = true;
00234    }
00235    
00236    
00237   private:
00238    
00239    bool _initialized;
00240    bool _firstPostComputed;
00241  };
00242  
00246  class MutLocFilter3D{
00247   
00248   public:
00249    
00252    virtual void step(MutLocFilInput3D &input)=0;  //filtraggio di tipo Kalman
00253    
00255    virtual void reset()=0;
00256    
00260    virtual int getEstimate(Pose3D *best,Velocity3D* bestVel=0)=0;
00261    
00265    virtual int getCovariance(MIPMatrix* cov){}
00266    
00270    virtual int getAllEstimates(vector<Pose3D> &all, vector<Decimal> &allMarks,vector<Velocity3D> &velEstimates)=0;
00271    
00273    virtual string print()=0;
00274  
00276    MutLocFilter3D();
00277    
00279    ~MutLocFilter3D();
00280    
00282    void init();
00283    
00285    void uninit();
00286    
00288    bool initialized();
00289   
00291    bool firstPosteriorComputed(){
00292     return _firstPostComputed;
00293    }
00294    
00296    void setFirstPosteriorComputed(){
00297     _firstPostComputed = true;
00298    }
00299    
00300    
00301   private:
00302    
00303    bool _initialized;
00304    bool _firstPostComputed;
00305  };
00306 };// end namespace MipAlgorithms
00307 
00308 #endif
00309 
00310 
00311 
00312 /* @} */
00313 
00314 
00315 
00316 
00317 
00318 
00319 
00320 
00321 
00322 
00323 
00324 
00325 
00326 
00327 
00328 
00329 
00330 
00331 
00332 
00333 
00334 
00335 

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