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

# Modules/BehaviorControl/KickLogger.h

Go to the documentation of this file.

    00001 /**
    00002 * @file KickLogger.h
    00003 *
    00004 * Definition of class KickLogger.
    00005 *
    00006 * @author Martin Lötzsch
    00007 */
    00008
    00009 #ifndef __KickLogger_h_
    00010 #define __KickLogger_h_
    00011
    00012 #include "BehaviorControl.h"
    00013 #include "Tools/KickSelectionTable.h"
    00014
    00015 //#define USE_CEILING_CAM
    00016
    00017 /**
    00018 * @class KickLogger
    00019 *
    00020 * Runs in parallel to a xabsl behavior control and logs the preconditions
    00021 * and results of each kick.
    00022 *
    00023 * @author Martin Lötzsch
    00024 */
    00025 class KickLogger : public BehaviorControlInterfaces
    00026 {
    00027 public:
    00028   /**
    00029   * Constructor.
    00030   * @param interfaces The paramters of the BehaviorControl module.
    00031   */
    00032   KickLogger(BehaviorControlInterfaces& interfaces);
    00033
    00034   /** destructor */
    00035   ~KickLogger();
    00036
    00037   /** Executes the logger */
    00038   void execute();
    00039
    00040 private:
    00041   /** Different states of the shoot logger */
    00042   enum State { initial, kickRequested, kickStarted, kickFinished,
    00043     waitingForBall, wait };
    00044
    00045   /** The state of the logger */
    00046   State state;
    00047
    00048   /** Changes the state of the logger */
    00049   void changeState(State newState);
    00050
    00051   /** The time of the last state change */
    00052   unsigned long timeOfLastStateChange;
    00053
    00054   /**
    00055   * Writes a collected record if requested by
    00056   * a debug key to the debug message queue.
    00057   */
    00058   void record();
    00059
    00060   /** The kick record */
    00061   KickCase kick;
    00062
    00063   /** The requested kick */
    00064   SpecialActionRequest::SpecialActionID kickID;
    00065
    00066   /** The odometry data when the kick was started */
    00067   OdometryData odometryDataWhenKickWasStarted;
    00068
    00069   /** Returns the relative x position of a ball position */
    00070   double getBallX(Pose2D from);
    00071
    00072   /** Returns the relative y position of a ball position */
    00073   double getBallY(Pose2D from);
    00074 };
    00075
    00076 #endif// __KickLogger_h_