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

# GT2005ObstaclesLocator Class Reference

This class is a locator for obstacles. More...

`#include <GT2005ObstaclesLocator.h>`

Inheritance diagram for GT2005ObstaclesLocator:

[legend]
Collaboration diagram for GT2005ObstaclesLocator:

[legend]
List of all members.

## Public Types
enum | { timeAfterWhichObstacleIsForgotten = 6000 }
enum | UpdateMode { overwrite, extend, limit }
## Public Member Functions
| GT2005ObstaclesLocator (const ObstaclesLocatorInterfaces &interfaces)
| Constructor.
virtual void | execute ()
| Executes the module.
void | setObstaclesModel (bool addWorldModel=true)
void | moveObstaclesByOdometry ()
void | addLinesPercept ()
void | addObstaclesPercept ()
void | addPSDPercept ()
void | addObstaclePoint (const Vector2< double > &obstaclePoint, UpdateMode mode)
void | addObstaclePoints (const Vector2< int > &nearPoint, const Vector2< int > &farPoint, bool farPointIsOnImageBorder, ObstaclesPercept::ObstacleType obstacleType)
virtual bool | handleMessage (InMessage &message)
| Called from a MessageQueue to distribute messages.
## Public Attributes
int | relativeOrientation
Field | field
Vector2< double > | obstacles [ObstaclesModel::numOfSectors]
ObstaclesPercept::ObstacleType | obstacleTypes [ObstaclesModel::numOfSectors]
unsigned long | timestamps [ObstaclesModel::numOfSectors]
double | sectorWidth
OdometryData | lastOdometry
Pose2D | odometry
double | headTiltClipPSD
| head tilt angle below which psd percepts are ignored
bool | usePSD
bool | useLinesPercept
bool | useObstaclesPercept
bool | useAging
## Private Member Functions
void | determineFreePartsOfGoals ()
void | determineSeenGoals ()
void | determineNextFreeTeammate ()
## Private Attributes
double | angleToFreePartOfGoal [2]
| angle to a free part of the goal, updated by vision and turn(!) odometry
double | angleToSeenGoal [2]
| angle to a seen goal, updated by vision and odometry
double | distanceToSeenGoal [2]
| distance to a seen goal, updated by vision and odometry
unsigned long | timeOfSeenGoal [2]
| time since last seen goal
double | widthOfFreePartOfGoal [2]
| the width of the free part of goal
double | distanceToFreePartOfGoal [2]
| the distance to the free part of the goal

## Detailed Description

This class is a locator for obstacles.

Definition at line 18 of file GT2005ObstaclesLocator.h.

## Member Enumeration Documentation

anonymous enum

  | Enumeration values:
  timeAfterWhichObstacleIsForgotten |
Definition at line 22 of file GT2005ObstaclesLocator.h.

enum GT2005ObstaclesLocator::UpdateMode

  | Enumeration values:
  overwrite |
  extend |
  limit |
Definition at line 61 of file GT2005ObstaclesLocator.h.

## Constructor & Destructor Documentation

GT2005ObstaclesLocator::GT2005ObstaclesLocator | ( | const ObstaclesLocatorInterfaces & | interfaces | ) |

  | Constructor. Parameters:
  interfaces | The paramters of the ObstaclesLocator module.
Definition at line 17 of file GT2005ObstaclesLocator.cpp. References obstacles, obstacleTypes, pi2, sectorWidth, useAging, useLinesPercept, useObstaclesPercept, usePSD, Vector2< double >::x, and Vector2< double >::y.

## Member Function Documentation

void GT2005ObstaclesLocator::execute | ( |  | ) | `[virtual]`

