#include <GT2005SelfLocator.h>
Inheritance diagram for GT2005SelfLocator:


Public Member Functions | |
| GT2005SelfLocator (const SelfLocatorInterfaces &interfaces) | |
| Constructor. | |
| virtual void | execute () |
| The function executes the module. | |
| virtual bool | handleMessage (InMessage &message) |
| Called from a MessageQueue to distribute messages. | |
Private Types | |
| enum | FlagSides { LEFT_SIDE_OF_FLAG = 1, RIGHT_SIDE_OF_FLAG = -1 } |
| enum | { SAMPLES_MAX = 100, POSE_SPACE_GRID = 10, OBS_TABLE_X_FIELD_LINE = LinesPercept::field, OBS_TABLE_Y_FIELD_LINE = LinesPercept::numberOfLineTypes, NUM_OF_CALCULATED_POSES = 3 } |
Private Member Functions | |
| double | gaussian (double d) const |
| The function distributes the parameter in a Gaussian way. | |
| void | motionUpdate (const Pose2D &odometry, const Pose2D &camera, bool noise) |
| The function updates the samples by the odometry offset. | |
| void | updateByFlag (const Vector2< double > &flagFieldPosition, FlagSides sideOfFlag, double measuredBearing) |
| The function updates the samples by a single edge of a flag recognized. | |
| void | updateByGoalPost (const Vector2< double > &goalPost, double measuredBearing) |
| The function updates the samples by a single goal post recognized. | |
| void | landmarksObservationUpdate (const LandmarksPercept &landmarksPercept) |
| The function updates the samples by the recognized landmarks (goal, flag..) triggers updateByFlag and updateByGoalPost. | |
| GT2005LineCrossingsTable::CrossingClass | getCrossingClassification (const LinesPercept::LineCrossingPoint &point) |
| calculates the CrossingClass out of the classification (side1..side4) in the LinesPercept | |
| void | updateByCenterCircle (const LinesPercept::CenterCircle ¢erCircle) |
| observationUpdate by the center circle | |
| void | updateByCrossing (const LinesPercept::LineCrossingPoint &point) |
| observationUpdate using the linecrossing percept | |
| void | updateByPoint (const LinesPercept::LinePoint &point, GT2005SelfLocatorSample::PerceptType type, LinesPercept::LineType observationTableIndex) |
| does an observationupdate with a point on the field (line or goal) | |
| void | lineObservationUpdate (const LinesPercept &linesPercept) |
| The function updates the samples by recognized lines. | |
| double | calcAveragePerceptTypeProbabilities () |
| Calculates the average possibility for each perceptType and all samples and returns the product over all averages. | |
| void | resample () |
| redistibution of the sampleSet according to the probabilities of the samples | |
| double | calcDistributionValidityByStandardDeviation () |
| Calculates the localization validity by Standard Deviation. | |
| double | calcDistributionValidityByEntropy () |
| Calculates the localization validity by Entropy. | |
| RobotPose | calcPoseFromSubCube (Cell poseSpace[POSE_SPACE_GRID][POSE_SPACE_GRID][POSE_SPACE_GRID], int x, int y, int r) |
| The function calculates a Pose by averaging the sample poses in a sub cube of the pose-room. | |
| void | calcPose (Pose2D &pose, double &validity) |
| The function determines the most probable pose from the sample distribution. | |
| void | draw () const |
| The function draws the current sample set to a debug drawing. | |
| Drawings::Color | getSampleColor (double probability) const |
| Returns a color corresponding to the sample probability. | |
| void | draw (const Pose2D &pose, Drawings::Color color) const |
| The function draws an arrow to the sample set drawing. | |
| void | drawTestSample (const Pose2D &pose, Drawings::Color color) const |
| The function draws an arrow to the test sample drawing. | |
| void | updateVariancesBySpeed (double speed) |
| The function calculates the variances and trust values from the current speed. | |
| void | calculateTrust () |
| The function calculates the trust values from variance and weight parameters. | |
| void | resetSamples () |
| Reset all samples to random position. | |
| void | resetSamples (const Pose2D &pose) |
| Reset all samples to a given position. | |
| void | resetSamplesWhenPenalized () |
| Reset all samples when robot is penalized 25% samples are placed on each side of the field at the center line respectively 50% at random positions. | |
Private Attributes | |
| SampleSet< GT2005SelfLocatorSample, SAMPLES_MAX > | sampleSet |
| the sampleSet | |
| bool | teamColorBlue |
| double | linePointZAngleMotionDependentVariance |
| double | linePointZAngleTrust |
| double | linePointYAngleTrust |
| double | crossingZAngleTrust |
| double | crossingYAngleTrust |
| double | centerCircleZAngleTrust |
| double | centerCircleYAngleTrust |
| double | centerCircleOrientationAngleTrust |
| double | flagYAngleTrust |
| double | goalZAngleTrust |
| double | goalYAngleTrust |
| Pose2D | lastOdometry |
| Pose2D | lastOdometry2 |
| the last Odometry, used to calculate the delta_odometry | |
| unsigned | timeStamp |
| timestap | |
| bool | observationUpdateDone |
| a flag indicating if an observation update was done during the current run of execute | |
| double | speed |
| current robot speed | |
| double | averagePerceptTypeProb [GT2005SelfLocatorSample::numberOfPerceptTypes] |
| the average probability for each PerceptType and all Samples | |
| GT2005SampleTemplateGenerator | sampleTemplateGenerator |
| this class encapsules template generation | |
| GT2005LineCrossingsTable | lineCrossingsTable |
| GT2005SelfLocatorSample * | testSample |
| testing and debugging stuff | |
| int | testSampleIndex |
| Vector2< double > | lastModelCrossing |
| Vector2< double > | lastSeenCrossing |
| GT2005LineCrossingsTable::CrossingClass | lastSeenCrossingClass |
| Pose2D | lastSeenCenterCircle |
| GT2005SelfLocatorParameters | parameters |
| Vector2< double > | eigenVec0 |
| eigenvectors of particle distribution covariance matrix | |
| Vector2< double > | eigenVec1 |
| eigenvectors of particle distribution covariance matrix | |
| double | varianceCovarianceMatrix [2][2] |
| double | stdDevRot |
| double | averageX |
| double | averageY |
| double | eigenVal0 |
| double | eigenVal1 |
| double | eigenSwap |
| double | averageRot |
Static Private Attributes | |
| double const | QUASI_ZERO = 0.000001 |
|
|
Definition at line 69 of file GT2005SelfLocator.h. |
|
|
Definition at line 74 of file GT2005SelfLocator.h. |
|
|
Constructor.
Definition at line 47 of file GT2005SelfLocator.cpp. References calculateTrust(), crossingYAngleTrust, crossingZAngleTrust, flagYAngleTrust, goalYAngleTrust, goalZAngleTrust, idText, linePointYAngleTrust, linePointZAngleTrust, OUTPUT, resetSamples(), testSample, and testSampleIndex. |
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Called from a MessageQueue to distribute messages. Use message.getMessageID to decide if the message is relavant for the MesssageHandler derivate. Use message.bin, message.text or message.config as In streams to get the data from.
Reimplemented from Module. Definition at line 1383 of file GT2005SelfLocator.cpp. |
|
|
The function distributes the parameter in a Gaussian way.
Definition at line 169 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByEntropy(), calcDistributionValidityByStandardDeviation(), updateByCenterCircle(), updateByCrossing(), updateByFlag(), updateByGoalPost(), and updateByPoint(). |
|
||||||||||||||||
|
The function updates the samples by the odometry offset.
Definition at line 74 of file GT2005SelfLocator.cpp. References Vector2< double >::abs(), GT2005SelfLocatorSample::camera, Pose2D::getAngle(), GT2005SelfLocatorSample::isUsingOdometry, GT2005SelfLocatorParameters::majorDirTransWeight, max, GT2005SelfLocatorParameters::minorDirTransWeight, GT2005SelfLocatorParameters::movedAngleWeight, GT2005SelfLocatorParameters::movedDistWeight, PoseSample::probability, random(), GT2005SelfLocatorParameters::rotationNoise, Pose2D::translation, GT2005SelfLocatorParameters::translationNoise, Vector2< double >::x, and Vector2< double >::y. Referenced by execute(). |
Here is the call graph for this function:

