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 /** 00016 * @class KickLogger 00017 * 00018 * Runs in parallel to a xabsl behavior control and logs the preconditions 00019 * and results of each kick. 00020 * 00021 * @author Martin Lötzsch 00022 */ 00023 class KickLogger : public BehaviorControlInterfaces 00024 { 00025 public: 00026 /** 00027 * Constructor. 00028 * @param interfaces The paramters of the BehaviorControl module. 00029 */ 00030 KickLogger(BehaviorControlInterfaces& interfaces); 00031 00032 /** destructor */ 00033 ~KickLogger(); 00034 00035 /** Executes the logger */ 00036 void execute(); 00037 00038 private: 00039 /** Different states of the shoot logger */ 00040 enum State { initial, kickRequested, kickStarted, kickFinished, 00041 waitingForBall, wait }; 00042 00043 /** The state of the logger */ 00044 State state; 00045 00046 /** Changes the state of the logger */ 00047 void changeState(State newState); 00048 00049 /** The time of the last state change */ 00050 unsigned long timeOfLastStateChange; 00051 00052 /** 00053 * Writes a collected record if requested by 00054 * a debug key to the debug message queue. 00055 */ 00056 void record(); 00057 00058 /** The kick record */ 00059 KickCase kick; 00060 00061 /** The requested kick */ 00062 SpecialActionRequest::SpecialActionID kickID; 00063 00064 /** The odometry data when the kick was started */ 00065 OdometryData odometryDataWhenKickWasStarted; 00066 00067 /** Returns the relative x position of a ball position */ 00068 double getBallX(Pose2D from); 00069 00070 /** Returns the relative y position of a ball position */ 00071 double getBallY(Pose2D from); 00072 }; 00073 00074 #endif// __KickLogger_h_ 00075 00076 /* 00077 * Change log : 00078 * 00079 * $Log: KickLogger.h,v $ 00080 * Revision 1.3 2004/06/20 15:22:35 risler 00081 * increased kick editor usability: 00082 * KickLogger now sends kick record via debug key instead of writing to file 00083 * KickEditor automatically displays sent kick records 00084 * KickCase moved to KickSelectionTable 00085 * 00086 * Revision 1.2 2004/06/02 17:18:24 spranger 00087 * MotionRequest cleanup 00088 * 00089 * Revision 1.1 2004/05/27 16:48:08 loetzsch 00090 * added the kick logger 00091 * 00092 * Revision 1.3 2004/03/20 00:20:18 kerdels 00093 * removed some errors 00094 * 00095 * Revision 1.1 2004/03/16 14:00:17 juengel 00096 * Integrated Improvments from "Günne" 00097 * -ATH2004ERS7Behavior 00098 * -ATHHeadControl 00099 * -KickSelectionTable 00100 * -KickEditor 00101 * 00102 * Revision 1.1 2004/03/06 12:52:11 loetzsch 00103 * cloned ATH2004BehaviorControl into ATH2004ERS7BehaviorControl 00104 * 00105 * Revision 1.1.1.1 2004/03/05 10:10:11 loetzsch 00106 * created local cvs for Günne 00107 * 00108 * Revision 1.4 2004/02/04 14:09:56 loetzsch 00109 * improved 00110 * 00111 * Revision 1.3 2004/02/03 23:16:46 loetzsch 00112 * added debug key sendShootRecords 00113 * 00114 * Revision 1.2 2004/01/30 13:25:28 loetzsch 00115 * using odometry data in shoot logger, 00116 * first draft of visualization 00117 * 00118 * Revision 1.1 2004/01/28 21:16:56 loetzsch 00119 * added ATH2004ShootLogger 00120 * 00121 */