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

Modules/SpecialActions/SpecialActions.h

Go to the documentation of this file.
00001 /**
00002 * @file SpecialActions.h
00003 * 
00004 * This file contains a generic class for SpecialActions.
00005 */
00006 
00007 #ifndef __SpecialActions_h_
00008 #define __SpecialActions_h_
00009 
00010 #include "Tools/Module/Module.h"
00011 
00012 #include "Representations/Motion/JointData.h"
00013 #include "Representations/Motion/PIDData.h"
00014 #include "Representations/Motion/OdometryData.h"
00015 #include "Representations/Motion/MotionInfo.h"
00016 
00017 /** 
00018 * @class SpecialActionsInterfaces
00019 *
00020 * Interfaces of the SpecialAction module.
00021 */
00022 class SpecialActionsInterfaces
00023 {
00024 public:
00025   /** Constructor */
00026   SpecialActionsInterfaces(
00027     const MotionRequest& motionRequest,
00028     MotionRequest::MotionID& lastMotionType,
00029     PIDData& pidData,
00030     OdometryData& odometryData,
00031     MotionInfo& motionInfo)
00032     : motionRequest(motionRequest),
00033     lastMotionType(lastMotionType),
00034     lastWalkType(lastWalkType),
00035     pidData(pidData),
00036     odometryData(odometryData),
00037     motionInfo(motionInfo)
00038   {}
00039   
00040 protected:
00041   /** The current motion request */
00042   const MotionRequest& motionRequest;
00043   
00044   /** The motion type of the previous frame */
00045   MotionRequest::MotionID& lastMotionType;
00046   
00047   /** The walk type of the previous frame */
00048   WalkRequest::WalkType& lastWalkType;
00049 
00050   /** The current PID servo gains */
00051   PIDData& pidData;
00052     
00053   /** Has to be incremented by the walking engine */
00054   OdometryData& odometryData;
00055   
00056   /** The neck height and the body tilt to be estimated by the walking engine */
00057   MotionInfo& motionInfo;
00058 };
00059 
00060 /**
00061 * A generic class for SpecialActions.
00062 *
00063 * It generates JointData and OdometryData according to current MotionRequest
00064 * executing special actions.
00065 */
00066 class SpecialActions : public Module, public SpecialActionsInterfaces
00067 {
00068 public:
00069 /*
00070 * Constructor.
00071 * @param interfaces The paramters of the SpecialActions module.
00072   */
00073   SpecialActions(const SpecialActionsInterfaces& interfaces)
00074     : SpecialActionsInterfaces(interfaces)
00075   {}
00076   
00077   /**
00078   * Executes the requested special action
00079   * @param specialActionRequest The special action to be executed
00080   * @param jointData stores calculated frame
00081   * @param specialActionRequest the specialActionRequest to be executed
00082   * @return true if next set should be calculated by SpecialActions
00083   *         false if change to other module can occur
00084   */
00085   virtual bool executeParameterized(SpecialActionRequest specialActionRequest, JointData& jointData) = 0;
00086 
00087   /*
00088    *  Determines wether or not a Specialaction can be executed in current phase of Walking cycle 
00089    *  @param specialActionID SpecialActionID for Specialaction that information for is needed
00090    *  @return wether the Specialaction can be executed in current Walkingcycle
00091    */
00092   virtual bool specialActionIsExecutableInWalkingCycle(int specialActionID, double walkCycle)=0;
00093   
00094   /** Destructor */
00095   virtual ~SpecialActions() {}
00096   
00097 private:
00098   /** That function is not used but has to be implemented */
00099   virtual void execute() {};
00100 };
00101 
00102 #endif //__SpecialActions_h_
00103 
00104 /*
00105 * Change log :
00106 * 
00107 * $Log: SpecialActions.h,v $
00108 * Revision 1.7  2004/09/09 11:37:39  wachter
00109 * - Fixed some more doxygen-errors
00110 *
00111 * Revision 1.6  2004/09/09 10:15:58  spranger
00112 * fixed doxygen-errors
00113 *
00114 * Revision 1.5  2004/06/14 14:55:03  spranger
00115 * changed interface of executeParametrized to specialActionRequest
00116 *
00117 * Revision 1.4  2004/06/02 17:18:24  spranger
00118 * MotionRequest cleanup
00119 *
00120 * Revision 1.3  2004/05/27 09:29:28  loetzsch
00121 * removed executedMotionRequest from Interfaces
00122 *
00123 * Revision 1.2  2004/05/26 16:10:24  dueffert
00124 * better data types used
00125 *
00126 * Revision 1.1.1.1  2004/05/22 17:21:31  cvsadm
00127 * created new repository GT2004_WM
00128 *
00129 * Revision 1.2  2004/03/08 02:11:52  roefer
00130 * Interfaces should be const
00131 *
00132 * Revision 1.1  2003/10/06 14:10:15  cvsadm
00133 * Created GT2004 (M.J.)
00134 *
00135 * Revision 1.2  2003/09/26 15:27:49  juengel
00136 * Renamed DataTypes to representations.
00137 *
00138 * Revision 1.1.1.1  2003/07/02 09:40:24  cvsadm
00139 * created new repository for the competitions in Padova from the 
00140 * tamara CVS (Tuesday 2:00 pm)
00141 *
00142 * removed unused solutions
00143 *
00144 * Revision 1.5  2003/03/06 12:09:00  dueffert
00145 * execute with parameters renamed to avoid inheritance warnings, re-order warning removed
00146 *
00147 * Revision 1.4  2002/11/20 18:02:28  risler
00148 * added PID values to GT2001MotionNetSpecialActions
00149 * added playDead motion
00150 *
00151 * Revision 1.3  2002/10/11 15:19:55  risler
00152 * fixed bug: MotionRequest has to be reference
00153 *
00154 * Revision 1.2  2002/09/17 23:55:22  loetzsch
00155 * - unraveled several datatypes
00156 * - changed the WATCH macro
00157 * - completed the process restructuring
00158 *
00159 * Revision 1.1  2002/09/10 15:36:16  cvsadm
00160 * Created new project GT2003 (M.L.)
00161 * - Cleaned up the /Src/DataTypes directory
00162 * - Removed challenge related source code
00163 * - Removed processing of incoming audio data
00164 * - Renamed AcousticMessage to SoundRequest
00165 *
00166 * Revision 1.3  2002/08/30 14:35:06  dueffert
00167 * removed unused includes
00168 *
00169 * Revision 1.2  2002/08/22 14:41:03  risler
00170 * added some doxygen comments
00171 *
00172 * Revision 1.1.1.1  2002/05/10 12:40:16  cvsadm
00173 * Moved GT2002 Project from ute to tamara.
00174 *
00175 * Revision 1.5  2001/12/21 14:09:39  roefer
00176 * Added several destructors
00177 *
00178 * Revision 1.4  2001/12/10 17:47:07  risler
00179 * change log added
00180 *
00181 */

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