00001
00002
00003
00004
00005
00006
00007 #ifndef __GT2005MotionControl_h_
00008 #define __GT2005MotionControl_h_
00009
00010 #include "MotionControl.h"
00011
00012 #include "WakeUpEngine.h"
00013
00014 #include "MotionStabilizer.h"
00015
00016 #include "Modules/WalkingEngine/WalkingEngine.h"
00017 #include "Modules/SpecialActions/SpecialActions.h"
00018 #include "Modules/GetupEngine/GetupEngineSelector.h"
00019
00020 #include "Modules/WalkingEngine/InvKinWalkingEngine.h"
00021
00022 #include "Tools/Module/ModuleHandler.h"
00023
00024
00025
00026
00027
00028
00029
00030
00031 class GT2005MotionControl : public MotionControl, public MotionStabilizer
00032 {
00033 public:
00034
00035
00036
00037
00038
00039 GT2005MotionControl(ModuleHandler& moduleHandler,
00040 const MotionControlInterfaces& interfaces);
00041
00042
00043 ~GT2005MotionControl();
00044
00045
00046 virtual void execute();
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 virtual bool handleMessage(InMessage& message);
00057
00058 protected:
00059
00060 void determineMotionControlState();
00061
00062
00063 void setMotionControlState();
00064
00065
00066
00067
00068
00069 MotionRequest::MotionID lastMotionType;
00070
00071
00072 WalkingEngine *pWalkingEngine[WalkRequest::numOfWalkType];
00073
00074
00075 SpecialActions *pSpecialActions;
00076
00077
00078 GetupEngineSelector *pGetupEngine;
00079
00080
00081
00082
00083
00084 InvKinWalkingEngine *pInvKinWalkingEngine;
00085
00086
00087
00088
00089
00090 ModuleHandler& moduleHandler;
00091
00092
00093 int tailCount;
00094
00095 long lastHeadTilt,
00096 lastHeadPan,
00097 lastHeadRoll;
00098
00099
00100 void wagTail(
00101 const MotionRequest& motionRequest,
00102 const SensorData& sensorData,
00103 JointData& jointData
00104 );
00105
00106 WakeUpEngine wakeUpEngine;
00107
00108 bool wakingUp;
00109
00110
00111 bool changeOfMotionControlStatePossible;
00112
00113
00114 double positionInWalkCycle;
00115
00116
00117 WalkRequest latestWalkRequest;
00118
00119
00120 SpecialActionRequest latestSpecialActionRequest;
00121
00122
00123 enum{
00124 stand,
00125 walk,
00126 specialAction,
00127 getup,
00128 wakeUp,
00129 playDead
00130 } motionControlState;
00131 };
00132
00133 #endif// __GT2005MotionControl_h_