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

GT2005BallLocator Class Reference

A BallLocator using a particle filter. More...

#include <GT2005BallLocator.h>

Inheritance diagram for GT2005BallLocator:

Inheritance graph
[legend]
Collaboration diagram for GT2005BallLocator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GT2005BallLocator (const BallLocatorInterfaces &interfaces)
virtual void execute ()
virtual bool handleMessage (InMessage &message)
 Handles debug messages.

void modify ()
void measurementUpdate (Vector2< double > ballOffset, double reliability, double distanceValue, double panningVelocityValue, double robotSpeedValue)
void setBallSymbols ()
void drawParticle (const GT2005Particle &particle, Drawings::Color color) const
void draw (Drawings::Color particleColor, Drawings::Color estimatedBallColor) const

Private Member Functions

double getTimeFactor ()
void timeUpdate ()
void noNonsenseParticles ()
bool isNonSensePos (Vector2< double > position)
void initializeParticles ()
double calculateDistanceValue (Vector2< double > ballOffset)
double calculatePanningVelocityValue ()
double calculateRobotSpeedValue ()

Private Attributes

double oldX
double oldY
double timeChange
double dFieldDiagonalLength
double framesNoBallSeenThreshold
double ballX
double ballY
double ballVX
double ballVY
double ballP
double ballVP
CameraMatrix prevCameraMatrix
int frameNumber
Pose2D lastOdometryData
int framesNoBallSeen
unsigned long ballSeenTime
Vector2< double > lastPositionSeen
bool stateIsSet
unsigned long currentSystemTime
unsigned long lastSystemTime
double nonsensePos

Detailed Description

A BallLocator using a particle filter.

Definition at line 24 of file GT2005BallLocator.h.


Constructor & Destructor Documentation

GT2005BallLocator::GT2005BallLocator const BallLocatorInterfaces interfaces  ) 
 

Definition at line 14 of file GT2005BallLocator.cpp.

References ballSeenTime, currentSystemTime, dFieldDiagonalLength, framesNoBallSeen, SystemCall::getCurrentSystemTime(), initializeParticles(), lastOdometryData, lastPositionSeen, lastSystemTime, prevCameraMatrix, BallModel::propagated, BallModel::seen, stateIsSet, BallState::useGivenProbabilities, Vector2< double >::x, and Vector2< double >::y.

Here is the call graph for this function:


Member Function Documentation

void GT2005BallLocator::execute  )  [virtual]
 

(for the first time game state is "set")

(ballPercept.ballWasSeen && !(isNonSensePos(ballOffset))

Reimplemented from Module.

Definition at line 54 of file GT2005BallLocator.cpp.

References ballP, ballSeenTime, ballVP, ballVX, ballVY, BallPercept::ballWasSeen, ballX, ballY, BallHandling::behaviorBallState, calculateDistanceValue(), GT2005ParticleContainer::calculateEstimatedBall(), calculatePanningVelocityValue(), calculateRobotSpeedValue(), currentSystemTime, GameControlData::data, draw(), framesNoBallSeen, SystemCall::getCurrentSystemTime(), initializeParticles(), isNonSensePos(), lastOdometryData, lastPositionSeen, lastSystemTime, measurementUpdate(), modify(), BallPercept::multiplePercepts, noNonsenseParticles(), MultipleBallPerceptList::numberOfElements, BallPercept::offsetOnField, oldX, oldY, MultipleBallPerceptList::panningVelocityError, prevCameraMatrix, BallPercept::reliability, setBallSymbols(), stateIsSet, timeChange, timeUpdate(), Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

Here is the call graph for this function:

bool GT2005BallLocator::handleMessage InMessage message  )  [virtual]
 

Handles debug messages.

Parameters:
message The message
Returns:
true if message was handled

Reimplemented from Module.

Definition at line 728 of file GT2005BallLocator.cpp.

References InMessage::bin, GenericDebugData::data, InMessage::getMessageID(), idGT2005BallLocator1, and idGT2005BallLocator2.

Here is the call graph for this function:

void GT2005BallLocator::modify  ) 
 

Definition at line 768 of file GT2005BallLocator.cpp.

References MODIFY.

Referenced by execute().

void GT2005BallLocator::measurementUpdate Vector2< double >  ballOffset,
double  reliability,
double  distanceValue,
double  panningVelocityValue,
double  robotSpeedValue
 

(distance < timesBallRadius * ballRadius)

Definition at line 333 of file GT2005BallLocator.cpp.

References Geometry::distanceTo(), GT2005ParticleContainer::getIndexOfParticleWithLowestProb(), GT2005ParticleContainer::getNumberOfSamples(), GT2005Particle::getPosition(), min, GT2005Particle::pose, GT2005Particle::probability, GT2005Particle::provx, GT2005Particle::provy, random(), GT2005Particle::seenvx, GT2005Particle::seenvy, timeChange, GT2005Particle::vprob, GT2005Particle::vx, GT2005Particle::vy, Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

