#include <BallSymbols.h>
Inheritance diagram for BallSymbols:
Definition at line 29 of file BallSymbols.h.
BallSymbols::BallSymbols | ( | const BehaviorControlInterfaces & | interfaces | ) |
Definition at line 20 of file BallSymbols.cpp.
double BallSymbols::getAngleToOpponentGoal | ( | ) |
calculates the value for the symbol "ball.angle-to-opponent-goal"
Definition at line 262 of file BallSymbols.cpp.
References Geometry::angleTo(), BehaviorControlInterfaces::ballModel, normalize(), BallModel::seen, and toDegrees().
Referenced by registerSymbols().
bool BallSymbols::getBallSeenInFrontOfOpponentGoal | ( | ) |
A function for the symbol "ball.seen.ball-in-front-of-opponent-goal
Definition at line 253 of file BallSymbols.cpp.
References SeenBallPosition::ballInFrontOfOpponentGoal, BehaviorControlInterfaces::ballModel, and BallModel::seen.
Referenced by registerSymbols().
double BallSymbols::getConsecutivelySeenTime | ( | ) |
A function for the symbol "ball.consecutively-seen-time"
Definition at line 242 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, BallModel::seen, SeenBallPosition::timeUntilSeenConsecutively, and SeenBallPosition::timeWhenFirstSeenConsecutively.
Referenced by registerSymbols().
double BallSymbols::getDistanceSeenBallToOwnPenaltyArea | ( | ) |
A function for the symbol "ball.seen.distance-to-own-penalty-area"
Definition at line 196 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, FieldDimensions::distanceToOwnPenaltyArea(), and BallModel::seen.
Referenced by registerSymbols().
bool BallSymbols::getJustSeen | ( | ) |
A function for the symbol "ball.just-seen"
Definition at line 257 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, SystemCall::getTimeSince(), BallModel::seen, and SeenBallPosition::timeWhenLastSeen.
Referenced by registerSymbols().
double BallSymbols::getKnownAngle | ( | ) |
A function for the symbol "ball.known.angle"
Definition at line 160 of file BallSymbols.cpp.
References Geometry::angleTo(), BehaviorControlInterfaces::ballModel, BallModel::behaviorControlTimeAfterWhichCommunicatedBallsAreAccepted, BallModel::getKnownPosition(), RobotPose::getPose(), BehaviorControlInterfaces::robotPose, and toDegrees().
Referenced by registerSymbols().
double BallSymbols::getKnownDistance | ( | ) |
A function for the symbol "ball.known.distance"
Definition at line 137 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, BallModel::behaviorControlTimeAfterWhichCommunicatedBallsAreAccepted, Geometry::distanceTo(), BallModel::getKnownPosition(), RobotPose::getPose(), and BehaviorControlInterfaces::robotPose.
Referenced by registerSymbols().
bool BallSymbols::getKnownOutsidePlayingField | ( | ) |
A function for the symbol "ball.known.outside-playing-field
double BallSymbols::getKnownX | ( | ) |
A function for the symbol "ball.known.x"
Definition at line 211 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, BallModel::behaviorControlTimeAfterWhichCommunicatedBallsAreAccepted, BallModel::getKnownPosition(), and Vector2< V >::x.
Referenced by registerSymbols().
double BallSymbols::getKnownY | ( | ) |
A function for the symbol "ball.known.y"
Definition at line 217 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, BallModel::behaviorControlTimeAfterWhichCommunicatedBallsAreAccepted, BallModel::getKnownPosition(), and Vector2< V >::y.
Referenced by registerSymbols().
double BallSymbols::getMotionValidity | ( | ) |
A function for the symbol "ball.seen.movementValidity"
Definition at line 223 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, and BallModel::motionValidity.
Referenced by registerSymbols().
double BallSymbols::getNumberOfImagesWithBallPercept | ( | ) |
A function for the symbol "ball.number-of-images-with-ball-percept"
Definition at line 267 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, and BallModel::numberOfImagesWithBallPercept.
Referenced by registerSymbols().
double BallSymbols::getNumberOfImagesWithoutBallPercept | ( | ) |
A function for the symbol "ball.number-of-images-without-ball-percept"
Definition at line 272 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, and BallModel::numberOfImagesWithoutBallPercept.
Referenced by registerSymbols().
double BallSymbols::getProjectedDistanceOnYAxis | ( | ) |
A function for the symbol "ball.projectedDistanceOnYAxis"
Definition at line 206 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, BallModel::ballState, and BallState::projectedDistanceOnYAxis.
Referenced by registerSymbols().
double BallSymbols::getSeenAngle | ( | ) |
A function for the symbol "ball.seen.angle"
Definition at line 171 of file BallSymbols.cpp.
References Geometry::angleTo(), BehaviorControlInterfaces::ballModel, RobotPose::getPose(), BehaviorControlInterfaces::robotPose, BallModel::seen, and toDegrees().
Referenced by registerSymbols().
double BallSymbols::getSeenDistance | ( | ) |
A function for the symbol "ball.seen.distance"
Definition at line 143 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, Geometry::distanceTo(), RobotPose::getPose(), BehaviorControlInterfaces::robotPose, and BallModel::seen.
Referenced by getSeenDistanceX(), getSeenDistanceY(), and registerSymbols().
double BallSymbols::getSeenDistanceX | ( | ) |
A function for the symbol "ball.seen.distance-x"
Definition at line 148 of file BallSymbols.cpp.
References Geometry::angleTo(), BehaviorControlInterfaces::ballModel, RobotPose::getPose(), getSeenDistance(), BehaviorControlInterfaces::robotPose, and BallModel::seen.
Referenced by registerSymbols().
double BallSymbols::getSeenDistanceY | ( | ) |
A function for the symbol "ball.seen.distance-y"
Definition at line 154 of file BallSymbols.cpp.
References Geometry::angleTo(), BehaviorControlInterfaces::ballModel, RobotPose::getPose(), getSeenDistance(), BehaviorControlInterfaces::robotPose, and BallModel::seen.
Referenced by registerSymbols().
double BallSymbols::getSeenRelativeSpeedX | ( | ) |
A function for the symbol "ball.seen.relative-speed.x"
Definition at line 182 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, BehaviorControlInterfaces::robotPose, Pose2D::rotation, BallModel::seen, SeenBallPosition::speed, Vector2< V >::x, and Vector2< V >::y.
Referenced by registerSymbols().
double BallSymbols::getSeenRelativeSpeedY | ( | ) |
A function for the symbol "ball.seen.relative-speed.y"
Definition at line 189 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, BehaviorControlInterfaces::robotPose, Pose2D::rotation, BallModel::seen, SeenBallPosition::speed, Vector2< V >::x, and Vector2< V >::y.
Referenced by registerSymbols().
double BallSymbols::getSeenSpeed | ( | ) |
A function for the symbol "ball.seen.speed"
Definition at line 177 of file BallSymbols.cpp.
References Vector2< V >::abs(), BehaviorControlInterfaces::ballModel, BallModel::seen, and SeenBallPosition::speed.
Referenced by registerSymbols().
double BallSymbols::getTimeAfterWhichCommunicatedBallAreAccepted | ( | ) |
A function for the symbol "ball.time-after-which-communicated-balls-are-accepted"
Definition at line 166 of file BallSymbols.cpp.
References BallModel::behaviorControlTimeAfterWhichCommunicatedBallsAreAccepted.
Referenced by registerSymbols().
double BallSymbols::getTimeSinceLastKnown | ( | ) |
A function for the symbol "ball.time-since-last-known"
Definition at line 231 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, BallModel::behaviorControlTimeAfterWhichCommunicatedBallsAreAccepted, and BallModel::getTimeSinceLastKnown().
Referenced by registerSymbols().
double BallSymbols::getTimeSinceLastSeen | ( | ) |
A function for the symbol "ball.time-since-last-seen"
Definition at line 237 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, SystemCall::getTimeSince(), BallModel::seen, and SeenBallPosition::timeWhenLastSeen.
Referenced by registerSymbols().
double BallSymbols::getTimeSinceLastSeenConsecutively | ( | ) |
A function for the symbol "ball.time-since-last-seen-consecutively"
Definition at line 248 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, SystemCall::getTimeSince(), BallModel::seen, and SeenBallPosition::timeUntilSeenConsecutively.
Referenced by registerSymbols().
double BallSymbols::getTimeUntilBallCrossesYAxis | ( | ) |
A function for the symbol "ball.timeBallCrossesYAxis"
Definition at line 201 of file BallSymbols.cpp.
References BehaviorControlInterfaces::ballModel, BallModel::ballState, and BallState::timeBallCrossesYAxis.
Referenced by registerSymbols().
void BallSymbols::registerSymbols | ( | Xabsl2Engine & | engine | ) |
registers the symbols at an engine
Definition at line 30 of file BallSymbols.cpp.
References averageDistance, ballIsHandledAtTheMoment, BehaviorControlInterfaces::ballModel, ballPrecision, BallState::ballRollsByLeft, BallState::ballRollsByRight, BallState::ballRollsFast, BallState::ballRollsTowardsRobot, BallModel::ballState, ballWasHandledInLastFrame, BallModel::ballWasSeen, getAngleToOpponentGoal(), getBallSeenInFrontOfOpponentGoal(), getConsecutivelySeenTime(), getDistanceSeenBallToOwnPenaltyArea(), getJustSeen(), getKnownAngle(), getKnownDistance(), getKnownX(), getKnownY(), getMotionValidity(), getNumberOfImagesWithBallPercept(), getNumberOfImagesWithoutBallPercept(), getProjectedDistanceOnYAxis(), getSeenAngle(), getSeenDistance(), getSeenDistanceX(), getSeenDistanceY(), getSeenRelativeSpeedX(), getSeenRelativeSpeedY(), getSeenSpeed(), getTimeAfterWhichCommunicatedBallAreAccepted(), getTimeSinceLastKnown(), getTimeSinceLastSeen(), getTimeSinceLastSeenConsecutively(), getTimeUntilBallCrossesYAxis(), playBallPrecisely, Xabsl2Symbols::registerBooleanInputSymbol(), Xabsl2Symbols::registerDecimalInputSymbol(), Xabsl2Symbols::registerEnumeratedOutputSymbol(), Xabsl2Symbols::registerEnumeratedOutputSymbolEnumElement(), BallModel::seen, Vector2< V >::x, and Vector2< V >::y.
Referenced by GT2004BehaviorControl::registerSymbolsAndBasicBehaviors().
void BallSymbols::update | ( | ) |
updates the symbols
Definition at line 112 of file BallSymbols.cpp.
References RingBufferWithSum< n >::add(), averageDistance, ballDistanceRingBuffer, ballIsHandledAtTheMoment, BehaviorControlInterfaces::ballModel, ballPrecision, ballWasHandledInLastFrame, Geometry::distanceTo(), RingBufferWithSum< n >::getNumberOfEntries(), RobotPose::getPose(), RingBufferWithSum< n >::getSum(), playBallPrecisely, BehaviorControlInterfaces::robotPose, and BallModel::seen.
Referenced by GT2004BehaviorControl::execute().
double BallSymbols::averageDistance [private] |
The average distane to the ball
Definition at line 84 of file BallSymbols.h.
Referenced by registerSymbols(), and update().
RingBufferWithSum<60> BallSymbols::ballDistanceRingBuffer [private] |
A ring buffer needed to calculate the average ball distance
Definition at line 81 of file BallSymbols.h.
Referenced by update().
bool BallSymbols::ballIsHandledAtTheMoment [private] |
Whether the ball is handled at the moment
Definition at line 87 of file BallSymbols.h.
Referenced by registerSymbols(), and update().
int BallSymbols::ballPrecision [private] |
int BallSymbols::ballWasHandledInLastFrame [private] |
Whether the ball was handled in the last frame
Definition at line 90 of file BallSymbols.h.
Referenced by registerSymbols(), and update().
bool BallSymbols::playBallPrecisely [private] |