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 
00022 /**
00023 * @class WalkingEngineInterfaces
00024 *
00025 * The interfaces of the module WalkingEngine
00026 */
00027 class WalkingEngineInterfaces
00028 {
00029 public:
00030   /** Constructor */
00031   WalkingEngineInterfaces(
00032     const SensorDataBuffer& sensorDataBuffer,
00033     const InvKinWalkingParameters& invKinWalkingParameters,
00034     const GT2004Parameters& gt2004Parameters,
00035     const unsigned long& walkParameterTimeStamp,
00036     const bool& receivedNewSensorData,
00037     const MotionRequest::MotionID& lastMotionType,
00038     PIDData& pidData,
00039     OdometryData& odometryData,
00040     MotionInfo& motionInfo)
00041     : sensorDataBuffer(sensorDataBuffer),
00042     invKinWalkingParameters(invKinWalkingParameters),
00043     gt2004Parameters(gt2004Parameters),
00044     walkParameterTimeStamp(walkParameterTimeStamp),
00045     receivedNewSensorData(receivedNewSensorData),
00046     lastMotionType(lastMotionType),
00047     pidData(pidData),
00048     odometryData(odometryData),
00049     motionInfo(motionInfo)
00050   {}
00051 
00052 protected:
00053   /** The sensor data buffer containing all joint angles and others */
00054   const SensorDataBuffer& sensorDataBuffer;
00055   
00056   /** walking parameter sets to be used by the WalkingEngine, eg calculated by evolution behavior */
00057   const InvKinWalkingParameters& invKinWalkingParameters;
00058   const GT2004Parameters& gt2004Parameters;
00059   const unsigned long& walkParameterTimeStamp;
00060 
00061   /** Indicates that the Motion Process received a new SensorDataBuffer */
00062   const bool& receivedNewSensorData;
00063 
00064   /** The motion type of the previous frame */
00065   const MotionRequest::MotionID& lastMotionType;
00066   
00067   /** The current PID servo gains */
00068   PIDData& pidData;
00069   
00070   /** Has to be incremented by the walking engine */
00071   OdometryData& odometryData;
00072 
00073   /** The neck height and the body tilt to be estimated by the walking engine */
00074   MotionInfo& motionInfo;
00075 };
00076 
00077 /**
00078 * A generic class for walking engine modules.
00079 *
00080 * It generates JointData and OdometryData according to current MotionRequest
00081 * executing walking type motions.
00082 */
00083 class WalkingEngine : public Module, protected WalkingEngineInterfaces, protected RobotDimensions
00084 {
00085 public:
00086 /*
00087 * Constructor.
00088 * @param interfaces The paramters of the WalkingEngine module.
00089   */
00090   WalkingEngine(const WalkingEngineInterfaces& interfaces)
00091     : WalkingEngineInterfaces(interfaces),
00092       RobotDimensions(getRobotConfiguration().getRobotDimensions())
00093   {}
00094   
00095   /**
00096   * Calculates the next joint data set
00097   * @param jointData stores calculated frame
00098   * @param walkRequest The current motion request 
00099   * @param positionInWalkingCycle A request position for the walkcycle.
00100   * @return true if next set should be calculated by WalkingEngine
00101   *         false if change to other module can occur
00102   */
00103   virtual bool executeParameterized(JointData& jointData,
00104         const WalkRequest& walkRequest, double positionInWalkingCycle) = 0;
00105   
00106   /** Destructor */
00107   virtual ~WalkingEngine() {}
00108   
00109 private:
00110   /** That function is not used but has to be implemented */
00111   virtual void execute() {};
00112 };
00113 
00114 #endif //__WalkingEngine_h_
00115 
00116 /*
00117 * Change log :
00118 * 
00119 * $Log: WalkingEngine.h,v $
00120 * Revision 1.8  2004/09/09 10:15:55  spranger
00121 * fixed doxygen-errors
00122 *
00123 * Revision 1.7  2004/07/10 00:13:54  spranger
00124 * renaming for coderelease and preparations for gt2005
00125 *
00126 * Revision 1.6  2004/06/07 18:47:50  spranger
00127 * extended interface of executeParametrized by positionInWalkCycle
00128 *
00129 * Revision 1.5  2004/06/02 17:18:23  spranger
00130 * MotionRequest cleanup
00131 *
00132 * Revision 1.4  2004/05/27 09:29:28  loetzsch
00133 * removed executedMotionRequest from Interfaces
00134 *
00135 * Revision 1.3  2004/05/26 20:14:44  juengel
00136 * Removed RobotVerticesBuffer.
00137 * Added "receivedNewSensorData".
00138 *
00139 * Revision 1.2  2004/05/26 16:10:25  dueffert
00140 * better data types used
00141 *
00142 * Revision 1.1.1.1  2004/05/22 17:23:12  cvsadm
00143 * created new repository GT2004_WM
00144 *
00145 * Revision 1.6  2004/03/20 09:55:26  roefer
00146 * Preparation for improved odometry
00147 *
00148 * Revision 1.5  2004/03/08 02:29:50  roefer
00149 * Interfaces should be const
00150 *
00151 * Revision 1.4  2004/02/16 17:57:13  dueffert
00152 * packageCognitionMotion extended with invkin parameters
00153 *
00154 * Revision 1.3  2004/01/01 10:58:51  roefer
00155 * RobotDimensions are in a class now
00156 *
00157 * Revision 1.2  2003/12/10 16:52:53  roefer
00158 * Added sensor data buffer to walking engine
00159 *
00160 * Revision 1.1  2003/10/06 14:10:15  cvsadm
00161 * Created GT2004 (M.J.)
00162 *
00163 * Revision 1.2  2003/09/26 15:27:49  juengel
00164 * Renamed DataTypes to representations.
00165 *
00166 * Revision 1.1.1.1  2003/07/02 09:40:24  cvsadm
00167 * created new repository for the competitions in Padova from the 
00168 * tamara CVS (Tuesday 2:00 pm)
00169 *
00170 * removed unused solutions
00171 *
00172 * Revision 1.9  2003/03/06 12:08:45  dueffert
00173 * execute with parameters renamed to avoid inheritance warnings
00174 *
00175 * Revision 1.8  2003/01/23 16:44:10  risler
00176 * only one instance of InvKinWalkingEngine
00177 * parameter sets can now be switched while walking
00178 * added UNSWFastTurn, combining two parameter sets
00179 *
00180 * Revision 1.7  2002/11/20 18:02:28  risler
00181 * added PID values to GT2001MotionNetSpecialActions
00182 * added playDead motion
00183 *
00184 * Revision 1.6  2002/09/22 18:40:53  risler
00185 * added new math functions, removed GTMath library
00186 *
00187 * Revision 1.5  2002/09/17 23:55:22  loetzsch
00188 * - unraveled several datatypes
00189 * - changed the WATCH macro
00190 * - completed the process restructuring
00191 *
00192 * Revision 1.4  2002/09/12 13:17:27  loetzsch
00193 * made member variables of module interfaces protected
00194 *
00195 * Revision 1.3  2002/09/11 20:06:19  loetzsch
00196 * continued experiments with modules/solutions
00197 *
00198 * Revision 1.2  2002/09/11 00:06:59  loetzsch
00199 * continued change of module/solution mechanisms
00200 *
00201 * Revision 1.1  2002/09/10 15:36:16  cvsadm
00202 * Created new project GT2003 (M.L.)
00203 * - Cleaned up the /Src/DataTypes directory
00204 * - Removed challenge related source code
00205 * - Removed processing of incoming audio data
00206 * - Renamed AcousticMessage to SoundRequest
00207 *
00208 * Revision 1.4  2002/08/30 14:35:32  dueffert
00209 * removed unused includes
00210 *
00211 * Revision 1.3  2002/08/22 14:41:03  risler
00212 * added some doxygen comments
00213 *
00214 * Revision 1.2  2002/07/23 13:33:43  loetzsch
00215 * new streaming classes
00216 *
00217 * removed many #include statements
00218 *
00219 * Revision 1.1.1.1  2002/05/10 12:40:17  cvsadm
00220 * Moved GT2002 Project from ute to tamara.
00221 *
00222 * Revision 1.13  2002/04/29 13:48:20  risler
00223 * added lastWalkType to WalkingEngine execute
00224 *
00225 * Revision 1.12  2002/04/25 14:50:35  kallnik
00226 * changed double/float to double
00227 * added several #include GTMath
00228 *
00229 * PLEASE use double
00230 *
00231 * Revision 1.11  2002/04/16 16:39:54  dueffert
00232 * no message
00233 *
00234 * Revision 1.10  2002/04/15 13:39:23  rentmeister
00235 * DoWalkingEngine (Dortmunder WalkingEngine)
00236 *
00237 * Revision 1.9  2002/04/05 16:46:34  kosen
00238 * BremenGOWalkingEngine added
00239 *
00240 * Revision 1.8  2002/04/04 15:07:59  rentmeister
00241 * Walk with Ball hinzugefügt
00242 *
00243 * Revision 1.7  2002/04/03 16:44:30  jhoffman
00244 * added "stabilizeRobot" to motionControl (which is turned off as a default)
00245 *
00246 * Revision 1.6  2002/02/28 16:28:25  risler
00247 * added GT2001WalkingParameters
00248 *
00249 * Revision 1.5  2001/12/21 14:09:38  roefer
00250 * Added several destructors
00251 *
00252 * Revision 1.4  2001/12/10 17:47:07  risler
00253 * change log added
00254 *
00255 */

Generated on Thu Sep 23 19:57:34 2004 for GT2004 by doxygen 1.3.6