| Executes the module. Reimplemented from Module. Definition at line 44 of file GT2005ObstaclesLocator.cpp. References addLinesPercept(), addObstaclesPercept(), DEBUG_DRAWING_FINISHED, determineFreePartsOfGoals(), determineNextFreeTeammate(), determineSeenGoals(), ObstaclesPercept::frameNumber, MODIFY, moveObstaclesByOdometry(), odometry, ObstaclesModel::setFrameNumber(), setObstaclesModel(), useLinesPercept, and useObstaclesPercept.

Here is the call graph for this function:

void GT2005ObstaclesLocator::setObstaclesModel | ( | bool | addWorldModel = true | ) |

| Definition at line 126 of file GT2005ObstaclesLocator.cpp. References Vector2< double >::abs(), ObstaclesModel::bodyPSD, ObstaclesModel::corridorInFront, ObstaclesModel::distance, FieldDimensions::distanceToOwnPenaltyArea(), Field::getDistanceToOwnPenaltyArea(), getPlayer(), Player::getPlayerNumber(), ObstaclesModel::getSectorFromAngle(), PSDPercept::numOfPercepts, obstacles, ObstaclesModel::obstacleType, obstacleTypes, pi_2, Vector2< double >::x, and Vector2< double >::y. Referenced by execute().

Here is the call graph for this function:

void GT2005ObstaclesLocator::moveObstaclesByOdometry | ( |  | ) |

| Definition at line 67 of file GT2005ObstaclesLocator.cpp. References ObstaclesModel::getSectorFromAngle(), SystemCall::getTimeSince(), obstacles, obstacleTypes, odometry, Pose2D::rotation, timeAfterWhichObstacleIsForgotten, timestamps, Pose2D::translation, useAging, Vector2< double >::x, and Vector2< double >::y. Referenced by execute().

Here is the call graph for this function:

void GT2005ObstaclesLocator::addLinesPercept | ( |  | ) |

| Definition at line 257 of file GT2005ObstaclesLocator.cpp. References addObstaclePoint(), limit, and LinesPercept::points. Referenced by execute().

Here is the call graph for this function:

void GT2005ObstaclesLocator::addObstaclesPercept | ( |  | ) |

| Definition at line 277 of file GT2005ObstaclesLocator.cpp. References addObstaclePoints(), ObstaclesModel::currentlySeenEndSector, ObstaclesModel::currentlySeenStartSector, ObstaclesPercept::Segment::farPointIsOnImageBorder, ObstaclesPercept::Segment::farPointOnField, ObstaclesPercept::Segment::nearPointOnField, ObstaclesPercept::numberOfSegments, ObstaclesModel::numOfSectors, ObstaclesPercept::Segment::obstacleType, ObstaclesPercept::segments, Vector2< double >::x, and Vector2< double >::y. Referenced by execute().

Here is the call graph for this function:

void GT2005ObstaclesLocator::addPSDPercept | ( |  | ) |

| Definition at line 205 of file GT2005ObstaclesLocator.cpp. References Vector2< V >::angle(), Geometry::angleTo(), DOT, SystemCall::getCurrentSystemTime(), RobotPose::getPose(), ObstaclesModel::getSectorFromAngle(), SystemCall::getTimeSince(), headTiltClipPSD, normalize(), PSDPercept::numOfPercepts, obstacles, BallState::positionField, BallModel::seen, timestamps, SeenBallState::timeWhenLastSeen, toDegrees(), Vector2< V >::x, Vector2< double >::x, Vector2< double >::y, and Vector2< V >::y.

Here is the call graph for this function:

void GT2005ObstaclesLocator::addObstaclePoint | ( | const Vector2< double > & | obstaclePoint,
|  | UpdateMode | mode
| ) |

| Definition at line 305 of file GT2005ObstaclesLocator.cpp. References DOT, SystemCall::getCurrentSystemTime(), ObstaclesModel::getSectorFromAngle(), idText, normalize(), and OUTPUT. Referenced by addLinesPercept().

Here is the call graph for this function:

