#include <GT2004BallLocator.h>
Inheritance diagram for GT2004BallLocator:
Public Member Functions | |
GT2004BallLocator (BallLocatorInterfaces &interfaces) | |
virtual | ~GT2004BallLocator () |
virtual void | execute () |
Executes the GT2004BallLocator module. | |
virtual bool | handleMessage (InMessage &message) |
Handles idGT2004Data debug messages. | |
Private Member Functions | |
void | determineNumberOfImagesWith_WithoutBall () |
Counts the number of percepts that contained a ball or no ball. | |
void | handleSeenBall () |
Called if ball was seen. | |
void | handleUnseenBall () |
Called if ball was not seen. | |
void | compensateOdometry () |
Compensates the body movements. | |
void | setBallState () |
Checks if the ball rolls by right or left of the robot. | |
void | setBallStateV2 () |
Checks if the ball rolls by right or left of the robot, v2. | |
void | setUnknownResult () |
setUnknownResult is called if an exception occurs. | |
bool | isNonSensePos (double x, double y) |
True if passed position is nonsense. | |
void | addModel (KalmanProcessModelBase *pModel) |
Adds a process model to the list of managed process models. | |
void | destroyModels () |
Frees the managed process models. | |
void | sendProcessModelStates () |
Sends the process model states as debug messages. | |
void | drawBallPosition () |
Draws the global ball positions and data model ball positions on the field. | |
Vector2< double > | relative2FieldCoord (RobotPose rp, double x, double y) |
Private Attributes | |
unsigned long int | lastFrameNumber |
bool | ballWasSeenInLastImage |
std::vector< KalmanProcessModelBase * > | kalmanModels |
Vector containing all instantiated process models. | |
std::vector< KalmanUpdateResult > | kalmanUpdateResults |
Vector containing the result of calls to the update function of the process models. | |
std::vector< KalmanPredictResult > | kalmanPredictResults |
Vector containing the result of calls to the predict function of the process models. | |
double | x_rel |
x-position of ball relative to robot | |
double | y_rel |
y-position relative to robot | |
double | x_abs |
x-position of ball on field | |
double | y_abs |
y-position of ball on field | |
double | vx_rel |
speed of ball in x-direction relative to robot | |
double | vy_rel |
speed of ball in y-direction relative to robot | |
double | vx_abs |
speed of ball in x-direction on field | |
double | vy_abs |
speed of ball in y-direction on field | |
bool | ballWasSeen |
true if ball was seen | |
double | last_seen_x_rel |
x-position of last seen ball relative to robot | |
double | last_seen_y_rel |
y-position of last seen ball relative to robot | |
OdometryData | lastOdometry |
Last odometry data of robot. | |
bool | bSendProcessModelStates |
If true, process model states are sent as debug messages. | |
bool | freshDefend |
Vector2< double > | ballSensedPos |
Vector2< double > | ballSensedRelPos |
unsigned long | ballSensedTime |
CameraMatrix | prevCameraMatrix |
Vector2< double > | lastBallSeen |
Pose2D | lastRobotOdometry |
Static Private Attributes | |
double | dFieldDiagonalLength |
1.2*length of field diagonal |
This class is the main class managing different GT2004 process models
Definition at line 24 of file GT2004BallLocator.h.
|
Definition at line 22 of file GT2004BallLocator.cpp. References addModel(), ballSensedPos, ballSensedRelPos, ballSensedTime, ballWasSeenInLastImage, bSendProcessModelStates, freshDefend, last_seen_x_rel, last_seen_y_rel, vx_abs, vx_rel, vy_abs, vy_rel, Vector2< double >::x, x_abs, x_rel, Vector2< double >::y, y_abs, and y_rel. |
Here is the call graph for this function:
|
Definition at line 59 of file GT2004BallLocator.cpp. References destroyModels(). |
Here is the call graph for this function:
|
Here is the call graph for this function:
|
Handles idGT2004Data debug messages.
Reimplemented from Module. Definition at line 620 of file GT2004BallLocator.cpp. References OutMessage::bin, InMessage::bin, OutMessage::finishMessage(), getDebugOut(), InMessage::getMessageID(), idGT2004BallLocatorData, kalmanModels, and InMessage::resetReadPosition(). |
Here is the call graph for this function:
|
Counts the number of percepts that contained a ball or no ball.
Definition at line 793 of file GT2004BallLocator.cpp. References BallModel::ballWasSeen, BallPercept::ballWasSeen, ballWasSeenInLastImage, lastFrameNumber, BallModel::numberOfImagesWithBallPercept, and BallModel::numberOfImagesWithoutBallPercept. Referenced by execute(). |
|
Here is the call graph for this function:
|
Called if ball was not seen. Performs predict step. Definition at line 330 of file GT2004BallLocator.cpp. References SystemCall::getCurrentSystemTime(), idText, kalmanModels, kalmanPredictResults, last_seen_x_rel, last_seen_y_rel, PropagatedBallPosition::observedSpeed, OUTPUT, PropagatedBallPosition::positionWhenLastObserved, BallModel::propagated, Geometry::relative2FieldCoord(), Pose2D::rotation, BallModel::seen, setUnknownResult(), PropagatedBallPosition::timeOfObservation, vx_abs, vx_rel, vy_abs, vy_rel, Vector2< double >::x, Vector2< V >::x, x_abs, x_rel, Vector2< double >::y, Vector2< V >::y, y_abs, and y_rel. Referenced by execute(), and handleSeenBall(). |
Here is the call graph for this function:
|
Compensates the body movements.
Definition at line 446 of file GT2004BallLocator.cpp. References last_seen_x_rel, last_seen_y_rel, Vector2< V >::x, and Vector2< V >::y. Referenced by execute(). |
|
Checks if the ball rolls by right or left of the robot.
Definition at line 458 of file GT2004BallLocator.cpp. References BallState::ballRollsByLeft, BallState::ballRollsByRight, BallState::ballRollsTowardsRobot, BallModel::ballState, BallState::projectedDistanceOnYAxis, BallState::reset(), BallState::timeBallCrossesYAxis, vx_rel, vy_rel, x_rel, and y_rel. Referenced by execute(). |
Here is the call graph for this function:
|
Checks if the ball rolls by right or left of the robot, v2.
Meanings of the constants: If the ball is farer away than defendZone2Border from the robot then freshDefend is set to true. This is just a kind of hysteresis to reset the "sensing" for the ballStates. To sense a ball state, the ball has to be detected first in a range smaller than defendZone2Border, and after that in a range smaller than defendZone1Border. The maximum time between the detections in zone2 and zone1 has to be smaller than speedTrigger (in ms). The ballHasMovedThreshold is used to determine, if the ball has moved or the robot, since only relative ball positions are used. The difference between the absolute ball positions in zone2 and zone1 has to be greater than this threshold to identify the ball as moving, rather than the robot. The ballIsFastThreshold is used to determine if the ball rolls fast. Value is mm/s. Definition at line 494 of file GT2004BallLocator.cpp. References BallState::ballRollsByLeft, BallState::ballRollsByRight, BallState::ballRollsTowardsRobot, ballSensedPos, ballSensedRelPos, ballSensedTime, BallModel::ballState, Geometry::distanceTo(), freshDefend, SystemCall::getCurrentSystemTime(), RobotPose::getPose(), BallState::projectedDistanceOnYAxis, BallState::reset(), BallModel::seen, BallState::timeBallCrossesYAxis, toDegrees(), vx_rel, Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y. |
Here is the call graph for this function:
|
setUnknownResult is called if an exception occurs. However, this should not happen, but if, this prevents the robot from crashing. Definition at line 588 of file GT2004BallLocator.cpp. References BallModel::propagated, Vector2< double >::x, x_abs, Vector2< double >::y, and y_abs. Referenced by handleSeenBall(), and handleUnseenBall(). |
|
True if passed position is nonsense.
Definition at line 595 of file GT2004BallLocator.cpp. References dFieldDiagonalLength. Referenced by handleSeenBall(). |
|
Adds a process model to the list of managed process models.
Definition at line 604 of file GT2004BallLocator.cpp. References kalmanModels, kalmanPredictResults, and kalmanUpdateResults. Referenced by GT2004BallLocator(). |
|
Frees the managed process models.
Definition at line 612 of file GT2004BallLocator.cpp. References kalmanModels. Referenced by ~GT2004BallLocator(). |
|
Sends the process model states as debug messages.
Definition at line 669 of file GT2004BallLocator.cpp. References OutMessage::bin, OutMessage::finishMessage(), SystemCall::getCurrentSystemTime(), getDebugOut(), idGT2004BallLocatorData, kalmanModels, kalmanPredictResults, kalmanUpdateResults, vx_rel, vy_rel, x_rel, and y_rel. Referenced by execute(). |
Here is the call graph for this function:
|
Draws the global ball positions and data model ball positions on the field.
Definition at line 741 of file GT2004BallLocator.cpp. References CIRCLE, DEBUG_DRAWING_FINISHED, kalmanModels, kalmanPredictResults, kalmanUpdateResults, LINE, Geometry::relative2FieldCoord(), vx_abs, vy_abs, Vector2< V >::x, x_abs, Vector2< V >::y, and y_abs. Referenced by execute(). |
Here is the call graph for this function:
|
|
|
Definition at line 98 of file GT2004BallLocator.h. Referenced by determineNumberOfImagesWith_WithoutBall(). |
|
Definition at line 99 of file GT2004BallLocator.h. Referenced by determineNumberOfImagesWith_WithoutBall(), and GT2004BallLocator(). |
|
Vector containing all instantiated process models.
Definition at line 102 of file GT2004BallLocator.h. Referenced by addModel(), destroyModels(), drawBallPosition(), handleMessage(), handleSeenBall(), handleUnseenBall(), and sendProcessModelStates(). |
|
Vector containing the result of calls to the update function of the process models.
Definition at line 105 of file GT2004BallLocator.h. Referenced by addModel(), drawBallPosition(), handleSeenBall(), and sendProcessModelStates(). |
|
Vector containing the result of calls to the predict function of the process models.
Definition at line 108 of file GT2004BallLocator.h. Referenced by addModel(), drawBallPosition(), handleUnseenBall(), and sendProcessModelStates(). |
|
x-position of ball relative to robot
Definition at line 110 of file GT2004BallLocator.h. Referenced by GT2004BallLocator(), handleSeenBall(), handleUnseenBall(), sendProcessModelStates(), and setBallState(). |
|
y-position relative to robot
Definition at line 111 of file GT2004BallLocator.h. Referenced by GT2004BallLocator(), handleSeenBall(), handleUnseenBall(), sendProcessModelStates(), and setBallState(). |
|
x-position of ball on field
Definition at line 112 of file GT2004BallLocator.h. Referenced by drawBallPosition(), GT2004BallLocator(), handleSeenBall(), handleUnseenBall(), and setUnknownResult(). |
|
y-position of ball on field
Definition at line 113 of file GT2004BallLocator.h. Referenced by drawBallPosition(), GT2004BallLocator(), handleSeenBall(), handleUnseenBall(), and setUnknownResult(). |
|
speed of ball in x-direction relative to robot
Definition at line 114 of file GT2004BallLocator.h. Referenced by GT2004BallLocator(), handleSeenBall(), handleUnseenBall(), sendProcessModelStates(), setBallState(), and setBallStateV2(). |
|
speed of ball in y-direction relative to robot
Definition at line 115 of file GT2004BallLocator.h. Referenced by GT2004BallLocator(), handleSeenBall(), handleUnseenBall(), sendProcessModelStates(), and setBallState(). |
|
speed of ball in x-direction on field
Definition at line 117 of file GT2004BallLocator.h. Referenced by drawBallPosition(), GT2004BallLocator(), handleSeenBall(), and handleUnseenBall(). |
|
speed of ball in y-direction on field
Definition at line 118 of file GT2004BallLocator.h. Referenced by drawBallPosition(), GT2004BallLocator(), handleSeenBall(), and handleUnseenBall(). |
|
true if ball was seen
Definition at line 119 of file GT2004BallLocator.h. |
|
x-position of last seen ball relative to robot
Definition at line 120 of file GT2004BallLocator.h. Referenced by compensateOdometry(), GT2004BallLocator(), handleSeenBall(), and handleUnseenBall(). |
|
y-position of last seen ball relative to robot
Definition at line 121 of file GT2004BallLocator.h. Referenced by compensateOdometry(), GT2004BallLocator(), handleSeenBall(), and handleUnseenBall(). |
|
Last odometry data of robot.
Definition at line 124 of file GT2004BallLocator.h. |
|
If true, process model states are sent as debug messages.
Definition at line 127 of file GT2004BallLocator.h. Referenced by execute(), and GT2004BallLocator(). |
|
Initial value: 1.2*sqrt((2.0*xPosOpponentGoal)*(2.0*xPosOpponentGoal) + (2.0*yPosLeftFlags)*(2.0*yPosLeftFlags))
Definition at line 18 of file GT2004BallLocator.cpp. Referenced by isNonSensePos(). |
|
Definition at line 134 of file GT2004BallLocator.h. Referenced by GT2004BallLocator(), and setBallStateV2(). |
|
Definition at line 135 of file GT2004BallLocator.h. Referenced by GT2004BallLocator(), and setBallStateV2(). |
|
Definition at line 136 of file GT2004BallLocator.h. Referenced by GT2004BallLocator(), and setBallStateV2(). |
|
Definition at line 137 of file GT2004BallLocator.h. Referenced by GT2004BallLocator(), and setBallStateV2(). |
|
Definition at line 139 of file GT2004BallLocator.h. Referenced by execute(), and handleSeenBall(). |
|
Definition at line 142 of file GT2004BallLocator.h. Referenced by execute(). |
|
Definition at line 144 of file GT2004BallLocator.h. Referenced by execute(). |