00001 #ifndef __SlamSelfLocatorSample_h_
00002 #define __SlamSelfLocatorSample_h_
00003
00004
00005 #include "Representations/Cognition/SampleSet.h"
00006 #include "Representations/Perception/LinesPercept.h"
00007 #include "Tools/Math/Pose2D.h"
00008 #include "Tools/Debugging/Debugging.h"
00009 #include "Platform/SystemCall.h"
00010
00011
00012
00013
00014
00015
00016 class SlamSelfLocatorSample : public PoseSample
00017 {
00018 public:
00019
00020 enum{
00021 UNINITIALIZED_PROBABILITY = 2,
00022 NO_PERCEPT_PROBABILITY = 3,
00023 PERCEPT_TTL_MS = 2000
00024 };
00025
00026 static double paramProbUpLimit,
00027 paramProbDownLimit,
00028 paramProbDelay;
00029
00030
00031
00032 enum PerceptType
00033 {
00034 xFieldLine,
00035 yFieldLine,
00036 flag,
00037 yellowGoal,
00038 skyblueGoal,
00039 lineCrossing,
00040 numberOfPerceptTypes
00041 };
00042
00043 Pose2D camera;
00044 double perceptProbabilities[numberOfPerceptTypes];
00045 long perceptTimestamps[numberOfPerceptTypes];
00046 SlamSelfLocatorSample* next;
00047
00048
00049
00050
00051 SlamSelfLocatorSample();
00052
00053
00054
00055
00056
00057 SlamSelfLocatorSample(const Pose2D& pose);
00058
00059 double getProbability() const {return probability;}
00060
00061
00062
00063
00064 void updateProbability();
00065
00066
00067
00068
00069
00070
00071 void updateProbability(const double* average);
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 void setPerceptProbability(SlamSelfLocatorSample::PerceptType type,double value);
00082
00083 bool isValid() const {return probability <= 1;}
00084 };
00085 #endif
00086
00087
00088