void GT2005ObstaclesLocator::addObstaclePoints | ( | const Vector2< int > & | nearPoint,
|  | const Vector2< int > & | farPoint,
|  | bool | farPointIsOnImageBorder,
|  | ObstaclesPercept::ObstacleType | obstacleType
| ) |

| Definition at line 373 of file GT2005ObstaclesLocator.cpp. References SystemCall::getCurrentSystemTime(), ObstaclesModel::getSectorFromAngle(), idText, max, min, normalize(), and OUTPUT. Referenced by addObstaclesPercept().

Here is the call graph for this function:

bool GT2005ObstaclesLocator::handleMessage | ( | InMessage & | message | ) | `[virtual]`

  | 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. Parameters:
  message | The message that can be read.
Returns: true if the message was read (handled). Reimplemented from Module. Definition at line 725 of file GT2005ObstaclesLocator.cpp. References InMessage::bin, GenericDebugData::data, InMessage::getMessageID(), headTiltClipPSD, GenericDebugData::id, idGenericDebugData, idText, OUTPUT, useAging, useLinesPercept, and usePSD.

Here is the call graph for this function:

void GT2005ObstaclesLocator::determineFreePartsOfGoals | ( |  | ) | `[private]`

| Definition at line 414 of file GT2005ObstaclesLocator.cpp. References ObstaclesModel::angleToFreePartOfGoal, ObstaclesModel::angleToFreePartOfGoalWasDetermined, ObstaclesPercept::FreePartOfGoal::directionAsAngle, ObstaclesPercept::FreePartOfGoal::distanceOnField, ObstaclesModel::distanceToFreePartOfGoal, ObstaclesPercept::freePartOfGoal, Pose2D::getAngle(), SystemCall::getTimeSince(), ObstaclesModel::lastTimeFreePartOfGoalWasDetermined, ObstaclesPercept::FreePartOfGoal::leftEndSeen, normalize(), odometry, ObstaclesPercept::FreePartOfGoal::rightEndSeen, ObstaclesPercept::FreePartOfGoal::wasDetermined, ObstaclesPercept::FreePartOfGoal::widthAsAngle, and ObstaclesModel::widthOfFreePartOfGoal. Referenced by execute().

Here is the call graph for this function:

void GT2005ObstaclesLocator::determineSeenGoals | ( |  | ) | `[private]`

| Definition at line 523 of file GT2005ObstaclesLocator.cpp. References Goal::angle, ObstaclesModel::angleToSeenGoal, Goal::color, Goal::distance, ObstaclesModel::distanceToSeenGoal, SystemCall::getCurrentSystemTime(), getPlayer(), Player::getTeamColor(), LandmarksPercept::goals, ConditionalBoundary::isOnBorder(), Range< double >::max, Range< double >::min, NCOMPLEX_DRAWING, NDECLARE_DEBUGDRAWING, NLINE, LandmarksPercept::numberOfGoals, ObstaclesModel::timeOfSeenGoal, ObstaclesModel::trustSeenGoal, and Boundary< double >::x. Referenced by execute().

Here is the call graph for this function:

void GT2005ObstaclesLocator::determineNextFreeTeammate | ( |  | ) | `[private]`

| Definition at line 482 of file GT2005ObstaclesLocator.cpp. References Vector2< double >::abs(), ObstaclesModel::angleToNextFreeTeammate, ObstaclesModel::angleToNextFreeTeammateWasDetermined, ObstaclesModel::distanceToNextFreeTeammate, PlayerPoseCollection::getOwnPlayerPose(), PlayerPose::getPose(), ObstaclesModel::getSectorFromAngle(), normalize(), PlayerPoseCollection::numberOfOwnPlayers, obstacles, and Pose2D::translation. Referenced by execute().

Here is the call graph for this function:

## Member Data Documentation

int GT2005ObstaclesLocator::relativeOrientation

| Definition at line 32 of file GT2005ObstaclesLocator.h.

Field GT2005ObstaclesLocator::field

