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

# GT2005StableSampleTemplateGenerator Class Reference

A Class to encapsulate the template geneation feature of the gt04 localizer. More...

`#include <GT2005StableSampleTemplateGenerator.h>`

Inheritance diagram for GT2005StableSampleTemplateGenerator:

[legend]
Collaboration diagram for GT2005StableSampleTemplateGenerator:

[legend]
List of all members.

## Public Member Functions
| GT2005StableSampleTemplateGenerator ()
| Constructor.
GT2005StableSelfLocatorSample | getTemplate ()
| this method returns a generated template
void | generateTemplates (const LandmarksPercept &landmarksPercept, const LinesPercept &linesPercept, const Pose2D &odometry, int numberOfPerceptTypes, const LinesPercept::LineType types[LinesPercept::numberOfLineTypes])
| this method generates new sample templates
int | getNumberOfTemplates ()
## Private Types
enum | { TEMPLATES_MAX = 100, FLAGS_MAX = 3 }
## Private Member Functions
bool | getBearing (const LandmarksPercept &landmarksPercept, int i, Vector2< double > &mark, double &dir, double &dist)
int | poseFromBearingsAndDistance (double dir0, double dir1, double dist, const Vector2< double > &mark0, const Vector2< double > &mark1, const Vector2< double > &cameraOffset, Pose2D &resultingPose1, Pose2D &resultingPose2)
bool | poseFromBearings (double dir0, double dir1, double dir2, const Vector2< double > &mark0, const Vector2< double > &mark1, const Vector2< double > &mark2, const Vector2< double > &cameraOffset, Pose2D &resultingPose)
void | addFlag (const Flag &flag)
## Private Attributes
Flag | flags [FLAGS_MAX]
| A buffer for previously seen flags.
int | numberOfTemplates
| The number of templates generated.
int | numberOfFlags
| The number of templates generated.
int | nextTemplate
| The next template delivered.
int | randomFactor
| A factor that is increased if more templates are required.
Pose2D | templates [TEMPLATES_MAX]
| Templates for poses replacing bad samples.

## Detailed Description

A Class to encapsulate the template geneation feature of the gt04 localizer.

Definition at line 17 of file GT2005StableSampleTemplateGenerator.h.

## Member Enumeration Documentation

anonymous enum`[private]`

  | Enumeration values:
  TEMPLATES_MAX | maximum number of samples - should be the same as max number of samples in locator
  FLAGS_MAX | maximum number of flags stored in a buffer
Definition at line 43 of file GT2005StableSampleTemplateGenerator.h.

## Constructor & Destructor Documentation

GT2005StableSampleTemplateGenerator::GT2005StableSampleTemplateGenerator | ( |  | ) |

| Constructor. Definition at line 14 of file GT2005StableSampleTemplateGenerator.cpp.

## Member Function Documentation

GT2005StableSelfLocatorSample GT2005StableSampleTemplateGenerator::getTemplate | ( |  | ) |

| this method returns a generated template Definition at line 27 of file GT2005StableSampleTemplateGenerator.cpp. References Pose2D::getAngle(), Boundary< double >::isInside(), Pose2D::random(), Field::randomPose(), Pose2D::translation, Vector2< double >::x, and Vector2< double >::y. Referenced by GT2005StableSelfLocator::resample().

Here is the call graph for this function:

void GT2005StableSampleTemplateGenerator::generateTemplates | ( | const LandmarksPercept & | landmarksPercept,
|  | const LinesPercept & | linesPercept,
|  | const Pose2D & | odometry,
|  | int | numberOfPerceptTypes,
|  | const LinesPercept::LineType | types[LinesPercept::numberOfLineTypes]
| ) |

| this method generates new sample templates COPIED FROM UNSTABLE VERSION!!!/// Definition at line 212 of file GT2005StableSampleTemplateGenerator.cpp. References Vector2< int >::abs(), Vector2< V >::abs(), addFlag(), Flag::angle, LandmarksPercept::cameraOffset, Flag::distance, LandmarksPercept::flags, getBearing(), getPlayer(), Player::getTeamColor(), LandmarksPercept::numberOfFlags, LandmarksPercept::numberOfGoals, pi, point, LinesPercept::points, poseFromBearings(), poseFromBearingsAndDistance(), Vector2< int >::x, Vector3< double >::x, Vector2< V >::x, Vector2< int >::y, Vector3< double >::y, and Vector2< V >::y. Referenced by GT2005StableSelfLocator::execute().

