00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __GT2005SelfLocatorSample_h_
00014 #define __GT2005SelfLocatorSample_h_
00015
00016
00017 #include "Representations/Cognition/SampleSet.h"
00018 #include "Representations/Perception/LinesPercept.h"
00019 #include "Tools/Math/Pose2D.h"
00020 #include "Tools/Debugging/Debugging.h"
00021 #include "Platform/SystemCall.h"
00022 #include "GT2005SelfLocatorParameters.h"
00023
00024
00025
00026
00027 class GT2005SelfLocatorSample : public PoseSample
00028 {
00029 public:
00030
00031 enum{
00032 UNINITIALIZED_PROBABILITY = 2
00033 };
00034
00035
00036
00037 enum PerceptType
00038 {
00039 xFieldLine,
00040 yFieldLine,
00041 border,
00042 flag,
00043 goal,
00044 lineCrossing,
00045 numberOfPerceptTypes
00046 };
00047
00048 Pose2D camera;
00049 double perceptProbabilities[numberOfPerceptTypes];
00050 long perceptTimestamps[numberOfPerceptTypes];
00051 GT2005SelfLocatorSample* next;
00052 bool isUsingOdometry;
00053
00054
00055
00056
00057 GT2005SelfLocatorSample();
00058
00059
00060
00061
00062
00063 GT2005SelfLocatorSample(const Pose2D& pose);
00064
00065 double getProbability() const {return probability;}
00066
00067 void reset();
00068
00069
00070
00071
00072
00073 void updateProbability(const double* average, const GT2005SelfLocatorParameters& parameters);
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 void setPerceptProbability(GT2005SelfLocatorSample::PerceptType type,double value, const GT2005SelfLocatorParameters& parameters);
00084
00085 bool isValid() const {return probability <= 1;}
00086
00087 void scaleProbabilities(double factor);
00088 };
00089
00090
00091
00092
00093 In& operator>>(In& stream,GT2005SelfLocatorSample& sample);
00094
00095
00096
00097
00098 Out& operator<<(Out& stream, const GT2005SelfLocatorSample& sample);
00099
00100 #endif
00101
00102
00103