00001 /** 00002 * @file WalkAccelerationRestrictor.h 00003 * 00004 * Definition of class WalkAccelerationRestrictor 00005 * 00006 * @author Martin Lötzsch 00007 */ 00008 00009 #ifndef __WalkAccelerationRestrictor_h_ 00010 #define __WalkAccelerationRestrictor_h_ 00011 00012 #include "Representations/Motion/MotionRequest.h" 00013 00014 /** 00015 * @class WalkAccelerationRestrictor 00016 * 00017 * Provides functionality for restriction changes in walk speed to maximum values. 00018 * 00019 * @author Martin Lötzsch 00020 */ 00021 class WalkAccelerationRestrictor 00022 { 00023 public: 00024 /** 00025 * Constructor 00026 * @param motionRequest A reference to the motion request that shall be smoothed 00027 */ 00028 WalkAccelerationRestrictor(MotionRequest& motionRequest); 00029 00030 /** 00031 * Smoothes a walk motion. Changes in speed are clipped to a maximum acceleration. 00032 * Execute that function at the end of the execution of a basic behavior. 00033 * @param maxTranslationXAcceleration maximum x translation acceleration (in mm/s^2) 00034 * @param maxTranslationYAcceleration maximum y translation acceleration (in mm/s^2) 00035 * @param maxRotationAcceleration maximum rotation acceleration (in Deg/s^2) 00036 */ 00037 void restrictAccelerations(double maxTranslationXAcceleration, 00038 double maxTranslationYAcceleration, 00039 double maxRotationAcceleration); 00040 00041 /** 00042 * Saves the walk parameters of the last motion request. Should be used at the start 00043 * of the execution of a skill. 00044 */ 00045 void saveLastWalkParameters(); 00046 00047 protected: 00048 /** The time when the skill was executed last, used by smoothWalk */ 00049 unsigned long timeOfLastExecution; 00050 00051 /** x translation of the last motion request, used by smoothWalk */ 00052 double lastTranslationX; 00053 00054 /** y translation of the last motion request, used by smoothWalk */ 00055 double lastTranslationY; 00056 00057 /** rotation of the last motion request, used by smoothWalk */ 00058 double lastRotation; 00059 00060 /** A reference to the motion request */ 00061 MotionRequest& mr; 00062 }; 00063 00064 00065 #endif //__WalkAccelerationRestrictor_h_ 00066 00067 /* 00068 * Change Log: 00069 * 00070 * $Log: WalkAccelerationRestrictor.h,v $ 00071 * Revision 1.1.1.1 2004/05/22 17:36:01 cvsadm 00072 * created new repository GT2004_WM 00073 * 00074 * Revision 1.1 2003/10/07 10:13:21 cvsadm 00075 * Created GT2004 (M.J.) 00076 * 00077 * Revision 1.2 2003/09/26 15:28:10 juengel 00078 * Renamed DataTypes to representations. 00079 * 00080 * Revision 1.1 2003/09/26 11:40:40 juengel 00081 * - sorted tools 00082 * - clean-up in DataTypes 00083 * 00084 * Revision 1.1.1.1 2003/07/02 09:40:28 cvsadm 00085 * created new repository for the competitions in Padova from the 00086 * tamara CVS (Tuesday 2:00 pm) 00087 * 00088 * removed unused solutions 00089 * 00090 * Revision 1.1 2003/06/04 00:43:45 loetzsch 00091 * put the GT2003WalkAccelerationRestrictor into two extra files in /Src/Tools 00092 * 00093 */ 00094