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

Modules/BehaviorControl/CommonXabsl2Symbols/BallSymbols.h

Go to the documentation of this file.
00001 /** 
00002 * @file BallSymbols.h
00003 *
00004 * Declaration of class BallSymbols.
00005 *
00006 * @author Martin Lötzsch
00007 */
00008 
00009 #ifndef __BallSymbols_h_
00010 #define __BallSymbols_h_
00011 
00012 #include "../BehaviorControl.h"
00013 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h"
00014 
00015 #include "Tools/RingBufferWithSum.h"
00016 
00017 /**
00018 * The Xabsl2 symbols that are defined in "ball-symbols.xml"
00019 *
00020 * @author Martin Lötzsch
00021 */ 
00022 class BallSymbols : public Xabsl2FunctionProvider, public BehaviorControlInterfaces
00023 {
00024 public:
00025 /*
00026 * Constructor.
00027 * @param interfaces The paramters of the BehaviorControl module.
00028   */
00029   BallSymbols(const BehaviorControlInterfaces& interfaces);
00030   
00031   /** registers the symbols at an engine */
00032   void registerSymbols(Xabsl2Engine& engine);
00033   
00034     /** updates the symbols */
00035   void update();
00036 
00037   //!@name Input symbols
00038   //!@{
00039   double getNumberOfImagesWithBallPercept(); /*!< A function for the symbol "ball.number-of-images-with-ball-percept" */
00040   double getNumberOfImagesWithoutBallPercept(); /*!< A function for the symbol "ball.number-of-images-without-ball-percept" */
00041   double getSeenDistance(); /*!< A function for the symbol "ball.seen.distance" */
00042   double getSeenAngle(); /*!< A function for the symbol "ball.seen.angle" */
00043   double getSeenSpeed(); /*!< A function for the symbol "ball.seen.speed" */
00044   double getSeenRelativeSpeedX(); /*!< A function for the symbol "ball.seen.relative-speed.x" */
00045   double getSeenRelativeSpeedY(); /*!< A function for the symbol "ball.seen.relative-speed.y" */
00046   double getSeenDistanceX(); /*!< A function for the symbol "ball.seen.distance-x" */
00047   double getSeenDistanceY(); /*!< A function for the symbol "ball.seen.distance-y" */
00048   double getProjectedDistanceOnYAxis(); /*!< A function for the symbol "ball.projectedDistanceOnYAxis" */
00049   double getTimeUntilBallCrossesYAxis(); /*!< A function for the symbol "ball.timeBallCrossesYAxis" */
00050   double getDistanceSeenBallToOwnPenaltyArea(); /*!< A function for the symbol "ball.seen.distance-to-own-penalty-area" */
00051   double getTimeSinceLastSeen(); /*!< A function for the symbol "ball.time-since-last-seen" */
00052   double getConsecutivelySeenTime(); /*!< A function for the symbol "ball.consecutively-seen-time" */
00053   double getTimeSinceLastSeenConsecutively(); /*!< A function for the symbol "ball.time-since-last-seen-consecutively" */
00054   bool getBallSeenInFrontOfOpponentGoal(); /*!< A function for the symbol "ball.seen.ball-in-front-of-opponent-goal */
00055   bool getJustSeen(); /*!< A function for the symbol "ball.just-seen" */
00056   double getKnownDistance(); /*!< A function for the symbol "ball.known.distance" */
00057   double getKnownAngle(); /*!< A function for the symbol "ball.known.angle" */
00058   double getKnownX(); /*!< A function for the symbol "ball.known.x" */
00059   double getKnownY(); /*!< A function for the symbol "ball.known.y" */
00060   double getTimeSinceLastKnown(); /*!< A function for the symbol "ball.time-since-last-known" */
00061   double getTimeAfterWhichCommunicatedBallAreAccepted(); /*!< A function for the symbol "ball.time-after-which-communicated-balls-are-accepted" */
00062   double getMotionValidity(); /*!< A function for the symbol "ball.seen.movementValidity" */
00063   double getAngleToOpponentGoal(); /*!< calculates the value for the symbol "ball.angle-to-opponent-goal" */
00064   //!@}
00065 
00066 
00067 private:
00068   /** A ring buffer needed to calculate the average ball distance */
00069   RingBufferWithSum<60> ballDistanceRingBuffer;
00070 
00071   /** The average distane to the ball */
00072   double averageDistance;
00073 
00074   /** Whether the ball is handled at the moment */
00075   bool ballIsHandledAtTheMoment;
00076 
00077   /** Whether the ball was handled in the last frame */
00078   int ballWasHandledInLastFrame;
00079 
00080 
00081   bool playBallPrecisely;
00082 
00083   int ballPrecision;
00084 
00085 
00086 };
00087 
00088 
00089 #endif // __BallSymbols_h_
00090 
00091 /*
00092 * Change Log
00093 * 
00094 * $Log: BallSymbols.h,v $
00095 * Revision 1.5  2004/06/27 17:41:02  goetzke
00096 * Added penalty-shooter.
00097 *
00098 * Revision 1.4  2004/06/23 11:37:43  dassler
00099 * New Ballsymbols introduced
00100 * ball.projected-distance-on-y-axis" description="Projected Distance of the ball to the y axis of the robot
00101 * ball.time-until-ball-crosses-y-axis" description="Time until the ball crosses the y axis of the robot
00102 *
00103 * Revision 1.3  2004/06/15 17:50:24  juengel
00104 * Added symbols:
00105 * numberOfImagesWithBallPercept,
00106 * numberOfImagesWithoutBallPercept
00107 *
00108 * Revision 1.2  2004/05/27 18:49:17  kerdels
00109 * added a small 5 frames sliding average for the relative ballspeed,
00110 * added new ballState Representation and adjusted the apropriate files
00111 *
00112 * Revision 1.1.1.1  2004/05/22 17:16:57  cvsadm
00113 * created new repository GT2004_WM
00114 *
00115 * Revision 1.10  2004/04/15 13:12:27  loetzsch
00116 * added setting of the symbol "ball.handling"
00117 *
00118 * Revision 1.9  2004/04/14 20:35:28  loetzsch
00119 * i.m.p.r.o.v.e.d.
00120 *
00121 * Revision 1.8  2004/04/08 15:33:01  wachter
00122 * GT04 checkin of Microsoft-Hellounds
00123 *
00124 * Revision 1.7  2004/04/05 17:56:47  loetzsch
00125 * merged the local German Open CVS of the aibo team humboldt with the tamara CVS
00126 *
00127 * Revision 1.3  2004/04/02 11:44:30  jumped
00128 * addded ball.seen.in.front-of-opponent-goal (and supporting functions)
00129 *
00130 * Revision 1.2  2004/04/01 22:08:37  juengel
00131 * Added ball.average-distance.
00132 *
00133 * Revision 1.1.1.1  2004/03/31 11:16:41  loetzsch
00134 * created ATH repository for german open 2004
00135 *
00136 * Revision 1.6  2004/03/28 16:33:58  loetzsch
00137 * added input symbol ball.consecutively-seen-time and ball.time-since-last-consecutively-seen
00138 *
00139 * Revision 1.5  2004/03/27 14:45:41  loetzsch
00140 * added boolean input symbol "ball.seen-consecutively"
00141 *
00142 * Revision 1.4  2004/03/08 00:58:54  roefer
00143 * Interfaces should be const
00144 *
00145 * Revision 1.3  2004/02/05 14:21:03  spranger
00146 * added ballState enum
00147 *
00148 * Revision 1.2  2004/01/29 09:52:43  schumann
00149 * added motion validity symbol to xabsl
00150 *
00151 * Revision 1.1  2003/10/22 22:18:44  loetzsch
00152 * prepared the cloning of the GT2003BehaviorControl
00153 *
00154 * Revision 1.1  2003/10/06 13:39:28  cvsadm
00155 * Created GT2004 (M.J.)
00156 *
00157 * Revision 1.1.1.1  2003/07/02 09:40:23  cvsadm
00158 * created new repository for the competitions in Padova from the 
00159 * tamara CVS (Tuesday 2:00 pm)
00160 *
00161 * removed unused solutions
00162 *
00163 * Revision 1.8  2003/06/22 14:54:12  risler
00164 * ball.seen.relative-speed.x/y added
00165 *
00166 * Revision 1.7  2003/06/19 14:49:04  risler
00167 * symbol ball.getting-closer added
00168 *
00169 * Revision 1.6  2003/06/18 18:31:29  risler
00170 * added relative ball position
00171 *
00172 * Revision 1.5  2003/06/17 19:54:59  risler
00173 * ball caught symbols moved to strategy
00174 *
00175 * Revision 1.4  2003/06/04 11:17:14  risler
00176 * added symbol ball.seen.distance-to-own-penalty-area
00177 *
00178 * Revision 1.3  2003/06/02 03:57:52  loetzsch
00179 * copied a simple goalie behavior from humboldt2003
00180 *
00181 * Revision 1.2  2003/05/09 15:29:06  loetzsch
00182 * added time-after-which-communicated-ball-are-accepted
00183 *
00184 * Revision 1.1  2003/05/04 11:41:40  loetzsch
00185 * added class BallSymbols
00186 *
00187 */
00188 

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