Referenced by execute().

Here is the call graph for this function:

void GT2005BallLocator::setBallSymbols  ) 
 

Definition at line 495 of file GT2005BallLocator.cpp.

References Vector2< double >::abs(), Vector2< double >::angle(), BallState::ballInFrontOfOpponentGoal, ballP, ballSeenTime, ballVP, ballVX, ballVY, BallModel::ballWasSeen, BallPercept::ballWasSeen, ballX, ballY, Goal::color, currentSystemTime, getPlayer(), Player::getTeamColor(), LandmarksPercept::goals, lastOdometryData, lastPositionSeen, PropagatedBallState::lastSeenBallState, Range< double >::max, max, Range< double >::min, LandmarksPercept::numberOfGoals, BallModel::numberOfImagesWithBallPercept, BallModel::numberOfImagesWithoutBallPercept, oldX, oldY, BallState::positionProb, BallState::positionRobot, BallModel::propagated, BallPercept::reliability, Pose2D::rotation, BallModel::seen, BallState::setBallDataRelativeToRobot(), BallPercept::sizeBasedOffsetOnField, SeenBallState::timeUntilSeenConsecutively, SeenBallState::timeWhenFirstSeenConsecutively, SeenBallState::timeWhenLastSeen, Pose2D::translation, BallState::velocityProb, Boundary< double >::x, Vector2< V >::x, Vector2< double >::x, and Vector2< double >::y.

Referenced by execute().

Here is the call graph for this function:

void GT2005BallLocator::drawParticle const GT2005Particle particle,
Drawings::Color  color
const
 

Definition at line 808 of file GT2005BallLocator.cpp.

References ARROW, CIRCLE, GT2005Particle::getPosition(), GT2005Particle::getVelocity(), NARROW, NCIRCLE, GT2005Particle::probability, Geometry::relative2FieldCoord(), Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

Referenced by draw().

Here is the call graph for this function:

void GT2005BallLocator::draw Drawings::Color  particleColor,
Drawings::Color  estimatedBallColor
const
 

Definition at line 851 of file GT2005BallLocator.cpp.

References ARROW, ballP, ballVX, ballVY, ballX, ballY, CIRCLE, DEBUG_DRAWING_FINISHED, drawParticle(), GT2005ParticleContainer::getNumberOfSamples(), BallPercept::multiplePercepts, NARROW, NCIRCLE, NCOLORED_LINE, NDECLARE_DEBUGDRAWING, MultipleBallPerceptList::numberOfElements, Geometry::relative2FieldCoord(), Pose2D::translation, Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y.

Referenced by execute().

Here is the call graph for this function:

double GT2005BallLocator::getTimeFactor  )  [private]
 

Definition at line 189 of file GT2005BallLocator.cpp.

References framesNoBallSeen.

Referenced by noNonsenseParticles(), and timeUpdate().

void GT2005BallLocator::timeUpdate  )  [private]
 

Definition at line 204 of file GT2005BallLocator.cpp.

References GT2005ParticleContainer::getNumberOfSamples(), getTimeFactor(), lastOdometryData, oldX, oldY, Pose2D::rotation, timeChange, Pose2D::translation, Vector2< double >::x, and Vector2< double >::y.

Referenced by execute().

Here is the call graph for this function:

void GT2005BallLocator::noNonsenseParticles  )  [private]
 

(randomValue < fNBSP)

Definition at line 597 of file GT2005BallLocator.cpp.

References ballP, ballX, ballY, dFieldDiagonalLength, Geometry::fieldCoord2Relative(), GT2005ParticleContainer::getNumberOfSamples(), getTimeFactor(), lastPositionSeen, GT2005Particle::pose, GT2005Particle::probability, random(), Geometry::relative2FieldCoord(), GT2005Particle::setParameters(), Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

Referenced by execute().

Here is the call graph for this function:

bool GT2005BallLocator::isNonSensePos Vector2< double >  position  )  [private]
 

Definition at line 585 of file GT2005BallLocator.cpp.

References dFieldDiagonalLength, nonsensePos, Vector2< V >::x, and Vector2< V >::y.

Referenced by execute().

void GT2005BallLocator::initializeParticles  )  [private]
 

Definition at line 166 of file GT2005BallLocator.cpp.

References ballP, ballVP, ballVX, ballVY, ballX, ballY, GT2005ParticleContainer::getNumberOfSamples(), random(), Pose2D::translation, Vector2< double >::x, and Vector2< double >::y.

Referenced by execute(), and GT2005BallLocator().

Here is the call graph for this function:

double GT2005BallLocator::calculateDistanceValue Vector2< double >  ballOffset  )  [private]
 

Definition at line 261 of file GT2005BallLocator.cpp.

References Vector2< V >::x, and Vector2< V >::y.

Referenced by execute().

