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

Modules/MotionControl/MotionControl.h

Go to the documentation of this file.
00001 /**
00002 * @file MotionControl.h
00003 * 
00004 * Definition of class MotionControl.
00005 */
00006 
00007 #ifndef __MotionControl_h_
00008 #define __MotionControl_h_
00009 
00010 #include "Tools/Module/Module.h"
00011 
00012 #include "Representations/Motion/HeadMotionRequest.h"
00013 #include "Representations/Motion/JointDataBuffer.h"
00014 #include "Representations/Motion/PIDData.h"
00015 #include "Representations/Motion/OdometryData.h"
00016 #include "Representations/Motion/MotionInfo.h"
00017 
00018 #include "Representations/Perception/SensorDataBuffer.h"
00019 #include "Representations/Perception/BodyPosture.h"
00020 
00021 #include "Modules/WalkingEngine/GT2004ParameterSet.h"
00022 
00023 #ifdef _WIN32
00024 #pragma warning(disable:4786) 
00025 // the constructor with all it's long parameter type names results in a too
00026 // long debug identifier
00027 #endif
00028 
00029 /**
00030 * @class MotionControlInterfaces
00031 *
00032 * The interfaces of the MotionControl module.
00033 */
00034 class MotionControlInterfaces
00035 {
00036 public:
00037   /** Constructor */ 
00038   MotionControlInterfaces(
00039     const unsigned long& frameNumber,
00040     const MotionRequest& motionRequest, 
00041     const HeadMotionRequest& headMotionRequest,
00042     const SensorDataBuffer& sensorDataBuffer,
00043     const BodyPosture& bodyPosture,
00044     const InvKinWalkingParameters& invKinWalkingParameters,
00045     const GT2004Parameters& gt2004Parameters,
00046     const unsigned long& walkParameterTimeStamp,
00047     const bool& receivedNewSensorData,
00048     JointDataBuffer& jointDataBuffer, 
00049     PIDData& pidData,
00050     OdometryData& odometryData,
00051     MotionInfo& motionInfo,
00052     bool headIsBlockedBySpecialActionOrWalk)
00053     :
00054     frameNumber(frameNumber),
00055     motionRequest(motionRequest),
00056     headMotionRequest(headMotionRequest),
00057     sensorDataBuffer(sensorDataBuffer),
00058     bodyPosture(bodyPosture),
00059     invKinWalkingParameters(invKinWalkingParameters),
00060     gt2004Parameters(gt2004Parameters),
00061     walkParameterTimeStamp(walkParameterTimeStamp),
00062     receivedNewSensorData(receivedNewSensorData),
00063     jointDataBuffer(jointDataBuffer),
00064     pidData(pidData),
00065     odometryData(odometryData),
00066     motionInfo(motionInfo),
00067     headIsBlockedBySpecialActionOrWalk(headIsBlockedBySpecialActionOrWalk)
00068 {}
00069 
00070 protected:  
00071   /** A reference to the frame number */
00072   const unsigned long& frameNumber;
00073 
00074   /** A request from the behavior control */  
00075   const MotionRequest& motionRequest;
00076   
00077   /** Head joint values from the head control */
00078   const HeadMotionRequest& headMotionRequest;
00079   
00080   /** The current body sensor data */
00081   const SensorDataBuffer& sensorDataBuffer;
00082   
00083   /** The current body posture */
00084   const BodyPosture& bodyPosture;
00085   
00086   /** walking parameter sets to be used by the WalkingEngine, eg calculated by evolution behavior */
00087   const InvKinWalkingParameters& invKinWalkingParameters;
00088   const GT2004Parameters& gt2004Parameters;
00089   const unsigned long& walkParameterTimeStamp;
00090 
00091   /** Indicates that the Motion Process received a new SensorDataBuffer */
00092   const bool& receivedNewSensorData;
00093   
00094   /** A buffer of joint data to be filled */
00095   JointDataBuffer& jointDataBuffer;
00096 
00097   /** The current PID servo gains */
00098   PIDData& pidData;
00099   
00100   /** The odometry to be incremented */
00101   OdometryData& odometryData;
00102 
00103   /** The height of the neck and the body tilt to be calculated */
00104   MotionInfo& motionInfo;
00105 
00106   /** Specifies if the head is blocked by a special action or walk.*/
00107   bool headIsBlockedBySpecialActionOrWalk;
00108 };
00109 
00110 /** 
00111 * @class MotionControl
00112 *
00113 * A generic class for motion control modules.
00114 * MotionControl is responsible for setting values for the joints of the robot 
00115 */
00116 class MotionControl : public Module, public MotionControlInterfaces, public RobotDimensions
00117 {
00118 public:
00119 /*
00120 * Constructor.
00121 * @param interfaces The paramters of the MotionControl module.
00122   */
00123   MotionControl(const MotionControlInterfaces& interfaces)
00124     : MotionControlInterfaces(interfaces),
00125       RobotDimensions(getRobotConfiguration().getRobotDimensions())
00126   {}
00127   
00128   /** Destructor */
00129   virtual ~MotionControl() {}
00130 };
00131 
00132 #endif //__MotionControl_h_
00133 
00134 /*
00135 * Change log :
00136 * 
00137 * $Log: MotionControl.h,v $
00138 * Revision 1.7  2004/07/10 00:13:51  spranger
00139 * renaming for coderelease and preparations for gt2005
00140 *
00141 * Revision 1.6  2004/06/08 15:30:53  juengel
00142 * Added frameNumber to the interfaces.
00143 *
00144 * Revision 1.5  2004/05/27 09:29:28  loetzsch
00145 * removed executedMotionRequest from Interfaces
00146 *
00147 * Revision 1.4  2004/05/26 20:14:44  juengel
00148 * Removed RobotVerticesBuffer.
00149 * Added "receivedNewSensorData".
00150 *
00151 * Revision 1.3  2004/05/26 17:31:34  dueffert
00152 * better data types used
00153 *
00154 * Revision 1.2  2004/05/26 16:10:24  dueffert
00155 * better data types used
00156 *
00157 * Revision 1.1.1.1  2004/05/22 17:20:37  cvsadm
00158 * created new repository GT2004_WM
00159 *
00160 * Revision 1.5  2004/03/20 09:55:25  roefer
00161 * Preparation for improved odometry
00162 *
00163 * Revision 1.4  2004/03/08 01:39:03  roefer
00164 * Interfaces should be const
00165 *
00166 * Revision 1.3  2004/02/16 18:02:01  dueffert
00167 * packageCognitionMotion extended with invkin parameters
00168 *
00169 * Revision 1.2  2004/01/05 11:34:44  juengel
00170 * RobotDimensions is Base of MotionControl now.
00171 *
00172 * Revision 1.1  2003/10/06 14:10:13  cvsadm
00173 * Created GT2004 (M.J.)
00174 *
00175 * Revision 1.2  2003/09/26 15:27:49  juengel
00176 * Renamed DataTypes to representations.
00177 *
00178 * Revision 1.1.1.1  2003/07/02 09:40:24  cvsadm
00179 * created new repository for the competitions in Padova from the 
00180 * tamara CVS (Tuesday 2:00 pm)
00181 *
00182 * removed unused solutions
00183 *
00184 * Revision 1.8  2003/05/27 16:15:52  juengel
00185 * Added headIsBlockedBySpecialActionOrWalk.
00186 *
00187 * Revision 1.7  2003/05/02 18:26:18  risler
00188 * SensorDataBuffer added
00189 * replaced SensorData with SensorDataBuffer
00190 * full SensorData resolution now accessible
00191 *
00192 * Revision 1.6  2002/11/19 17:13:21  risler
00193 * added datatype PIDData
00194 * support for sending new pid values at runtime
00195 *
00196 * Revision 1.5  2002/09/17 23:55:21  loetzsch
00197 * - unraveled several datatypes
00198 * - changed the WATCH macro
00199 * - completed the process restructuring
00200 *
00201 * Revision 1.4  2002/09/12 13:17:27  loetzsch
00202 * made member variables of module interfaces protected
00203 *
00204 * Revision 1.3  2002/09/11 20:06:19  loetzsch
00205 * continued experiments with modules/solutions
00206 *
00207 * Revision 1.2  2002/09/11 00:06:58  loetzsch
00208 * continued change of module/solution mechanisms
00209 *
00210 * Revision 1.1  2002/09/10 15:36:15  cvsadm
00211 * Created new project GT2003 (M.L.)
00212 * - Cleaned up the /Src/DataTypes directory
00213 * - Removed challenge related source code
00214 * - Removed processing of incoming audio data
00215 * - Renamed AcousticMessage to SoundRequest
00216 *
00217 * Revision 1.2  2002/07/23 13:33:42  loetzsch
00218 * new streaming classes
00219 *
00220 * removed many #include statements
00221 *
00222 * Revision 1.1.1.1  2002/05/10 12:40:15  cvsadm
00223 * Moved GT2002 Project from ute to tamara.
00224 *
00225 * Revision 1.5  2002/02/08 17:48:57  risler
00226 * SensorData to MotionControl
00227 *
00228 * Revision 1.4  2001/12/21 14:09:39  roefer
00229 * Added several destructors
00230 *
00231 * Revision 1.3  2001/12/10 17:47:06  risler
00232 * change log added
00233 *
00234 */

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