| Definition at line 34 of file GT2005ObstaclesLocator.h.

Vector2<double> GT2005ObstaclesLocator::obstacles[ObstaclesModel::numOfSectors]

| Definition at line 35 of file GT2005ObstaclesLocator.h. Referenced by addPSDPercept(), determineNextFreeTeammate(), GT2005ObstaclesLocator(), moveObstaclesByOdometry(), and setObstaclesModel().

ObstaclesPercept::ObstacleType GT2005ObstaclesLocator::obstacleTypes[ObstaclesModel::numOfSectors]

| Definition at line 36 of file GT2005ObstaclesLocator.h. Referenced by GT2005ObstaclesLocator(), moveObstaclesByOdometry(), and setObstaclesModel().

unsigned long GT2005ObstaclesLocator::timestamps[ObstaclesModel::numOfSectors]

| Definition at line 38 of file GT2005ObstaclesLocator.h. Referenced by addPSDPercept(), and moveObstaclesByOdometry().

double GT2005ObstaclesLocator::sectorWidth

| Definition at line 40 of file GT2005ObstaclesLocator.h. Referenced by GT2005ObstaclesLocator().

OdometryData GT2005ObstaclesLocator::lastOdometry

| Definition at line 41 of file GT2005ObstaclesLocator.h.

Pose2D GT2005ObstaclesLocator::odometry

| Definition at line 42 of file GT2005ObstaclesLocator.h. Referenced by determineFreePartsOfGoals(), execute(), and moveObstaclesByOdometry().

double GT2005ObstaclesLocator::headTiltClipPSD

| head tilt angle below which psd percepts are ignored Definition at line 45 of file GT2005ObstaclesLocator.h. Referenced by addPSDPercept(), and handleMessage().

bool GT2005ObstaclesLocator::usePSD

| Definition at line 50 of file GT2005ObstaclesLocator.h. Referenced by GT2005ObstaclesLocator(), and handleMessage().

bool GT2005ObstaclesLocator::useLinesPercept

| Definition at line 51 of file GT2005ObstaclesLocator.h. Referenced by execute(), GT2005ObstaclesLocator(), and handleMessage().

bool GT2005ObstaclesLocator::useObstaclesPercept

| Definition at line 52 of file GT2005ObstaclesLocator.h. Referenced by execute(), and GT2005ObstaclesLocator().

bool GT2005ObstaclesLocator::useAging

| Definition at line 53 of file GT2005ObstaclesLocator.h. Referenced by GT2005ObstaclesLocator(), handleMessage(), and moveObstaclesByOdometry().

double GT2005ObstaclesLocator::angleToFreePartOfGoal[2]`[private]`

| angle to a free part of the goal, updated by vision and turn(!) odometry Definition at line 83 of file GT2005ObstaclesLocator.h.

double GT2005ObstaclesLocator::angleToSeenGoal[2]`[private]`

| angle to a seen goal, updated by vision and odometry Definition at line 86 of file GT2005ObstaclesLocator.h.

double GT2005ObstaclesLocator::distanceToSeenGoal[2]`[private]`

| distance to a seen goal, updated by vision and odometry Definition at line 89 of file GT2005ObstaclesLocator.h.

unsigned long GT2005ObstaclesLocator::timeOfSeenGoal[2]`[private]`

| time since last seen goal Definition at line 92 of file GT2005ObstaclesLocator.h.

double GT2005ObstaclesLocator::widthOfFreePartOfGoal[2]`[private]`

| the width of the free part of goal Definition at line 95 of file GT2005ObstaclesLocator.h.

double GT2005ObstaclesLocator::distanceToFreePartOfGoal[2]`[private]`

| the distance to the free part of the goal Definition at line 98 of file GT2005ObstaclesLocator.h.

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

- Modules/ObstaclesLocator/GT2005ObstaclesLocator.h
- Modules/ObstaclesLocator/GT2005ObstaclesLocator.cpp