Here is the call graph for this function:

int GT2005StableSampleTemplateGenerator::getNumberOfTemplates | ( |  | ) |

| Definition at line 313 of file GT2005StableSampleTemplateGenerator.cpp. Referenced by GT2005StableSelfLocator::resample().

bool GT2005StableSampleTemplateGenerator::getBearing | ( | const LandmarksPercept & | landmarksPercept,
|  | int | i,
|  | Vector2< double > & | mark,
|  | double & | dir,
|  | double & | dist
| ) | `[private]`

| Definition at line 144 of file GT2005StableSampleTemplateGenerator.cpp. References Flag::angle, Goal::distance, Flag::distance, LandmarksPercept::goals, ConditionalBoundary::isOnBorder(), Goal::leftPost, Range< double >::max, Range< double >::min, Flag::position, Goal::rightPost, and Boundary< double >::x. Referenced by generateTemplates().

Here is the call graph for this function:

int GT2005StableSampleTemplateGenerator::poseFromBearingsAndDistance | ( | double | dir0,
|  | double | dir1,
|  | double | dist,
|  | const Vector2< double > & | mark0,
|  | const Vector2< double > & | mark1,
|  | const Vector2< double > & | cameraOffset,
|  | Pose2D & | resultingPose1,
|  | Pose2D & | resultingPose2
| ) | `[private]`

| Definition at line 101 of file GT2005StableSampleTemplateGenerator.cpp. References Vector2< V >::abs(), alpha, pi, pi_2, Vector2< V >::x, and Vector2< V >::y. Referenced by generateTemplates().

Here is the call graph for this function:

bool GT2005StableSampleTemplateGenerator::poseFromBearings | ( | double | dir0,
|  | double | dir1,
|  | double | dir2,
|  | const Vector2< double > & | mark0,
|  | const Vector2< double > & | mark1,
|  | const Vector2< double > & | mark2,
|  | const Vector2< double > & | cameraOffset,
|  | Pose2D & | resultingPose
| ) | `[private]`

| Definition at line 58 of file GT2005StableSampleTemplateGenerator.cpp. References Vector2< V >::abs(), pi, pi2, Vector2< V >::x, and Vector2< V >::y. Referenced by generateTemplates().

Here is the call graph for this function:

void GT2005StableSampleTemplateGenerator::addFlag | ( | const Flag & | flag | ) | `[private]`

| Definition at line 183 of file GT2005StableSampleTemplateGenerator.cpp. References ConditionalBoundary::isOnBorder(), Range< double >::max, Range< double >::min, Flag::type, and Boundary< double >::x. Referenced by generateTemplates().

Here is the call graph for this function:

## Member Data Documentation

Flag GT2005StableSampleTemplateGenerator::flags[FLAGS_MAX]`[private]`

| A buffer for previously seen flags. Definition at line 48 of file GT2005StableSampleTemplateGenerator.h.

int GT2005StableSampleTemplateGenerator::numberOfTemplates`[private]`

| The number of templates generated. Definition at line 50 of file GT2005StableSampleTemplateGenerator.h.

int GT2005StableSampleTemplateGenerator::numberOfFlags`[private]`

| The number of templates generated. Definition at line 50 of file GT2005StableSampleTemplateGenerator.h.

int GT2005StableSampleTemplateGenerator::nextTemplate`[private]`

| The next template delivered. Definition at line 50 of file GT2005StableSampleTemplateGenerator.h.

int GT2005StableSampleTemplateGenerator::randomFactor`[private]`

| A factor that is increased if more templates are required. Definition at line 53 of file GT2005StableSampleTemplateGenerator.h.

Pose2D GT2005StableSampleTemplateGenerator::templates[TEMPLATES_MAX]`[private]`

| Templates for poses replacing bad samples. Definition at line 54 of file GT2005StableSampleTemplateGenerator.h.

The documentation for this class was generated from the following files:

- Modules/SelfLocator/GT2005StableSelfLocator/GT2005StableSampleTemplateGenerator.h
- Modules/SelfLocator/GT2005StableSelfLocator/GT2005StableSampleTemplateGenerator.cpp