double GT2005BallLocator::calculatePanningVelocityValue  )  [private]
 

Definition at line 282 of file GT2005BallLocator.cpp.

References CameraMatrix::frameNumber, getRobotConfiguration(), RobotConfiguration::getRobotDimensions(), RobotDimensions::motionCycleTime, normalize(), Vector2< V >::normalize(), prevCameraMatrix, Pose3D::rotation, Vector3< V >::x, and Vector3< V >::y.

Referenced by execute().

Here is the call graph for this function:

double GT2005BallLocator::calculateRobotSpeedValue  )  [private]
 

Definition at line 42 of file GT2005BallLocator.cpp.

References MotionInfo::executedMotionRequest, Pose2D::translation, WalkRequest::walkParams, and MotionRequest::walkRequest.

Referenced by execute().


Member Data Documentation

double GT2005BallLocator::oldX [private]
 

Definition at line 75 of file GT2005BallLocator.h.

Referenced by execute(), setBallSymbols(), and timeUpdate().

double GT2005BallLocator::oldY [private]
 

Definition at line 76 of file GT2005BallLocator.h.

Referenced by execute(), setBallSymbols(), and timeUpdate().

double GT2005BallLocator::timeChange [private]
 

Definition at line 79 of file GT2005BallLocator.h.

Referenced by execute(), measurementUpdate(), and timeUpdate().

double GT2005BallLocator::dFieldDiagonalLength [private]
 

Definition at line 82 of file GT2005BallLocator.h.

Referenced by GT2005BallLocator(), isNonSensePos(), and noNonsenseParticles().

double GT2005BallLocator::framesNoBallSeenThreshold [private]
 

Definition at line 85 of file GT2005BallLocator.h.

double GT2005BallLocator::ballX [private]
 

Definition at line 88 of file GT2005BallLocator.h.

Referenced by draw(), execute(), initializeParticles(), noNonsenseParticles(), and setBallSymbols().

double GT2005BallLocator::ballY [private]
 

Definition at line 89 of file GT2005BallLocator.h.

Referenced by draw(), execute(), initializeParticles(), noNonsenseParticles(), and setBallSymbols().

double GT2005BallLocator::ballVX [private]
 

Definition at line 90 of file GT2005BallLocator.h.

Referenced by draw(), execute(), initializeParticles(), and setBallSymbols().

double GT2005BallLocator::ballVY [private]
 

Definition at line 91 of file GT2005BallLocator.h.

Referenced by draw(), execute(), initializeParticles(), and setBallSymbols().

double GT2005BallLocator::ballP [private]
 

Definition at line 92 of file GT2005BallLocator.h.

Referenced by draw(), execute(), initializeParticles(), noNonsenseParticles(), and setBallSymbols().

double GT2005BallLocator::ballVP [private]
 

Definition at line 93 of file GT2005BallLocator.h.

Referenced by execute(), initializeParticles(), and setBallSymbols().

CameraMatrix GT2005BallLocator::prevCameraMatrix [private]
 

Definition at line 96 of file GT2005BallLocator.h.

Referenced by calculatePanningVelocityValue(), execute(), and GT2005BallLocator().

int GT2005BallLocator::frameNumber [private]
 

Definition at line 99 of file GT2005BallLocator.h.

Pose2D GT2005BallLocator::lastOdometryData [private]
 

Definition at line 102 of file GT2005BallLocator.h.

Referenced by execute(), GT2005BallLocator(), setBallSymbols(), and timeUpdate().

int GT2005BallLocator::framesNoBallSeen [private]
 

Definition at line 105 of file GT2005BallLocator.h.

Referenced by execute(), getTimeFactor(), and GT2005BallLocator().

unsigned long GT2005BallLocator::ballSeenTime [private]
 

Definition at line 108 of file GT2005BallLocator.h.

Referenced by execute(), GT2005BallLocator(), and setBallSymbols().

Vector2<double> GT2005BallLocator::lastPositionSeen [private]
 

Definition at line 111 of file GT2005BallLocator.h.

Referenced by execute(), GT2005BallLocator(), noNonsenseParticles(), and setBallSymbols().

bool GT2005BallLocator::stateIsSet [private]
 

Definition at line 114 of file GT2005BallLocator.h.

Referenced by execute(), and GT2005BallLocator().

unsigned long GT2005BallLocator::currentSystemTime [private]
 

Definition at line 121 of file GT2005BallLocator.h.

Referenced by execute(), GT2005BallLocator(), and setBallSymbols().

unsigned long GT2005BallLocator::lastSystemTime [private]
 

Definition at line 124 of file GT2005BallLocator.h.

Referenced by execute(), and GT2005BallLocator().

double GT2005BallLocator::nonsensePos [private]
 

Definition at line 152 of file GT2005BallLocator.h.

Referenced by isNonSensePos().


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 22:12:58 2006 for GT2005 by doxygen 1.3.6