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

Modules/RobotStateDetector/GT2004RobotStateDetector.h

Go to the documentation of this file.
00001 /**
00002 * @file GT2004RobotStateDetector.h
00003 *
00004 * Definition of class DefaultRobotStateDetector
00005 *
00006 */
00007 
00008 #ifndef __DefaultRobotStateDetector_h_
00009 #define __DefaultRobotStateDetector_h_
00010 
00011 #include "RobotStateDetector.h"
00012 
00013 
00014 #include "Tools/Debugging/Debugging.h" /////*****
00015 
00016 /**
00017 * @class DefaultRobotStateDetector
00018 *
00019 * A solution of the RobotStateDetector module.
00020 *
00021 * @author = Max Risler
00022 */
00023 class GT2004RobotStateDetector : public RobotStateDetector
00024 {
00025 public:
00026   /** 
00027   * Constructor.
00028   * @param interfaces The paramters of the RobotStateDetector module.
00029   */
00030   GT2004RobotStateDetector(const RobotStateDetectorInterfaces& interfaces);
00031 
00032   /** Executes the module */
00033   virtual void execute();
00034 
00035 private:
00036 
00037   void calculateCollisionState();
00038 
00039   void setNewButtonStatus();
00040 
00041   bool switchDown[BodyPercept::numOfSwitches];
00042   long switchDownTime[BodyPercept::numOfSwitches];
00043   long timeSinceLastCollision[6]; //here are the last collision time points
00044   long consecutiveCollisionTime[6]; //here are the consecutive collision time points
00045   long remindCollision; // time distance during which the last collision is remembered
00046   int getCollisionSide(); //on which side did more collisions occur
00047   void setCollisionOnLeftSide(bool collision); //add another collision to left side
00048   void setCollisionOnRightSide(bool collision);//add another collision to right side
00049 
00050   enum {middle = 0,
00051         left,
00052         right,
00053         robotSides};
00054 
00055   enum {maxFrameHistory = 200};
00056 
00057   bool numOfCollisions[maxFrameHistory][robotSides];
00058 
00059 
00060   /***/
00061   bool buttonPressed[BodyPercept::numOfSwitches]; //0 Button not pressed, 1 Button pressed
00062   long buttonTime[BodyPercept::numOfSwitches]; // The time as the button was pressed/released
00063   long buttonPressedTime[BodyPercept::numOfSwitches]; // How long the last button was pressed (after releasing it)
00064   long buttonDuration[BodyPercept::numOfSwitches]; // How long the button is pressed/released
00065   bool anyBackButtonPressed;  // The same information for any backbutton
00066   long anyBackButtonTime;
00067   long anyBackButtonPressedTime;
00068   long anyBackButtonDuration;
00069   /***/
00070 };
00071 
00072 #endif// __GT2004RobotStateDetector_h_
00073 
00074 /*
00075  * Change log :
00076  * 
00077  * $Log: GT2004RobotStateDetector.h,v $
00078  * Revision 1.2  2004/09/08 14:39:03  wachter
00079  * - Fixed some doxygen-errors
00080  *
00081  * Revision 1.1  2004/07/10 00:18:31  spranger
00082  * renamed (readded) for coderelease
00083  *
00084  * Revision 1.3  2004/06/23 11:02:26  goehring
00085  * Xabsl symbol collision-side added
00086  *
00087  * Revision 1.2  2004/05/24 14:14:26  juengel
00088  * New button evaluation.
00089  *
00090  * Revision 1.1.1.1  2004/05/22 17:20:41  cvsadm
00091  * created new repository GT2004_WM
00092  *
00093  * Revision 1.3  2004/05/11 06:59:05  brueckne
00094  * added new way to know how long a button is/was pressed/released (not ready yet)
00095  *
00096  * Revision 1.2  2004/03/08 02:11:45  roefer
00097  * Interfaces should be const
00098  *
00099  * Revision 1.1  2003/10/06 14:10:14  cvsadm
00100  * Created GT2004 (M.J.)
00101  *
00102  * Revision 1.1.1.1  2003/07/02 09:40:24  cvsadm
00103  * created new repository for the competitions in Padova from the 
00104  * tamara CVS (Tuesday 2:00 pm)
00105  *
00106  * removed unused solutions
00107  *
00108  * Revision 1.7  2003/06/21 13:07:36  goehring
00109  * CollisionStateSymbol modelling changed
00110  *
00111  * Revision 1.6  2003/06/20 16:57:46  goehring
00112  * CollisionDetectorValues improved
00113  *
00114  * Revision 1.5  2003/06/20 14:50:07  risler
00115  * numOfSwitches added
00116  *
00117  * Revision 1.4  2003/06/20 10:29:27  goehring
00118  * MotionCombination thresholds implemented, Review
00119  *
00120  * Revision 1.3  2002/10/14 13:14:24  dueffert
00121  * doxygen comments corrected
00122  *
00123  * Revision 1.2  2002/09/12 09:45:58  juengel
00124  * continued change of module/solution mechanisms
00125  *
00126  * Revision 1.1  2002/09/10 15:36:15  cvsadm
00127  * Created new project GT2003 (M.L.)
00128  * - Cleaned up the /Src/DataTypes directory
00129  * - Removed challenge related source code
00130  * - Removed processing of incoming audio data
00131  * - Renamed AcousticMessage to SoundRequest
00132  *
00133  * Revision 1.2  2002/08/22 14:41:03  risler
00134  * added some doxygen comments
00135  *
00136  * Revision 1.1.1.1  2002/05/10 12:40:15  cvsadm
00137  * Moved GT2002 Project from ute to tamara.
00138  *
00139  * Revision 1.4  2002/03/28 16:55:58  risler
00140  * RobotStateDetector receives BodyPercept instead of PerceptCollection
00141  * added switch duration in RobotStateDetector
00142  *
00143  * Revision 1.3  2002/03/28 15:19:20  risler
00144  * implemented switch messages in RobotStateDetector
00145  *
00146  * Revision 1.2  2001/12/10 17:47:06  risler
00147  * change log added
00148  *
00149  */

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