GMIDPHDUnicycle2DRCFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
00060 DMat N_n_x;
00061
00062
00064 DMat H;
00066 DMat N_n_z;
00067
00068
00071 Decimal truncThresh;
00073 int maxNumComponents;
00076 Decimal mergThresh;
00078 int partNumber;
00079
00080
00082 Decimal sensorDetectionRay;
00084 Decimal targetDimension;
00086 Decimal maxDetectionBearing;
00087
00089 bool useNewNoMeasWeight;
00090
00091
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