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

# Tools/Actorics/WalkAccelerationRestrictor.h

Go to the documentation of this file.

    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