00001 /** 00002 * @file GT2004GetupEngine.h 00003 * 00004 * Definition of class GT2004GetupEngine 00005 * 00006 * @author Max Risler 00007 */ 00008 00009 #ifndef __GT2004GetupEngine_h__ 00010 #define __GT2004GetupEngine_h__ 00011 00012 #include "GetupEngine.h" 00013 #include "Tools/Actorics/JointDataSequencer.h" 00014 00015 /** angles above which getup engine will take action 00016 * @attention adjust the angles to values in SensorDataProcessor 00017 */ 00018 const double gt2004GetupEngineFalldownTiltAngle = fromDegrees(50); 00019 const double gt2004GetupEngineFalldownRollAngle = fromDegrees(35); 00020 const double gt2004GetupEngineRollOnWallAngle = fromDegrees(17); 00021 00022 const double gt2004GetupEngineFalldownTiltAngle7 = fromDegrees(50); 00023 const double gt2004GetupEngineFalldownTiltAngleBack7 = fromDegrees(-20); 00024 const double gt2004GetupEngineFalldownRollAngle7 = fromDegrees(35); 00025 const double gt2004GetupEngineRollOnWallAngle7 = fromDegrees(20); 00026 00027 /** 00028 * The GT2004 getup engine. 00029 * 00030 * It executes different JointDataSequences for different body roll angles. 00031 * Body roll angle is determined by current acceleration sensor values. 00032 */ 00033 class GT2004GetupEngine : public GetupEngine 00034 { 00035 public: 00036 /** Constructor */ 00037 GT2004GetupEngine(const GetupEngineInterfaces& interfaces); 00038 00039 /** Executes the engine */ 00040 virtual bool executeParameterized(JointData& jointData); 00041 00042 protected: 00043 00044 /** the JointDataSequencer */ 00045 JointDataSequencer sequencer; 00046 00047 /** current state */ 00048 enum { 00049 unknown, 00050 leftSideDown, 00051 rightSideDown, 00052 getupFromUpright, 00053 standing, 00054 rollRight, 00055 rollLeft, 00056 //makeRoll, 00057 //sittingUpright, 00058 numOfStates 00059 } state,lastState; 00060 00061 00062 /** current state for ERS 7*/ 00063 /* enum { 00064 unknown7, 00065 leftSideDown7, 00066 rightSideDown7, 00067 getupFromUpright7, 00068 standing7, 00069 makeRoll7, 00070 sittingUpright7, 00071 numOfStates7 00072 } stateERS7,lastStateERS7; 00073 00074 */ 00075 /** joint data sequence executed in each state */ 00076 JointDataSequence sequence[numOfStates]; 00077 00078 /** joint data sequence executed in each state for ERS 7 */ 00079 JointDataSequence sequenceERS7[numOfStates]; 00080 00081 unsigned long stateStartTime; 00082 unsigned long lastGetupTime; 00083 int countTry; 00084 }; 00085 00086 #endif // __GT2004GetupEngine_h__ 00087 00088 /* 00089 * Change log : 00090 * 00091 * $Log: GT2004GetupEngine.h,v $ 00092 * Revision 1.1 2004/07/10 00:18:29 spranger 00093 * renamed (readded) for coderelease 00094 * 00095 * Revision 1.1.1.1 2004/05/22 17:19:10 cvsadm 00096 * created new repository GT2004_WM 00097 * 00098 * Revision 1.10 2004/04/09 11:35:51 roefer 00099 * Bremen Byters German Open check-in 00100 * 00101 * Revision 1.9 2004/04/08 15:33:05 wachter 00102 * GT04 checkin of Microsoft-Hellounds 00103 * 00104 * Revision 1.8 2004/03/08 01:38:52 roefer 00105 * Interfaces should be const 00106 * 00107 * Revision 1.7 2004/02/29 14:57:37 roefer 00108 * Removed static variable, initialized state, added support for robot with broken acceleration sensors 00109 * 00110 * Revision 1.6 2004/02/27 20:32:09 brueckne 00111 * comment by heinze: getup-engine works for all common cases, specials aren't included yet 00112 * 00113 * Revision 1.5 2004/02/27 17:15:40 heinze 00114 * improved getup-behavior for ERS7 00115 * 00116 * Revision 1.4 2004/02/26 11:47:28 heinze 00117 * bug removed 00118 * 00119 * Revision 1.3 2004/02/26 10:55:43 heinze 00120 * added states to enum for ERS7 00121 * 00122 * Revision 1.2 2004/02/25 16:03:51 heinze 00123 * added/began getup-motion for ERS7 00124 * 00125 * Revision 1.1 2003/10/06 14:10:14 cvsadm 00126 * Created GT2004 (M.J.) 00127 * 00128 * Revision 1.2 2003/09/26 11:38:51 juengel 00129 * - sorted tools 00130 * - clean-up in DataTypes 00131 * 00132 * Revision 1.1.1.1 2003/07/02 09:40:23 cvsadm 00133 * created new repository for the competitions in Padova from the 00134 * tamara CVS (Tuesday 2:00 pm) 00135 * 00136 * removed unused solutions 00137 * 00138 * Revision 1.7 2003/06/20 15:32:32 dueffert 00139 * getting from down from wall by rolling added 00140 * 00141 * Revision 1.6 2003/06/19 15:53:40 dueffert 00142 * rolling if stuck added, beautified 00143 * 00144 * Revision 1.5 2003/06/18 18:12:11 dueffert 00145 * getup stuck recognition added 00146 * 00147 * Revision 1.4 2003/03/06 12:05:43 dueffert 00148 * execute with parameters renamed to avoid inheritance warnings 00149 * 00150 * Revision 1.3 2002/09/22 18:40:53 risler 00151 * added new math functions, removed GTMath library 00152 * 00153 * Revision 1.2 2002/09/11 00:06:58 loetzsch 00154 * continued change of module/solution mechanisms 00155 * 00156 * Revision 1.1 2002/09/10 15:36:14 cvsadm 00157 * Created new project GT2003 (M.L.) 00158 * - Cleaned up the /Src/DataTypes directory 00159 * - Removed challenge related source code 00160 * - Removed processing of incoming audio data 00161 * - Renamed AcousticMessage to SoundRequest 00162 * 00163 * Revision 1.2 2002/08/22 14:41:04 risler 00164 * added some doxygen comments 00165 * 00166 * Revision 1.1.1.1 2002/05/10 12:40:14 cvsadm 00167 * Moved GT2002 Project from ute to tamara. 00168 * 00169 * Revision 1.4 2002/04/17 17:04:41 risler 00170 * Darmstadt GO 00171 * 00172 * Revision 1.3 2002/02/23 17:07:22 risler 00173 * code cleaned up 00174 * 00175 * Revision 1.2 2002/02/23 16:33:07 risler 00176 * finished GetupEngine 00177 * 00178 * Revision 1.1 2002/02/20 16:40:50 risler 00179 * added GetupEngine 00180 * 00181 * 00182 */