Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Modules/GetupEngine/GT2005GetupEngine.h

Go to the documentation of this file.

    00001 /**
    00002 * @file GT2005GetupEngine.h
    00003 *
    00004 * Definition of class GT2005GetupEngine
    00005 *
    00006 * @author Max Risler
    00007 */
    00008
    00009 #ifndef __GT2005GetupEngine_h__
    00010 #define __GT2005GetupEngine_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 gt2005GetupEngineFalldownTiltAngle = fromDegrees(50);
    00019 const double gt2005GetupEngineFalldownRollAngle = fromDegrees(35);
    00020 const double gt2005GetupEngineRollOnWallAngle = fromDegrees(17);
    00021
    00022 const double gt2005GetupEngineFalldownTiltAngle7 = fromDegrees(50);
    00023 const double gt2005GetupEngineFalldownTiltAngleBack7 = fromDegrees(-20);
    00024 const double gt2005GetupEngineFalldownRollAngle7 = fromDegrees(35);
    00025 const double gt2005GetupEngineRollOnWallAngle7 = fromDegrees(20);
    00026
    00027 /**
    00028 * The GT2005 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 GT2005GetupEngine : public GetupEngine
    00034 {
    00035 public:
    00036   /** Constructor */
    00037   GT2005GetupEngine(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 // __GT2005GetupEngine_h__