#include <BallModel.h>
Inheritance diagram for BallState:


Public Member Functions | |
| BallState () | |
| Standard constructor initializing the ball state. | |
| void | reset () |
| Resets all data of the ball state. | |
| void | setBallDataRelativeToRobot (const RobotPose &robotPose, double px, double py, double vx, double vy) |
| Sets the ball data with parameters relative to the robot. | |
| void | setBallDataRelativeToField (const RobotPose &robotPose, double px, double py, double vx, double vy) |
| Sets the ball data with parameters relative to the field. | |
| void | setPositionGaussianDataRelativeToRobot (const RobotPose &robotPose, double orientation, double majorAxis, double minorAxis) |
| Sets the gaussian distribution of the ball position relative to the robot. | |
| void | setPositionGaussianDataRelativeToField (const RobotPose &robotPose, double orientation, double majorAxis, double minorAxis) |
| Sets the gaussian distribution of the ball position relative to the field. | |
| void | setSpeedGaussianDataRelativeToRobot (const RobotPose &robotPose, double orientation, double majorAxis, double minorAxis) |
| Sets the gaussian distribution of the ball speed relative to the robot. | |
| void | setSpeedGaussianDataRelativeToField (const RobotPose &robotPose, double orientation, double majorAxis, double minorAxis) |
| Sets the gaussian distribution of the ball speed relative to the field. | |
| double | getPositionValidity () const |
| Returns a position validity in the range from 0.0 to 1.0. | |
| double | getSpeedValidity () const |
| Returns a speed validity in the range from 0.0 to 1.0. | |
| void | drawPosition (Drawings::Color color) const |
| Draws the position of the ball to the field. | |
| void | drawSpeed (Drawings::Color color) const |
| Draws the speed as arrow to the field. | |
| void | drawPositionGaussian (Drawings::Color color) const |
| Draws the position gaussian (if set) as the two axes of the ellipsis. | |
| void | drawSpeedGaussian (Drawings::Color color) const |
| Draws the speed gaussian (if set) as the two axes of the ellipsis. | |
| virtual void | serialize (In *in, Out *out) |
Public Attributes | |
| bool | useGivenProbabilities |
| If a ball locator calculates a ball position and velocity probability by itself it can set this variable to true and set the variable positionProb and velocityProb and the functions getPositionValidity and getSpeedValidity will return those values. | |
| double | positionProb |
| double | velocityProb |
| Vector2< double > | positionRobot |
| The position of the ball relative to the robot (in mm). | |
| Vector2< double > | speedRobot |
| The speed of the ball relative to the robot (in mm/s). | |
| Vector2< double > | positionField |
| The position of the ball relative to the field (in mm). | |
| Vector2< double > | speedField |
| The speed of the ball relative to the field (in mm/s). | |
| RobotPose | robotPose |
| The robot pose. | |
| bool | ballInFrontOfOpponentGoal |
| If true, the line from robot to ball crosses the goal line. | |
| bool | ballRollsByLeft |
| If true, the ball rolls by left in a short distance. | |
| bool | ballRollsFarByLeft |
| bool | ballRollsByRight |
| If true, the ball rolls by right in a short distance. | |
| bool | ballRollsFarByRight |
| bool | ballRollsTowardsRobot |
| If true, the ball rolls towards the robot. | |
| bool | ballRollsFast |
| If true, the ball has a high speed in any direction. | |
| double | projectedDistanceOnYAxis |
| this is the projected distance of the ball on the Y axis of the robot (in mm) | |
| long | timeTillBallCrossesYAxis |
| time in ms which the ball needs to cross the robots y axis | |
| bool | positionGaussSet |
| True if the position gauss was set. | |
| double | positionGaussOrientationRobot |
| The angle of the robot x-axis to the ellipse's major axis in radians. | |
| double | positionGaussOrientationField |
| The angle of the field x-axis to ellipse's major axis in radians. | |
| double | positionGaussMajAxis |
| The length of the ellipsis major axis (that is the standard deviation) (in mm). | |
| double | positionGaussMinAxis |
| The length of the ellipsis minor axis (that is the standard deviation) (in mm). | |
| bool | speedGaussSet |
| True if the position gauss was set. | |
| double | speedGaussOrientationRobot |
| The angle from the robot x-axis to ellipsis major axis in radians. | |
| double | speedGaussOrientationField |
| The angle from the field x-axis to ellipsis major axis in radians. | |
| double | speedGaussMajAxis |
| The length of the ellipsis major axis (that is the standard deviation) (in mm). | |
| double | speedGaussMinAxis |
| The length of the ellipsis minor axis (that is the standard deviation) (in mm). | |
Protected Member Functions | |
| void | setBallFlags () |
| Sets several ball flags from the actual ball state. | |
Static Protected Member Functions | |
| Vector2< double > | positionVectorFromRobotToField (const RobotPose &robotPose, const Vector2< double > &pv) |
| Converts a position vector relative to the robot to a position vector relative to the field. | |
| Vector2< double > | directionVectorFromRobotToField (const RobotPose &robotPose, const Vector2< double > &dv) |
| Converts a direction vector relative to the robot to a direction vector relative to the field. | |
| double | orientationFromRobotToField (const RobotPose &robotPose, double orientation) |
| Converts an orientation (in radians) relative to the robot to an orientation relative to the field. | |
| Vector2< double > | positionVectorFromFieldToRobot (const RobotPose &robotPose, const Vector2< double > &pv) |
| Converts a position vector relative to the field to a position vector relative to the robot. | |
| Vector2< double > | directionVectorFromFieldToRobot (const RobotPose &robotPose, const Vector2< double > &dv) |
| Converts a direction vector relative to the field to a direction vector relative to the robot. | |
| double | orientationFromFieldToRobot (const RobotPose &robotPose, double orientation) |
| Converts an orientation (in radians) relative to the field to an orientation relative to the robot. | |
Definition at line 26 of file BallModel.h.
|
|
Standard constructor initializing the ball state.
Definition at line 18 of file BallModel.cpp. References reset(), and useGivenProbabilities. |
Here is the call graph for this function:

