00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __SimpleMotionRecognition_h_
00011 #define __SimpleMotionRecognition_h_
00012
00013 #include "Modules/SensorBehaviorControl/SensorBehaviorControl.h"
00014 #include "Tools/Debugging/DebugDrawings.h"
00015 #include "Tools/Math/Geometry.h"
00016 #include "Tools/Debugging/DebugImages.h"
00017 #include "Tools/Actorics/RobotDimensions.h"
00018
00019 #define SIMPLEIMAGEBUFFERSIZE 3
00020 #define MINDIFF 30
00021 #define WAITCONST 28
00022 #define WAITMIN 17
00023 #define SPEEDFAKTOR Vector2<int>(2,1)
00024 #define RESETCONST 40
00025
00026
00027
00028
00029
00030
00031
00032
00033 class SimpleMotionRecognition : public SensorBehaviorControl
00034 {
00035 public:
00036
00037
00038
00039
00040 SimpleMotionRecognition(const SensorBehaviorControlInterfaces& interfaces);
00041
00042
00043 int searchTilt();
00044 int searchPan();
00045 bool headIsNotInMotion();
00046 Vector2<long> getAngleYZ(Vector2<int> point);
00047 Vector2<int> *getMotion();
00048
00049
00050 virtual void execute();
00051 virtual bool handleMessage(InMessage& message);
00052
00053 private:
00054 CameraMatrix previousCameraMatrix;
00055 Image imageBuffer[SIMPLEIMAGEBUFFERSIZE];
00056 int start, currentImage, imagesLeft, wait, reset, frameDiff,searchStatus,
00057 halfCameraResolutionHeigth, halfCameraResolutionWidth;
00058 double halfCameraOpeningAngleHeigth, halfCameraOpeningAngleWidth;
00059 Vector2<int> *motion;
00060 Vector2<long> newHeadPos;
00061 };
00062 #endif// __SimpleMotionRecognition_h_
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086