CentralizedPHDFilterTask.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 
00037 
00038 
00039 #ifndef __CPHD_FILTER_TASK_H_
00040 #define __CPHD_FILTER_TASK_H_
00041 
00042 #include <armadillo>
00043 
00044 #include <Task.h>
00045 #include <Resource.h>
00046 #include <MobileRob.h>
00047 #include <ProtrusionExtr.h>
00048 #include <GMPHDUnicycle2DIdCentrFilter.h>
00049 #include <SharedMem.h>
00050 #include <CommonOptions.h>
00051 #ifndef MIP_PLATFORM_ARM
00052  #include <DraWin.h>
00053 #endif
00054 #include <CommModule.h>
00055 
00056 #include <EKFilterUnicycle2D.h>
00057 
00058 
00059 
00060 using namespace MipAlgorithms;
00061 using namespace MipResources;
00062 using namespace arma;
00063 
00064 
00065 namespace MipTasks{
00066  
00068  /* @{ */
00069  
00073  class CentralizedPHDFilterTaskOptions : public Options {
00074   public:
00075    
00077    DecimalOption* timeBetweenUpdates;
00079    StringOption*  filterType;
00081    DecimalOption* survivalProbability;
00083    DecimalOption* detectionProbability;
00086    DecimalOption* truncationThreshold;
00088    IntOption*   maxComponentNumber;
00091    DecimalOption* mergingThreshold;
00093    IntOption*   particleNumber;
00094 
00096    DecimalOption* sensorDetectionRay;
00098    DecimalOption* targetDimension;
00100    DecimalOption* maxDetectionBearing;
00101 
00103    CentralizedPHDFilterTaskOptions();
00104 
00105    string getObjectName() const {
00106     return "CentralizedPHDFilterTaskOptions";
00107    }
00108  };
00109  
00110  
00114  class CentralizedPHDFilterTask : public Task{
00115   private:
00116    
00117    static const TaskPlate _plate = CPH_TASK;
00118    
00119    static const long int  _maxDurSec  = 0,      _maxDurUsec = 100000;
00120    static const long int  _maxSamplPeriodSec = 0, _maxSamplPeriodUsec = 500000;
00121    static const long int  _minSamplPeriodSec = 0, _minSamplPeriodUsec = 50000;
00122    
00123    PHDFilter* _phdFilter;
00124    
00125    CommModule* _commModule;
00126    
00127 #ifndef MIP_PLATFORM_ARM
00128    DraWin*      _draWin;   
00129    unsigned int _drawList; 
00130    bool         dwOn;      
00131  #endif
00132 
00133    vector<RangeSens*> _hok;
00134    ProtrusionsExtr* _protrusionExtractor;
00135    
00136    CentralizedPHDFilterTaskOptions _options;
00137    
00138    // Define here the local variables of your task.
00139    int sensorNum;
00140    vector<PosiFeatures> _posiFeatures;
00141    vector<Pose> _sensorPose;
00142 
00143    map<int,Pose> _othersPose;
00144    vector<int> _othersPoseNums;
00145    map<int,Timer> _timeFromLastMessage;
00146    Timer _lastStepTime;
00147    
00148    // Define here the private methods of your task.
00149    void _draw();
00150    
00152    void communicate();
00153    
00154   public:
00156    CentralizedPHDFilterTask(ResourcePointers resources,int argc, const char* argv[]);
00157    
00159    ~CentralizedPHDFilterTask();
00160    
00163    TaskPlate getPlate() const {
00164     return _plate;
00165    }
00168    Time getMaxDuration(){
00169     return Time(_maxDurSec,_maxDurUsec);
00170    }
00173    Time getMaxSamplPeriod(){
00174     return Time(_maxSamplPeriodSec,_maxSamplPeriodUsec);
00175    }
00178    Time getMinSamplPeriod(){
00179     return Time(_minSamplPeriodSec,_minSamplPeriodUsec);
00180    }
00181    
00184    TaskOutputs run();
00185  };
00186  
00187  /* @} */
00188  
00189 };// end namespace MipTasks
00190 
00191 #endif
00192 
00193 
00194 
00195 
00196 

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