00001
00002
00003
00004
00005
00006
00007 #ifndef __BodyPercept_h_
00008 #define __BodyPercept_h_
00009
00010
00011 #include "Tools/Streams/InOut.h"
00012 #include "Tools/Math/Vector3.h"
00013
00014
00015
00016
00017
00018
00019 class BodyPercept
00020 {
00021 public:
00022
00023 enum States { undefined, standing, crashed, rollLeft, rollRight, pickedUp };
00024
00025
00026
00027 enum Switches {
00028 backMiddle = 0,
00029 backFront,
00030 backBack,
00031 head,
00032 mouth,
00033 chin,
00034 numOfSwitches};
00035
00036 enum MouthStates { mouthOpen, mouthClosed };
00037
00038 Vector3<double> acceleration;
00039
00040 BodyPercept();
00041 ~BodyPercept();
00042
00043
00044 unsigned long frameNumber;
00045
00046
00047
00048
00049 void setFrameNumber(unsigned long frameNumber) {this->frameNumber = frameNumber;}
00050
00051 void setState(const States s) {state = s;}
00052 States getState() const {return state;}
00053
00054 void setSwitches(const int s) {switches = s;}
00055 int getSwitches() const {return switches;}
00056
00057 void setMouthState(const MouthStates t) {mouthState = t;}
00058 MouthStates getMouthState() const {return mouthState;}
00059
00060 void setBodyPSDHighValue(bool value) {bodyPSDHighValue = value;}
00061 bool getBodyPSDHighValue() const {return bodyPSDHighValue;}
00062
00063 void setBodyPSDDistance(double value) {bodyPSDDistance = value;}
00064 double getBodyPSDDistance() const {return bodyPSDDistance;}
00065
00066
00067 void operator = (const BodyPercept& other);
00068
00069 static const char* getStateName(States s)
00070 {
00071 switch (s)
00072 {
00073 case undefined: return "undefined";
00074 case standing: return "standing";
00075 case crashed: return "crashed";
00076 case rollLeft: return "rollLeft";
00077 case rollRight: return "rollRight";
00078 case pickedUp: return "pickedUp";
00079 default: return "please edit BodyPercept::getStateName";
00080 }
00081 }
00082
00083 private:
00084
00085
00086
00087
00088
00089 States state;
00090
00091
00092 int switches;
00093
00094
00095 MouthStates mouthState;
00096
00097
00098
00099 bool bodyPSDHighValue;
00100
00101
00102 double bodyPSDDistance;
00103 };
00104
00105
00106
00107
00108
00109
00110
00111 In& operator>>(In& stream,BodyPercept& bodyPercept);
00112
00113
00114
00115
00116
00117
00118
00119 Out& operator<<(Out& stream, const BodyPercept& bodyPercept);
00120
00121
00122 #endif //__BodyPercept_h_