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

# Modules/WalkingEngine/WalkingEngine.h

Go to the documentation of this file.

    00001 /**
    00002 * @file WalkingEngine.h
    00003 *
    00004 * Definition of class WalkingEngine
    00005 */
    00006
    00007 #ifndef __WalkingEngine_h_
    00008 #define __WalkingEngine_h_
    00009
    00010 #include "Tools/Module/Module.h"
    00011 #include "Tools/RobotConfiguration.h"
    00012
    00013 #include "Representations/Motion/JointData.h"
    00014 #include "Representations/Motion/PIDData.h"
    00015 #include "Representations/Perception/SensorDataBuffer.h"
    00016 #include "Representations/Motion/OdometryData.h"
    00017 #include "Representations/Motion/MotionInfo.h"
    00018
    00019 #include "InvKinWalkingParameters.h"
    00020 #include "GT2004ParameterSet.h"
    00021 //****for GT2005WalkingEngine****
    00022 #include "GT2005Parameters.h"
    00023 #include "GT2005DebugData.h"
    00024
    00025 /**
    00026 * @class WalkingEngineInterfaces
    00027 *
    00028 * The interfaces of the module WalkingEngine
    00029 */
    00030 class WalkingEngineInterfaces
    00031 {
    00032 public:
    00033   /** Constructor */
    00034   WalkingEngineInterfaces(
    00035     const SensorDataBuffer& sensorDataBuffer,
    00036     const InvKinWalkingParameters& invKinWalkingParameters,
    00037     const GT2004Parameters& gt2004Parameters,
    00038     const unsigned long& walkParameterTimeStamp,
    00039     const bool& receivedNewSensorData,
    00040     const MotionRequest::MotionID& lastMotionType,
    00041     PIDData& pidData,
    00042     OdometryData& odometryData,
    00043     MotionInfo& motionInfo,
    00044   //****for GT2005WalkingEngine****
    00045   GTWalkParametersIndividual& gt2005Parameters,
    00046   GT2005DebugData& gt2005DebugData)
    00047     : sensorDataBuffer(sensorDataBuffer),
    00048     invKinWalkingParameters(invKinWalkingParameters),
    00049     gt2004Parameters(gt2004Parameters),
    00050     walkParameterTimeStamp(walkParameterTimeStamp),
    00051     receivedNewSensorData(receivedNewSensorData),
    00052     lastMotionType(lastMotionType),
    00053     pidData(pidData),
    00054     odometryData(odometryData),
    00055     motionInfo(motionInfo),
    00056   //****for GT2005WalkingEngine****
    00057   gt2005Parameters(gt2005Parameters),
    00058   gt2005DebugData(gt2005DebugData)
    00059   {}
    00060
    00061 protected:
    00062   /** The sensor data buffer containing all joint angles and others */
    00063   const SensorDataBuffer& sensorDataBuffer;
    00064
    00065   /** walking parameter sets to be used by the WalkingEngine, eg calculated by evolution behavior */
    00066   const InvKinWalkingParameters& invKinWalkingParameters;
    00067   const GT2004Parameters& gt2004Parameters;
    00068   const unsigned long& walkParameterTimeStamp;
    00069
    00070   /** Indicates that the Motion Process received a new SensorDataBuffer */
    00071   const bool& receivedNewSensorData;
    00072
    00073   /** The motion type of the previous frame */
    00074   const MotionRequest::MotionID& lastMotionType;
    00075
    00076   /** The current PID servo gains */
    00077   PIDData& pidData;
    00078
    00079   /** Has to be incremented by the walking engine */
    00080   OdometryData& odometryData;
    00081
    00082   /** The neck height and the body tilt to be estimated by the walking engine */
    00083   MotionInfo& motionInfo;
    00084
    00085   //****for GT2005WalkingEngine****
    00086   GTWalkParametersIndividual& gt2005Parameters;
    00087   GT2005DebugData& gt2005DebugData;
    00088 };
    00089
    00090 /**
    00091 * A generic class for walking engine modules.
    00092 *
    00093 * It generates JointData and OdometryData according to current MotionRequest
    00094 * executing walking type motions.
    00095 */
    00096 class WalkingEngine : public Module, protected WalkingEngineInterfaces, protected RobotDimensions
    00097 {
    00098 public:
    00099 /*
    00100 * Constructor.
    00101 * @param interfaces The paramters of the WalkingEngine module.
    00102   */
    00103   WalkingEngine(const WalkingEngineInterfaces& interfaces)
    00104     : WalkingEngineInterfaces(interfaces),
    00105       RobotDimensions(getRobotConfiguration().getRobotDimensions())
    00106   {}
    00107
    00108   /**
    00109   * Calculates the next joint data set
    00110   * @param jointData stores calculated frame
    00111   * @param walkRequest The current motion request
    00112   * @param positionInWalkingCycle A request position for the walkcycle.
    00113   * @return true if next set should be calculated by WalkingEngine
    00114   *         false if change to other module can occur
    00115   */
    00116   virtual bool executeParameterized(JointData& jointData,
    00117         const WalkRequest& walkRequest, double positionInWalkingCycle) = 0;
    00118
    00119   /** Destructor */
    00120   virtual ~WalkingEngine() {}
    00121
    00122 private:
    00123   /** That function is not used but has to be implemented */
    00124   virtual void execute() {};
    00125 };
    00126
    00127 #endif //__WalkingEngine_h_