|
|
Resets all data of the ball state.
Reimplemented in SeenBallState, PropagatedBallState, and CommunicatedBallState. Definition at line 24 of file BallModel.cpp. References ballInFrontOfOpponentGoal, ballRollsByLeft, ballRollsByRight, ballRollsFarByLeft, ballRollsFarByRight, ballRollsFast, ballRollsTowardsRobot, positionField, positionGaussSet, positionProb, positionRobot, projectedDistanceOnYAxis, robotPose, speedField, speedGaussSet, speedRobot, timeTillBallCrossesYAxis, and velocityProb. Referenced by BallState(), BallModel::reset(), CommunicatedBallState::reset(), PropagatedBallState::reset(), and SeenBallState::reset(). |
|
||||||||||||||||||||||||
|
Sets the ball data with parameters relative to the robot. The parameters relative to the field are *automatically* generated.
Definition at line 50 of file BallModel.cpp. References directionVectorFromRobotToField(), positionField, positionRobot, positionVectorFromRobotToField(), setBallFlags(), speedField, speedRobot, Vector2< double >::x, and Vector2< double >::y. Referenced by GTCamBallLocator::execute(), and GT2005BallLocator::setBallSymbols(). |
Here is the call graph for this function:

|
||||||||||||||||||||||||
|
Sets the ball data with parameters relative to the field. The parameters relative to the robot are *automatically* generated.
Definition at line 69 of file BallModel.cpp. References directionVectorFromFieldToRobot(), positionField, positionRobot, positionVectorFromFieldToRobot(), setBallFlags(), speedField, speedRobot, Vector2< double >::x, and Vector2< double >::y. Referenced by GT2005TeamBallLocator::execute(), GTCamWorldState::getBallModel(), and CLogAnalyzerBase::readRemoteCamWorldState(). |
Here is the call graph for this function:

|
||||||||||||||||||||
|
Sets the gaussian distribution of the ball position relative to the robot. The distribution relative to the field is *automatically* generated.
Definition at line 88 of file BallModel.cpp. References orientationFromRobotToField(), positionGaussMajAxis, positionGaussMinAxis, positionGaussOrientationField, positionGaussOrientationRobot, and positionGaussSet. |
Here is the call graph for this function:

|
||||||||||||||||||||
|
Sets the gaussian distribution of the ball position relative to the field. The distribution relative to the robot is *automatically* generated.
Definition at line 102 of file BallModel.cpp. References orientationFromFieldToRobot(), positionGaussMajAxis, positionGaussMinAxis, positionGaussOrientationField, positionGaussOrientationRobot, and positionGaussSet. |
Here is the call graph for this function:

|
||||||||||||||||||||
|
Sets the gaussian distribution of the ball speed relative to the robot. The distribution relative to the field is *automatically* generated.
Definition at line 116 of file BallModel.cpp. References orientationFromRobotToField(), speedGaussMajAxis, speedGaussMinAxis, speedGaussOrientationField, speedGaussOrientationRobot, and speedGaussSet. |
Here is the call graph for this function:

|
||||||||||||||||||||
|
Sets the gaussian distribution of the ball speed relative to the field. The distribution relative to the robot is *automatically* generated.
Definition at line 130 of file BallModel.cpp. References orientationFromFieldToRobot(), speedGaussMajAxis, speedGaussMinAxis, speedGaussOrientationField, speedGaussOrientationRobot, and speedGaussSet. |
Here is the call graph for this function:

|
|
Returns a position validity in the range from 0.0 to 1.0. This validity is calculated from the position gauss if present. Probably there are more sophisticated ways to calc the validity from the gaussian distribution.
Definition at line 144 of file BallModel.cpp. References max, positionGaussMajAxis, positionGaussMinAxis, positionGaussSet, positionProb, and useGivenProbabilities. Referenced by BallModel::getKnownBallState(), BallModel::getKnownPosition(), and BallSymbols::getPositionValidity(). |
|
|
Returns a speed validity in the range from 0.0 to 1.0. This validity is calculated from the speed gauss if present. Probably there are more sophisticated ways to calc the validity from the gaussian distribution.
Definition at line 154 of file BallModel.cpp. References max, speedGaussMajAxis, speedGaussMinAxis, speedGaussSet, useGivenProbabilities, and velocityProb. Referenced by BallSymbols::getSpeedValidity(). |
|
|
Draws the position of the ball to the field. Drawing must be finished by the caller with DEBUG_DRAWING_FINISHED(ballLocatorField).
Definition at line 164 of file BallModel.cpp. References CIRCLE, positionField, Vector2< double >::x, and Vector2< double >::y. |
|
|
Draws the speed as arrow to the field. Drawing must be finished by the caller with DEBUG_DRAWING_FINISHED(ballLocatorField).
Definition at line 170 of file BallModel.cpp. References ARROW, positionField, speedField, Vector2< double >::x, and Vector2< double >::y. |
|
|
Draws the position gaussian (if set) as the two axes of the ellipsis. Drawing must be finished by the caller with DEBUG_DRAWING_FINISHED(ballLocatorField).
Definition at line 177 of file BallModel.cpp. References LINE, positionField, positionGaussMajAxis, positionGaussMinAxis, positionGaussOrientationField, positionGaussSet, Vector2< double >::x, and Vector2< double >::y. |
|
|
Draws the speed gaussian (if set) as the two axes of the ellipsis. Drawing must be finished by the caller with DEBUG_DRAWING_FINISHED(ballLocatorField).
Definition at line 201 of file BallModel.cpp. |
|
|
Sets several ball flags from the actual ball state.
Definition at line 205 of file BallModel.cpp. References Vector2< double >::abs(), ballInFrontOfOpponentGoal, ballRollsByLeft, ballRollsByRight, ballRollsFarByLeft, ballRollsFarByRight, ballRollsFast, ballRollsTowardsRobot, positionField, positionRobot, projectedDistanceOnYAxis, robotPose, speedRobot, timeTillBallCrossesYAxis, Pose2D::translation, Vector2< double >::x, and Vector2< double >::y. Referenced by setBallDataRelativeToField(), and setBallDataRelativeToRobot(). |
Here is the call graph for this function:

|
||||||||||||
|
Converts a position vector relative to the robot to a position vector relative to the field.
Definition at line 281 of file BallModel.cpp. References Pose2D::getCos(), Pose2D::getSin(), Pose2D::translation, Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y. Referenced by setBallDataRelativeToRobot(). |
Here is the call graph for this function:

|
||||||||||||
|
Converts a direction vector relative to the robot to a direction vector relative to the field.
Definition at line 292 of file BallModel.cpp. References Pose2D::getCos(), Pose2D::getSin(), Vector2< V >::x, and Vector2< V >::y. Referenced by setBallDataRelativeToRobot(). |
Here is the call graph for this function:

|
||||||||||||
|
Converts an orientation (in radians) relative to the robot to an orientation relative to the field.
Definition at line 303 of file BallModel.cpp. References normalize(), and Pose2D::rotation. Referenced by setPositionGaussianDataRelativeToRobot(), and setSpeedGaussianDataRelativeToRobot(). |
Here is the call graph for this function:

|
||||||||||||
|
Converts a position vector relative to the field to a position vector relative to the robot.
Definition at line 310 of file BallModel.cpp. References Pose2D::getCos(), Pose2D::getSin(), Pose2D::translation, Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y. Referenced by setBallDataRelativeToField(). |
Here is the call graph for this function:

|
||||||||||||
|
Converts a direction vector relative to the field to a direction vector relative to the robot.
Definition at line 323 of file BallModel.cpp. References Pose2D::getCos(), Pose2D::getSin(), Vector2< V >::x, and Vector2< V >::y. Referenced by setBallDataRelativeToField(). |
Here is the call graph for this function:

|
||||||||||||
|
Converts an orientation (in radians) relative to the field to an orientation relative to the robot.
Definition at line 334 of file BallModel.cpp. References normalize(), and Pose2D::rotation. Referenced by setPositionGaussianDataRelativeToField(), and setSpeedGaussianDataRelativeToField(). |
Here is the call graph for this function:

|
||||||||||||
|
Implements Streamable. Reimplemented in SeenBallState, PropagatedBallState, and CommunicatedBallState. Definition at line 341 of file BallModel.cpp. References ballInFrontOfOpponentGoal, ballRollsByLeft, ballRollsByRight, ballRollsFast, ballRollsTowardsRobot, positionField, positionGaussMajAxis, positionGaussMinAxis, positionGaussOrientationField, positionGaussOrientationRobot, positionGaussSet, positionRobot, projectedDistanceOnYAxis, robotPose, speedField, speedGaussMajAxis, speedGaussMinAxis, speedGaussOrientationField, speedGaussOrientationRobot, speedGaussSet, speedRobot, STREAM, STREAM_REGISTER_BEGIN, STREAM_REGISTER_FINISH, and timeTillBallCrossesYAxis. |
|
|
If a ball locator calculates a ball position and velocity probability by itself it can set this variable to true and set the variable positionProb and velocityProb and the functions getPositionValidity and getSpeedValidity will return those values.
Definition at line 283 of file BallModel.h. Referenced by BallState(), getPositionValidity(), getSpeedValidity(), GT2005BallLocator::GT2005BallLocator(), and GT2005TeamBallLocator::GT2005TeamBallLocator(). |
|
|
Definition at line 284 of file BallModel.h. Referenced by GT2005TeamBallLocator::execute(), BallSymbols::getKnownOrNearProbability(), getPositionValidity(), BallSymbols::getPropagatedPositionValidity(), BallSymbols::getSeenPositionValidity(), reset(), and GT2005BallLocator::setBallSymbols(). |
|
|
Definition at line 285 of file BallModel.h. Referenced by GT2005TeamBallLocator::execute(), BallSymbols::getPropagatedVelocityValidity(), BallSymbols::getSeenVelocityValidity(), getSpeedValidity(), reset(), and GT2005BallLocator::setBallSymbols(). |
|
|
|
|
|
The speed of the ball relative to the field (in mm/s).
Definition at line 297 of file BallModel.h. Referenced by KickLoggerSymbols::ballHasStopped(), drawSpeed(), GTCamSymbols::getBallSpeedX(), GTCamSymbols::getBallSpeedY(), BallSymbols::getKnownOrNearSpeedAbs(), BallSymbols::getKnownOrNearSpeedX(), BallSymbols::getKnownOrNearSpeedY(), BallSymbols::getPropagatedSpeedX(), BallSymbols::getPropagatedSpeedY(), BallSymbols::getSeenSpeed(), BallSymbols::getSeenSpeedX(), BallSymbols::getSeenSpeedY(), CLogAnalyzerBase::readRemoteCamWorldState(), reset(), serialize(), setBallDataRelativeToField(), and setBallDataRelativeToRobot(). |
|
|
The robot pose.
Definition at line 300 of file BallModel.h. Referenced by reset(), serialize(), and setBallFlags(). |
|
|
If true, the line from robot to ball crosses the goal line.
Definition at line 303 of file BallModel.h. Referenced by GT2005StrategySymbols::computeRole(), GTCamBallLocator::execute(), BallSymbols::getBallSeenInFrontOfOpponentGoal(), reset(), serialize(), setBallFlags(), and GT2005BallLocator::setBallSymbols(). |
|
|
If true, the ball rolls by left in a short distance.
Definition at line 306 of file BallModel.h. Referenced by GT2005BehaviorControl::postExecute(), BallSymbols::registerSymbols(), reset(), serialize(), and setBallFlags(). |
|
|
Definition at line 307 of file BallModel.h. Referenced by BallSymbols::registerSymbols(), reset(), and setBallFlags(). |
|
|
If true, the ball rolls by right in a short distance.
Definition at line 310 of file BallModel.h. Referenced by GT2005BehaviorControl::postExecute(), BallSymbols::registerSymbols(), reset(), serialize(), and setBallFlags(). |
|
|
Definition at line 311 of file BallModel.h. Referenced by BallSymbols::registerSymbols(), reset(), and setBallFlags(). |
|
|
If true, the ball rolls towards the robot.
Definition at line 314 of file BallModel.h. Referenced by GT2005BehaviorControl::postExecute(), BallSymbols::registerSymbols(), reset(), serialize(), and setBallFlags(). |
|
|
If true, the ball has a high speed in any direction.
Definition at line 317 of file BallModel.h. Referenced by GT2005BehaviorControl::postExecute(), BallSymbols::registerSymbols(), reset(), serialize(), and setBallFlags(). |
|
|
this is the projected distance of the ball on the Y axis of the robot (in mm)
Definition at line 321 of file BallModel.h. Referenced by BallSymbols::getProjectedDistanceOnYAxis(), reset(), serialize(), and setBallFlags(). |
|
|
time in ms which the ball needs to cross the robots y axis
Definition at line 324 of file BallModel.h. Referenced by BallSymbols::getTimeUntilBallCrossesYAxis(), reset(), serialize(), and setBallFlags(). |
|
|
True if the position gauss was set.
Definition at line 327 of file BallModel.h. Referenced by drawPositionGaussian(), getPositionValidity(), reset(), serialize(), setPositionGaussianDataRelativeToField(), and setPositionGaussianDataRelativeToRobot(). |
|
|
The angle of the robot x-axis to the ellipse's major axis in radians.
Definition at line 330 of file BallModel.h. Referenced by serialize(), setPositionGaussianDataRelativeToField(), and setPositionGaussianDataRelativeToRobot(). |
|
|
The angle of the field x-axis to ellipse's major axis in radians.
Definition at line 333 of file BallModel.h. Referenced by drawPositionGaussian(), serialize(), setPositionGaussianDataRelativeToField(), and setPositionGaussianDataRelativeToRobot(). |
|
|
The length of the ellipsis major axis (that is the standard deviation) (in mm).
Definition at line 337 of file BallModel.h. Referenced by drawPositionGaussian(), getPositionValidity(), serialize(), setPositionGaussianDataRelativeToField(), and setPositionGaussianDataRelativeToRobot(). |
|
|
The length of the ellipsis minor axis (that is the standard deviation) (in mm).
Definition at line 341 of file BallModel.h. Referenced by drawPositionGaussian(), getPositionValidity(), serialize(), setPositionGaussianDataRelativeToField(), and setPositionGaussianDataRelativeToRobot(). |
|
|
True if the position gauss was set.
Definition at line 344 of file BallModel.h. Referenced by getSpeedValidity(), reset(), serialize(), setSpeedGaussianDataRelativeToField(), and setSpeedGaussianDataRelativeToRobot(). |
|
|
The angle from the robot x-axis to ellipsis major axis in radians.
Definition at line 347 of file BallModel.h. Referenced by serialize(), setSpeedGaussianDataRelativeToField(), and setSpeedGaussianDataRelativeToRobot(). |
|
|
The angle from the field x-axis to ellipsis major axis in radians.
Definition at line 350 of file BallModel.h. Referenced by serialize(), setSpeedGaussianDataRelativeToField(), and setSpeedGaussianDataRelativeToRobot(). |
|
|
The length of the ellipsis major axis (that is the standard deviation) (in mm).
Definition at line 354 of file BallModel.h. Referenced by getSpeedValidity(), serialize(), setSpeedGaussianDataRelativeToField(), and setSpeedGaussianDataRelativeToRobot(). |
|
|
The length of the ellipsis minor axis (that is the standard deviation) (in mm).
Definition at line 358 of file BallModel.h. Referenced by getSpeedValidity(), serialize(), setSpeedGaussianDataRelativeToField(), and setSpeedGaussianDataRelativeToRobot(). |
1.3.6