00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MovingEar_h_DEFINED
00013 #define MovingEar_h_DEFINED
00014
00015 #include <OPENR/OObject.h>
00016 #include <OPENR/OSubject.h>
00017 #include <OPENR/OObserver.h>
00018 #include "def.h"
00019
00020 enum MovingEarState {
00021 MES_IDLE,
00022 MES_START
00023 };
00024
00025 static const char* const EAR_LOCATOR[] = {
00026 "PRM:/r1/c1/c2/c3/e1-Joint3:j5",
00027 "PRM:/r1/c1/c2/c3/e2-Joint3:j6",
00028 };
00029
00030 class MovingEar : public OObject {
00031 public:
00032 MovingEar();
00033 virtual ~MovingEar() {}
00034
00035 OSubject* subject[numOfSubject];
00036 OObserver* observer[numOfObserver];
00037
00038 virtual OStatus DoInit (const OSystemEvent& event);
00039 virtual OStatus DoStart (const OSystemEvent& event);
00040 virtual OStatus DoStop (const OSystemEvent& event);
00041 virtual OStatus DoDestroy(const OSystemEvent& event);
00042
00043 void Ready(const OReadyEvent& event);
00044
00045 private:
00046 void OpenPrimitives();
00047 void NewCommandVectorData();
00048 void MoveEar();
00049
00050 static const size_t NUM_COMMAND_VECTOR = 2;
00051 static const size_t NUM_EARS = 2;
00052
00053 MovingEarState movingEarState;
00054 OPrimitiveID earID[NUM_EARS];
00055 RCRegion* region[NUM_COMMAND_VECTOR];
00056 };
00057
00058 #endif // MovingEar_h_DEFINED