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

# GT2005SampleTemplateGenerator Class Reference

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

`#include <GT2005SampleTemplateGenerator.h>`

Inheritance diagram for GT2005SampleTemplateGenerator:

[legend]
Collaboration diagram for GT2005SampleTemplateGenerator:

[legend]
List of all members.

## Public Member Functions
| GT2005SampleTemplateGenerator (const GT2005SelfLocatorParameters &parameters)
| Constructor.
GT2005SelfLocatorSample | getTemplate ()
| this method returns a generated template
void | generateTemplates (const LandmarksPercept &landmarksPercept, const LinesPercept &linesPercept, const Pose2D &odometry)
| this method generates new sample templates
int | getNumberOfTemplates () const
void | draw (const Pose2D &pose, const Drawings::Color &color) const
void | draw (const Pose2D &pose, const Drawings::Color &color, const Vector2< double > &mark1, const Vector2< double > &mark2, double dir1, double dir2) const
void | draw (const Pose2D &pose, const Drawings::Color &color, const Vector2< double > &mark1, const Vector2< double > &mark2, const Vector2< double > &mark3, double dir1, double dir2, double dir3) const
## 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)
bool | checkTemplatePose (const Pose2D &pose, const Vector2< double > &mark, double dir)
## Private Attributes
const GT2005SelfLocatorParameters & | parameters
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 27 of file GT2005SampleTemplateGenerator.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 60 of file GT2005SampleTemplateGenerator.h.

## Constructor & Destructor Documentation

GT2005SampleTemplateGenerator::GT2005SampleTemplateGenerator | ( | const GT2005SelfLocatorParameters & | parameters | ) |

| Constructor. Definition at line 14 of file GT2005SampleTemplateGenerator.cpp. References numberOfTemplates.

## Member Function Documentation

GT2005SelfLocatorSample GT2005SampleTemplateGenerator::getTemplate | ( |  | ) |

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

Here is the call graph for this function:

void GT2005SampleTemplateGenerator::generateTemplates | ( | const LandmarksPercept & | landmarksPercept,
|  | const LinesPercept & | linesPercept,
|  | const Pose2D & | odometry
| ) |

| this method generates new sample templates Definition at line 221 of file GT2005SampleTemplateGenerator.cpp. References Vector2< V >::abs(), addFlag(), Flag::angle, DEBUG_RESPONSE, Flag::distance, LandmarksPercept::flags, NCIRCLE, NCOMPLEX_DRAWING, NDECLARE_DEBUGDRAWING, LandmarksPercept::numberOfFlags, Flag::position, Boundary< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y. Referenced by GT2005SelfLocator::execute().

Here is the call graph for this function:

int GT2005SampleTemplateGenerator::getNumberOfTemplates | ( |  | ) | const

| Definition at line 335 of file GT2005SampleTemplateGenerator.cpp. References numberOfTemplates. Referenced by GT2005SelfLocator::resample().

void GT2005SampleTemplateGenerator::draw | ( | const Pose2D & | pose,
|  | const Drawings::Color & | color
| ) | const

| Definition at line 340 of file GT2005SampleTemplateGenerator.cpp. References NCIRCLE, NCOMPLEX_DRAWING, NLINE, Pose2D::translation, Vector2< double >::x, and Vector2< double >::y.

void GT2005SampleTemplateGenerator::draw | ( | const Pose2D & | pose,
|  | const Drawings::Color & | color,
|  | const Vector2< double > & | mark1,
|  | const Vector2< double > & | mark2,
|  | double | dir1,
|  | double | dir2
| ) | const

| Definition at line 358 of file GT2005SampleTemplateGenerator.cpp. References NCOMPLEX_DRAWING, NLINE, Pose2D::translation, Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

void GT2005SampleTemplateGenerator::draw | ( | const Pose2D & | pose,
|  | const Drawings::Color & | color,
|  | const Vector2< double > & | mark1,
|  | const Vector2< double > & | mark2,
|  | const Vector2< double > & | mark3,
|  | double | dir1,
|  | double | dir2,
|  | double | dir3
| ) | const

| Definition at line 404 of file GT2005SampleTemplateGenerator.cpp. References NCOMPLEX_DRAWING, NLINE, Pose2D::translation, Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

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

| Definition at line 154 of file GT2005SampleTemplateGenerator.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.

Here is the call graph for this function:

int GT2005SampleTemplateGenerator::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 104 of file GT2005SampleTemplateGenerator.cpp. References Vector2< V >::abs(), alpha, checkTemplatePose(), pi, pi_2, Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:

bool GT2005SampleTemplateGenerator::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 57 of file GT2005SampleTemplateGenerator.cpp. References Vector2< V >::abs(), checkTemplatePose(), pi, pi2, Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:

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

| Definition at line 193 of file GT2005SampleTemplateGenerator.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:

bool GT2005SampleTemplateGenerator::checkTemplatePose | ( | const Pose2D & | pose,
|  | const Vector2< double > & | mark,
|  | double | dir
| ) | `[private]`

| Definition at line 434 of file GT2005SampleTemplateGenerator.cpp. References normalize(), Pose2D::rotation, and Pose2D::translation. Referenced by poseFromBearings(), and poseFromBearingsAndDistance().

Here is the call graph for this function:

## Member Data Documentation

const GT2005SelfLocatorParameters& GT2005SampleTemplateGenerator::parameters`[private]`

| Definition at line 58 of file GT2005SampleTemplateGenerator.h.

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

| A buffer for previously seen flags. Definition at line 65 of file GT2005SampleTemplateGenerator.h.

int GT2005SampleTemplateGenerator::numberOfTemplates`[private]`

| The number of templates generated. Definition at line 67 of file GT2005SampleTemplateGenerator.h. Referenced by getNumberOfTemplates(), getTemplate(), and GT2005SampleTemplateGenerator().

int GT2005SampleTemplateGenerator::numberOfFlags`[private]`

| The number of templates generated. Definition at line 67 of file GT2005SampleTemplateGenerator.h.

int GT2005SampleTemplateGenerator::nextTemplate`[private]`

| The next template delivered. Definition at line 67 of file GT2005SampleTemplateGenerator.h.

int GT2005SampleTemplateGenerator::randomFactor`[private]`

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

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

| Templates for poses replacing bad samples. Definition at line 71 of file GT2005SampleTemplateGenerator.h.

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

- Modules/SelfLocator/GT2005SelfLocator/GT2005SampleTemplateGenerator.h
- Modules/SelfLocator/GT2005SelfLocator/GT2005SampleTemplateGenerator.cpp