PHDFilter.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
00029
00036
00037 #ifndef __PHD_FILTER_H
00038 #define __PHD_FILTER_H
00039
00040 #include <Spaces.h>
00041 #include <SimTime.h>
00042 #include <SpacesArma.h>
00043 #include <armadillo>
00044 #include <math.h>
00045 #include <LogTrace.h>
00046 #include <GaussianMixture.h>
00047
00048 using namespace MipBaselib;
00049 using namespace arma;
00050
00051 namespace MipAlgorithms{
00052
00054
00055
00058 enum PHDFilterType{
00059 GM_LINEAR_NO_ID,
00060 GM_UNICYCLE_2D_ID,
00061 GM_UNICYCLE_2D_ID_RC,
00062 GM_UNICYCLE_2D_ID_COOP,
00063 GM_UNICYCLE_2D_ID_COOP_2,
00064 GM_UNICYCLE_2D_ID_RC_COOP,
00065 GM_UNICYCLE_2D_ID_3_COOP,
00066 GM_UNICYCLE_2D_ID_4_COOP,
00067 GM_UNICYCLE_2D_ID_CENTR,
00068 GM_UNICYCLE_2D_NO_ID,
00069 GM_UNICYCLE_2D_ID_RC_CAM,
00070 NO_PHD_EKF_ONLY,
00071 GMID_PHD_UNYCYCLE_2D_RC,
00072 PHD_FILTER_TYPE_NUM
00073 };
00074
00079 static const char* PHDFilterTypeName[PHD_FILTER_TYPE_NUM] ={
00080 "GMLinearNoId",
00081 "GMUnicycle2DId",
00082 "GMUnicycle2DIdRoboCentric",
00083 "GMUnicycle2DIdCoop",
00084 "GMUnicycle2DIdCoop2",
00085 "GMUnicycle2DIdRoboCentricCoop",
00086 "GMUnicycle2DId3Coop",
00087 "GMUnicycle2DId4Coop",
00088 "GMUnicycle2DIdCentr",
00089 "GMUnicycle2DNoId",
00090 "GMUnicycle2DIdRoboCentricCam",
00091 "NoPHD:EKFOnly",
00092 "GMIDUnicycle2DRC"
00093 };
00094
00097 enum PHDFilterOutputType{
00098 PHD_OUT_NULL,
00099 PHD_OUT_GM,
00100 PHD_OUT_GMJID,
00101 PHD_OUT_GMID,
00102 PHD_FILTER_OUTPUT_TYPE_NUM
00103 };
00104
00105
00106
00110 class PHDFilterIn{
00111 public:
00112 Pose myPose;
00113 vector<Position> measures;
00114 vector< vector <Position> > otherMeasures;
00115 vector< int > otherIds;
00116
00117 vector<Pose> hisPose;
00118 vector<int> hisId;
00119
00120
00121
00122 Decimal height;
00123
00124 vector<Position2DArma> measuresCam;
00125
00126 Angle roll;
00127 Angle pitch;
00128 Angle yaw;
00129
00130 Odometry3DTimeArma myOdom;
00131 };
00132
00133
00137 class PHDFilterPars {
00138 public:
00139
00140 Decimal pSurvival;
00141
00142 Decimal pDetection;
00143
00144 SimTime timeBetweenUpdates;
00145
00147 PHDFilterPars();
00148
00151 PHDFilterPars(Decimal pS, Decimal pD, SimTime t);
00152 };
00153
00154
00158 class PHDFilterVars {
00159 public:
00160 bool _firstStep;
00161 SimTimer _timeFromLastUpdate;
00162
00163 SimTimer _timeFromLastPrediction;
00164
00165 PHDFilterVars();
00166 };
00167
00168
00172 class PHDFilter : public MIPObject{
00173 protected:
00174 PHDFilterVars* _vars;
00175 PHDFilterPars* _pars;
00176 public:
00177 PHDFilter();
00178
00179 PHDFilter(PHDFilterPars inParams);
00180
00181 virtual void step(PHDFilterIn &in)=0;
00182
00183 virtual string print()=0;
00184
00185 virtual PHDFilterOutputType getOutputType()=0;
00186
00187 virtual void getBelief(GaussianMixtureJointId &gm){}
00188
00189 virtual void getBelief(GaussianMixture &gm){}
00190
00191 virtual void getBelief(GaussianMixtureID &gm){}
00192
00193 protected:
00194
00195 virtual void _initialize(PHDFilterIn &in)=0;
00196 virtual void _normalStep(PHDFilterIn &in)=0;
00197 };
00198
00199
00200
00201 }
00202
00203
00204 #endif
00205
00206
00207
00208
00209
00210
00211
00212