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
00026 #ifndef ARACTIONCOLORFOLLOW_H
00027 #define ARACTIONCOLORFOLLOW_H
00028
00029 #include "ariaTypedefs.h"
00030 #include "ariaUtil.h"
00031 #include "ArFunctor.h"
00032 #include "ArAction.h"
00033 #include "ArACTS.h"
00034 #include "ArPTZ.h"
00035
00038 class ArActionColorFollow : public ArAction
00039 {
00040
00041 public:
00042
00043 AREXPORT ArActionColorFollow(const char *name,
00044 ArACTS_1_2 *acts,
00045 ArPTZ *camera,
00046 double speed = 200,
00047 int width = 160,
00048 int height = 120);
00049
00050
00051 AREXPORT virtual ~ArActionColorFollow(void);
00052
00053
00054 AREXPORT virtual ArActionDesired *fire(ArActionDesired currentDesired);
00055
00056
00057 AREXPORT bool setChannel(int channel);
00058
00059
00060 AREXPORT void setCamera(ArPTZ *camera);
00061
00062
00063
00064 AREXPORT void setAcquire(bool acquire);
00065
00066
00067 AREXPORT void stopMovement(void);
00068
00069
00070 AREXPORT void startMovement(void);
00071
00072
00073 AREXPORT int getChannel();
00074
00075
00076
00077 AREXPORT bool getAcquire();
00078
00079
00080 AREXPORT bool getMovement();
00081
00082
00083 AREXPORT bool getBlob();
00084
00085
00086 enum TargetState
00087 {
00088 NO_TARGET,
00089 TARGET
00090 };
00091
00092
00093 enum MoveState
00094 {
00095 FOLLOWING,
00096 ACQUIRING,
00097 STOPPED
00098 };
00099
00100
00101 enum LocationState
00102 {
00103 LEFT,
00104 RIGHT,
00105 CENTER
00106 };
00107 AREXPORT virtual ArActionDesired *getDesired(void) { return &myDesired; }
00108 #ifndef SWIG
00109 AREXPORT virtual const ArActionDesired *getDesired(void) const
00110 { return &myDesired; }
00111 #endif
00112 protected:
00113 ArActionDesired myDesired;
00114 ArACTS_1_2 *myActs;
00115 ArPTZ *myCamera;
00116 ArTime myLastSeen;
00117 TargetState myState;
00118 MoveState myMove;
00119 LocationState myLocation;
00120 bool myAcquire;
00121 bool killMovement;
00122 int myChannel;
00123 int myMaxTime;
00124 int myHeight;
00125 int myWidth;
00126 double mySpeed;
00127 };
00128
00129
00130 #endif // ARACTIONCOLORFOLLOW_H