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 #include "Tools/RingBufferWithSum.h" 00015 00016 /** 00017 * The Xabsl2 symbols that are defined in "ball-symbols.xml" 00018 * 00019 * @author Martin Lötzsch 00020 */ 00021 class BallSymbols : public Xabsl2FunctionProvider, public BehaviorControlInterfaces 00022 { 00023 public: 00024 /* 00025 * Constructor. 00026 * @param interfaces The paramters of the BehaviorControl module. 00027 */ 00028 BallSymbols(const BehaviorControlInterfaces& interfaces); 00029 00030 /** registers the symbols at an engine */ 00031 void registerSymbols(Xabsl2Engine& engine); 00032 00033 /** updates the symbols */ 00034 void update(); 00035 00036 //!@name Input symbols 00037 //!@{ 00038 double getNumberOfImagesWithBallPercept(); /*!< A function for the symbol "ball.number-of-images-with-ball-percept" */ 00039 double getNumberOfImagesWithoutBallPercept(); /*!< A function for the symbol "ball.number-of-images-without-ball-percept" */ 00040 double getSeenDistance(); /*!< A function for the symbol "ball.seen.distance" */ 00041 double getSeenAngle(); /*!< A function for the symbol "ball.seen.angle" */ 00042 double getSeenSpeed(); /*!< A function for the symbol "ball.seen.speed" */ 00043 double getSeenRelativeSpeedX(); /*!< A function for the symbol "ball.seen.relative-speed.x" */ 00044 double getSeenRelativeSpeedY(); /*!< A function for the symbol "ball.seen.relative-speed.y" */ 00045 double getSeenDistanceX(); /*!< A function for the symbol "ball.seen.distance-x" */ 00046 double getSeenDistanceY(); /*!< A function for the symbol "ball.seen.distance-y" */ 00047 double getProjectedDistanceOnYAxis(); /*!< A function for the symbol "ball.projectedDistanceOnYAxis" */ 00048 double getTimeUntilBallCrossesYAxis(); /*!< A function for the symbol "ball.timeBallCrossesYAxis" */ 00049 double getDistanceSeenBallToOwnPenaltyArea(); /*!< A function for the symbol "ball.seen.distance-to-own-penalty-area" */ 00050 double getTimeSinceLastSeen(); /*!< A function for the symbol "ball.time-since-last-seen" */ 00051 double getConsecutivelySeenTime(); /*!< A function for the symbol "ball.consecutively-seen-time" */ 00052 double getTimeSinceLastSeenConsecutively(); /*!< A function for the symbol "ball.time-since-last-seen-consecutively" */ 00053 bool getBallSeenInFrontOfOpponentGoal(); /*!< A function for the symbol "ball.seen.ball-in-front-of-opponent-goal */ 00054 bool getJustSeen(); /*!< A function for the symbol "ball.just-seen" */ 00055 double getKnownDistance(); /*!< A function for the symbol "ball.known.distance" */ 00056 double getKnownAngle(); /*!< A function for the symbol "ball.known.angle" */ 00057 double getKnownX(); /*!< A function for the symbol "ball.known.x" */ 00058 double getKnownY(); /*!< A function for the symbol "ball.known.y" */ 00059 double getHypotheticalDistance(); /*!< A function for the symbol "ball.hypothetical.distance" */ 00060 double getHypotheticalAngle(); /*!< A function for the symbol "ball.hypothetical.angle" */ 00061 double getTimeSinceLastKnown(); /*!< A function for the symbol "ball.time-since-last-known" */ 00062 double getTimeAfterWhichCommunicatedBallAreAccepted(); /*!< A function for the symbol "ball.time-after-which-communicated-balls-are-accepted" */ 00063 double getPositionValidity(); /*!< A function for the symbol "ball.seen.positionValidity" */ 00064 double getSpeedValidity(); /*!< A function for the symbol "ball.seen.speedValidity" */ 00065 double getAngleToOpponentGoal(); /*!< calculates the value for the symbol "ball.angle-to-opponent-goal" */ 00066 double getSeenDistanceToBorder(); /*!< calculates the value for the symbol "ball.seen.distance-to-border" */ 00067 double getSeenPositionValidity(); 00068 double getSeenVelocityValidity(); 00069 double getPropagatedPositionValidity(); 00070 double getPropagatedVelocityValidity(); 00071 double getPropagatedDistance(); 00072 double getPropagatedAngle(); 00073 double getPropagatedX(); 00074 double getPropagatedY(); 00075 double getPropagatedRelativeX(); 00076 double getPropagatedRelativeY(); 00077 double getTimeAfterWhichPropagatedAreUsed(); 00078 double getMaxDistanceToUseSeen(); 00079 double getPropagatedSpeedX(); 00080 double getPropagatedSpeedY(); 00081 double getPropagatedRelativeSpeedX(); 00082 double getPropagatedRelativeSpeedY(); 00083 double getSeenSpeedX(); 00084 double getSeenSpeedY(); 00085 double getKnownOrNearDistance(); 00086 double getKnownOrNearX(); 00087 double getKnownOrNearY(); 00088 double getKnownOrNearRelativeX(); 00089 double getKnownOrNearRelativeY(); 00090 double getKnownOrNearSpeedX(); 00091 double getKnownOrNearSpeedY(); 00092 double getKnownOrNearSpeedAbs(); 00093 double getKnownOrNearProbability(); 00094 double getKnownOrNearRelativeSpeedX(); 00095 double getKnownOrNearRelativeSpeedY(); 00096 double getKnownOrNearAngle(); 00097 double getSeenRelativeX(); 00098 double getSeenRelativeY(); 00099 double getKnownOrNearAngleToOwnGoal(); 00100 double getKnownOrNearDistanceToOwnPenaltyArea(); 00101 double getBallInterceptionPointX(); /*!< A function for the symbol "ball.interceptionPoint.x" */ 00102 double getBallInterceptionPointY(); /*!< A function for the symbol "ball.interceptionPoint.x" */ 00103 bool getBallCanBeIntercepted(); /*!< A function for the symbol "ball.ballCanBeIntercepted" */ 00104 //!@} 00105 00106 00107 /** The average distane to the ball */ 00108 double averageDistance; 00109 00110 private: 00111 /** A ring buffer needed to calculate the average ball distance */ 00112 RingBufferWithSum<60> ballDistanceRingBuffer; 00113 00114 bool playBallPrecisely; 00115 00116 int ballPrecision; 00117 00118 /* needed for interception of the ball */ 00119 bool ballCanBeIntercepted; 00120 bool interceptionAlreadyCalculated; 00121 Vector2<double> interceptionPoint; 00122 00123 void calculateInterceptionPoint(); 00124 }; 00125 00126 00127 #endif // __BallSymbols_h_ 00128
1.3.6