|
||||||||||||||||
|
The function updates the samples by a single edge of a flag recognized.
Definition at line 407 of file GT2005SelfLocator.cpp. References Vector2< double >::abs(), GT2005SelfLocatorSample::camera, flagYAngleTrust, gaussian(), getSampleColor(), NCIRCLE, observationUpdateDone, pi, QUASI_ZERO, random(), GT2005SelfLocatorSample::setPerceptProbability(), testSampleIndex, Pose2D::translation, GT2005SelfLocatorParameters::updateProbFlag, Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y. Referenced by landmarksObservationUpdate(). |
Here is the call graph for this function:

|
||||||||||||
|
The function updates the samples by a single goal post recognized.
Definition at line 461 of file GT2005SelfLocator.cpp. References GT2005SelfLocatorSample::camera, gaussian(), getSampleColor(), goalYAngleTrust, NCIRCLE, observationUpdateDone, pi, random(), GT2005SelfLocatorSample::setPerceptProbability(), testSampleIndex, Pose2D::translation, GT2005SelfLocatorParameters::updateProbGoalPost, Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y. Referenced by landmarksObservationUpdate(). |
Here is the call graph for this function:

|
|
The function updates the samples by the recognized landmarks (goal, flag..) triggers updateByFlag and updateByGoalPost.
Definition at line 492 of file GT2005SelfLocator.cpp. References Goal::color, LandmarksPercept::flags, LandmarksPercept::goals, ConditionalBoundary::isOnBorder(), Goal::leftPost, Range< double >::max, Range< double >::min, LandmarksPercept::numberOfFlags, LandmarksPercept::numberOfGoals, Flag::position, Goal::rightPost, updateByFlag(), updateByGoalPost(), and Boundary< double >::x. Referenced by execute(). |
Here is the call graph for this function:

|
|
calculates the CrossingClass out of the classification (side1..side4) in the LinesPercept
|
|
Here is the call graph for this function:

|
|
observationUpdate using the linecrossing percept
Definition at line 184 of file GT2005SelfLocator.cpp. References Vector2< int >::abs(), Vector2< V >::abs(), LinesPercept::LineCrossingPoint::angleOnField, crossingYAngleTrust, crossingZAngleTrust, gaussian(), GT2005LineCrossingsTable::getClosestPoint(), getSampleColor(), GT2005SelfLocatorParameters::headHeightEstimation, lastModelCrossing, lastSeenCrossing, lastSeenCrossingClass, lineCrossingsTable, LinesPercept::LineCrossingPoint::locationOnField, NCIRCLE, NLINE, point, random(), GT2005SelfLocatorSample::setPerceptProbability(), testSampleIndex, Pose2D::translation, GT2005SelfLocatorParameters::updateProbCrossing, Vector2< V >::x, Vector2< double >::x, Vector2< int >::x, Vector2< V >::y, Vector2< double >::y, and Vector2< int >::y. Referenced by lineObservationUpdate(). |
Here is the call graph for this function:

|
||||||||||||||||
|
does an observationupdate with a point on the field (line or goal)
Definition at line 270 of file GT2005SelfLocator.cpp. References Vector2< V >::abs(), Vector2< int >::abs(), Vector2< int >::angle(), gaussian(), Pose2D::getAngle(), getSampleColor(), GT2005SelfLocatorParameters::headHeightEstimation, linePointYAngleTrust, linePointZAngleTrust, NCIRCLE, NLINE, pi, point, QUASI_ZERO, GT2005SelfLocatorSample::setPerceptProbability(), testSampleIndex, Pose2D::translation, Vector2< double >::x, Vector2< V >::x, Vector2< int >::x, Vector2< double >::y, Vector2< V >::y, and Vector2< int >::y. Referenced by lineObservationUpdate(). |
Here is the call graph for this function:

|
|
The function updates the samples by recognized lines.
Definition at line 344 of file GT2005SelfLocator.cpp. References LinesPercept::centerCircle, LinesPercept::centerCircleFound, GT2005SelfLocatorParameters::centerCircleWeight, GT2005SelfLocatorParameters::crossingWeight, e, getPlayer(), Player::getTeamColor(), LinesPercept::lineCrossings, GT2005SelfLocatorParameters::maxBorderpoints, GT2005SelfLocatorParameters::maxCrossings, GT2005SelfLocatorParameters::maxGoalpoints, GT2005SelfLocatorParameters::maxLinepoints, LinesPercept::numberOfLineCrossings, observationUpdateDone, LinesPercept::points, random(), updateByCenterCircle(), updateByCrossing(), and updateByPoint(). Referenced by execute(). |
Here is the call graph for this function:

|
|
Calculates the average possibility for each perceptType and all samples and returns the product over all averages. contains the part of the gt04 resampling method that calculates
Definition at line 707 of file GT2005SelfLocator.cpp. References averagePerceptTypeProb, and GT2005SelfLocatorSample::perceptProbabilities. Referenced by resample(). |
|
|
redistibution of the sampleSet according to the probabilities of the samples TODO: template generation Definition at line 748 of file GT2005SelfLocator.cpp. References GT2005SelfLocatorParameters::applyConstantResampling, averagePerceptTypeProb, calcAveragePerceptTypeProbabilities(), GT2005SelfLocatorParameters::constantResamplingRate, CollisionPercept::getCollisionAggregate(), GT2005SampleTemplateGenerator::getNumberOfTemplates(), GT2005SelfLocatorSample::getProbability(), GT2005SampleTemplateGenerator::getTemplate(), GT2005SelfLocatorSample::isUsingOdometry, GT2005SelfLocatorParameters::odometryProbCollision, GT2005SelfLocatorParameters::odometryProbNoCollision, random(), Field::randomPose(), sampleTemplateGenerator, SampleSet< GT2005SelfLocatorSample, SAMPLES_MAX >::swap(), testSample, and testSampleIndex. Referenced by execute(). |
Here is the call graph for this function:

|
|
Calculates the localization validity by Standard Deviation.
Definition at line 871 of file GT2005SelfLocator.cpp. References alpha, averageRot, averageX, DEBUG_RESPONSE, RobotPose::directionOfGreatestUncertaintyExists, eigenSwap, eigenVal0, eigenVal1, eigenVec0, eigenVec1, gaussian(), RobotPose::greatestUncertainty, idText, max, min, NCOMPLEX_DRAWING, NLINE, normalize(), OUTPUT, Pose2D::rotation, RobotPose::setPositionVariance(), sqr, stdDevRot, Pose2D::translation, varianceCovarianceMatrix, Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y. Referenced by calcPose(). |
Here is the call graph for this function:

|
|
Calculates the localization validity by Entropy.
Definition at line 1108 of file GT2005SelfLocator.cpp. References gaussian(), and pi. Referenced by calcPose(). |
Here is the call graph for this function:

|
||||||||||||||||||||
|
The function calculates a Pose by averaging the sample poses in a sub cube of the pose-room.
Definition at line 1164 of file GT2005SelfLocator.cpp. References Field::clip(), GT2005SelfLocatorParameters::clipRobotPose, Pose2D::getCos(), GT2005SelfLocatorSample::getProbability(), Pose2D::getSin(), RobotPose::getValidity(), GT2005SelfLocatorSample::isValid(), GT2005SelfLocatorSample::next, RobotPose::setPose(), RobotPose::setValidity(), Pose2D::translation, Vector2< double >::x, and Vector2< double >::y. Referenced by calcPose(). |
Here is the call graph for this function:

|
||||||||||||
|
The function determines the most probable pose from the sample distribution.
Definition at line 1231 of file GT2005SelfLocator.cpp. References calcDistributionValidityByEntropy(), calcDistributionValidityByStandardDeviation(), calcPoseFromSubCube(), CIRCLE, GT2005SelfLocator::Cell::count, DEBUG_RESPONSE, GT2005SelfLocator::Cell::first, Pose2D::getAngle(), RobotPose::getPose(), Range< double >::getSize(), RobotPose::getValidity(), GT2005SelfLocatorSample::isValid(), GT2005SelfLocatorSample::next, NUM_OF_CALCULATED_POSES, RobotPoseCollection::numberOfPoses, pi2, POSE_SPACE_GRID, RobotPoseCollection::poses, RobotPose::setValidity(), Pose2D::translation, Vector2< double >::x, Boundary< double >::x, Vector2< double >::y, and Boundary< double >::y. Referenced by execute(). |
Here is the call graph for this function:

|
|
The function draws the current sample set to a debug drawing.
Definition at line 1467 of file GT2005SelfLocator.cpp. References drawTestSample(), getSampleColor(), NCIRCLE, NCOMPLEX_DRAWING, NLINE, PoseSample::probability, and testSample. Referenced by execute(). |
Here is the call graph for this function:

|
|
Returns a color corresponding to the sample probability.
Definition at line 1570 of file GT2005SelfLocator.cpp. References QUASI_ZERO. Referenced by draw(), updateByCenterCircle(), updateByCrossing(), updateByFlag(), updateByGoalPost(), and updateByPoint(). |
|
||||||||||||
|
The function draws an arrow to the sample set drawing.
Definition at line 1588 of file GT2005SelfLocator.cpp. References NLINE, Pose2D::translation, Vector2< double >::x, and Vector2< double >::y. |
|
||||||||||||
|
The function draws an arrow to the test sample drawing.
Definition at line 1619 of file GT2005SelfLocator.cpp. References NLINE, Pose2D::translation, Vector2< double >::x, and Vector2< double >::y. Referenced by draw(). |
|
|
The function calculates the variances and trust values from the current speed.
Definition at line 550 of file GT2005SelfLocator.cpp. References GT2005SelfLocatorParameters::linePointWeight, GT2005SelfLocatorParameters::linePointZAngleMotionDependency, linePointZAngleMotionDependentVariance, linePointZAngleTrust, GT2005SelfLocatorParameters::linePointZAngleVariance, and QUASI_ZERO. |
|
|
|
Reset all samples to random position.
Definition at line 1403 of file GT2005SelfLocator.cpp. References Field::randomPose(). Referenced by execute(), and GT2005SelfLocator(). |
Here is the call graph for this function:

|
|
Reset all samples to a given position.
Definition at line 1412 of file GT2005SelfLocator.cpp. |
|
|
Reset all samples when robot is penalized 25% samples are placed on each side of the field at the center line respectively 50% at random positions.
Definition at line 1421 of file GT2005SelfLocator.cpp. References Pose2D::getAngle(), pi_2, Pose2D::random(), Field::randomPose(), Pose2D::rotation, Pose2D::translation, Vector2< double >::x, and Vector2< double >::y. Referenced by execute(). |
Here is the call graph for this function:

|
|
Definition at line 42 of file GT2005SelfLocator.cpp. Referenced by calculateTrust(), getSampleColor(), updateByFlag(), updateByPoint(), and updateVariancesBySpeed(). |
|
|
the sampleSet
Definition at line 92 of file GT2005SelfLocator.h. |
|
|
Definition at line 93 of file GT2005SelfLocator.h. Referenced by execute(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by updateVariancesBySpeed(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), GT2005SelfLocator(), updateByPoint(), and updateVariancesBySpeed(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), GT2005SelfLocator(), and updateByPoint(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), GT2005SelfLocator(), and updateByCrossing(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), GT2005SelfLocator(), and updateByCrossing(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), and updateByCenterCircle(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), and updateByCenterCircle(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), and updateByCenterCircle(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), GT2005SelfLocator(), and updateByFlag(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), and GT2005SelfLocator(). |
|
|
Definition at line 97 of file GT2005SelfLocator.h. Referenced by calculateTrust(), GT2005SelfLocator(), and updateByGoalPost(). |
|
|
Definition at line 129 of file GT2005SelfLocator.h. |
|
|
the last Odometry, used to calculate the delta_odometry
Definition at line 129 of file GT2005SelfLocator.h. |
|
|
timestap
Definition at line 130 of file GT2005SelfLocator.h. |
|
|
a flag indicating if an observation update was done during the current run of execute
Definition at line 131 of file GT2005SelfLocator.h. Referenced by execute(), lineObservationUpdate(), updateByFlag(), and updateByGoalPost(). |
|
|
current robot speed
Definition at line 132 of file GT2005SelfLocator.h. |
|
|
the average probability for each PerceptType and all Samples
Definition at line 134 of file GT2005SelfLocator.h. Referenced by calcAveragePerceptTypeProbabilities(), and resample(). |
|
|
this class encapsules template generation
Definition at line 136 of file GT2005SelfLocator.h. Referenced by execute(), and resample(). |
|
|
Definition at line 138 of file GT2005SelfLocator.h. Referenced by updateByCrossing(). |
|
|
testing and debugging stuff
Definition at line 143 of file GT2005SelfLocator.h. Referenced by draw(), execute(), GT2005SelfLocator(), and resample(). |
|
|
Definition at line 144 of file GT2005SelfLocator.h. Referenced by execute(), GT2005SelfLocator(), resample(), updateByCenterCircle(), updateByCrossing(), updateByFlag(), updateByGoalPost(), and updateByPoint(). |
|
|
Definition at line 145 of file GT2005SelfLocator.h. Referenced by updateByCrossing(). |
|
|
Definition at line 145 of file GT2005SelfLocator.h. Referenced by updateByCrossing(). |
|
|
Definition at line 146 of file GT2005SelfLocator.h. Referenced by updateByCrossing(). |
|
|
Definition at line 147 of file GT2005SelfLocator.h. |
|
|
Definition at line 149 of file GT2005SelfLocator.h. |
|
|
eigenvectors of particle distribution covariance matrix
Definition at line 152 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByStandardDeviation(). |
|
|
eigenvectors of particle distribution covariance matrix
Definition at line 152 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByStandardDeviation(). |
|
|
Definition at line 154 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByStandardDeviation(). |
|
|
Definition at line 155 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByStandardDeviation(). |
|
|
Definition at line 156 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByStandardDeviation(). |
|
|
Definition at line 157 of file GT2005SelfLocator.h. |
|
|
Definition at line 158 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByStandardDeviation(). |
|
|
Definition at line 158 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByStandardDeviation(). |
|
|
Definition at line 158 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByStandardDeviation(). |
|
|
Definition at line 159 of file GT2005SelfLocator.h. Referenced by calcDistributionValidityByStandardDeviation(). |
1.3.6