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

# GTCamObstaclesLocator Class Reference

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

`#include <GTCamObstaclesLocator.h>`

Inheritance diagram for GTCamObstaclesLocator:

[legend]
Collaboration diagram for GTCamObstaclesLocator:

[legend]
List of all members.

## Public Types
enum | { obstaclesRadius = 160, obstaclesDist = 60 }
## Public Member Functions
| GTCamObstaclesLocator (const ObstaclesLocatorInterfaces &interfaces)
| Constructor.
virtual void | execute ()
| Executes the module.
virtual bool | handleMessage (InMessage &message)
| Called from a MessageQueue to distribute messages.
## Private Member Functions
void | modelLine (bool vert, double x, double sy, double ey, ObstaclesPercept::ObstacleType type)
| Models a line with constant x or constant y-value as an obstacle.
void | modelRobot (double px, double py, double rotation, ObstaclesPercept::ObstacleType type)
| Models a robot as a circular obstacle px = the x-coordinate of the robots neck py = the y-coordinate of the robots neck rotation = the rotation of the robot type = the type of the obstacle (teammate or opponent, for example) Remark: This Method uses the attribute obstaclesDist, wich determines the distance between the neck of the robot and the center of the circle around the robot.
## Private Attributes
double | rx
double | ry
double | ra
double | minStep
double | sectorWidth
int | frontSectorNr
int | deltaSector45Nr

## Detailed Description

This class is a locator for obstacles.

Definition at line 16 of file GTCamObstaclesLocator.h.

## Member Enumeration Documentation

anonymous enum

  | Enumeration values:
  obstaclesRadius |
  obstaclesDist |
Definition at line 21 of file GTCamObstaclesLocator.h.

## Constructor & Destructor Documentation

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

  | Constructor. Parameters:
  interfaces | The paramters of the ObstaclesLocator module.
Definition at line 62 of file GTCamObstaclesLocator.cpp. References deltaSector45Nr, frontSectorNr, ObstaclesModel::getSectorFromAngle(), minStep, pi, and pi2.

Here is the call graph for this function:

## Member Function Documentation

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

| Executes the module. Reimplemented from Module. Definition at line 72 of file GTCamObstaclesLocator.cpp. References ObstaclesModel::angleToFreePartOfGoal, ObstaclesModel::angleToFreePartOfGoalWasDetermined, ObstaclesModel::angleToNextFreeTeammate, ObstaclesModel::angleToNextFreeTeammateWasDetermined, ObstaclesModel::corridorInFront, deltaSector45Nr, ObstaclesModel::distance, ObstaclesModel::distanceToFreePartOfGoal, ObstaclesModel::distanceToNextFreeTeammate, CameraMatrix::frameNumber, ObstaclesModel::frameNumber, frontSectorNr, SystemCall::getCurrentSystemTime(), getPlayer(), Player::getPlayerNumber(), GTCamWorldState::getPlayerOrientation(), GTCamWorldState::getPlayerPos(), ObstaclesModel::getSectorFromAngle(), Player::getTeamColor(), ObstaclesModel::lastTimeFreePartOfGoalWasDetermined, modelLine(), modelRobot(), ObstaclesModel::obstacleType, pi, pi2, ra, Pose2D::rotation, rx, ry, Pose2D::translation, ObstaclesModel::widthOfFreePartOfGoal, Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

Here is the call graph for this function:

bool GTCamObstaclesLocator::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 249 of file GTCamObstaclesLocator.cpp.

void GTCamObstaclesLocator::modelLine | ( | bool | vert,
|  | double | x,
|  | double | sy,
|  | double | ey,
|  | ObstaclesPercept::ObstacleType | type
| ) | `[private]`

| Models a line with constant x or constant y-value as an obstacle. If you want to model a line with constant x-value (a horizontal line) you have to call modelLine with: vert = false x = the constant x-value of the line sy with the minimum y-value of the line ey with the maximum y-value of the line If you want to model a line with constant y-value (a verlical line) you have to call modelLine with: vert = true x = the constant y-value of the line sy with the minimum x-value of the line ey with the maximum x-value of the line In any case you determine the type of the obstacle with type (border or goal, for example) Attention: make sure that sy is less than ey, or uncomment the swap-passage in the method! Definition at line 270 of file GTCamObstaclesLocator.cpp. References ObstaclesModel::distance, ObstaclesModel::getAngleOfSector(), ObstaclesModel::getSectorFromAngle(), ObstaclesModel::obstacleType, pi, pi2, pi_2, ra, rx, and ry. Referenced by execute().

Here is the call graph for this function:

void GTCamObstaclesLocator::modelRobot | ( | double | px,
|  | double | py,
|  | double | rotation,
|  | ObstaclesPercept::ObstacleType | type
| ) | `[private]`

| Models a robot as a circular obstacle px = the x-coordinate of the robots neck py = the y-coordinate of the robots neck rotation = the rotation of the robot type = the type of the obstacle (teammate or opponent, for example) Remark: This Method uses the attribute obstaclesDist, wich determines the distance between the neck of the robot and the center of the circle around the robot. * - * - * - Definition at line 356 of file GTCamObstaclesLocator.cpp. References ObstaclesModel::distance, ObstaclesModel::getAngleOfSector(), ObstaclesModel::getSectorFromAngle(), obstaclesDist, obstaclesRadius, ObstaclesModel::obstacleType, pi, ra, rx, and ry. Referenced by execute().

Here is the call graph for this function:

## Member Data Documentation

double GTCamObstaclesLocator::rx`[private]`

| Definition at line 34 of file GTCamObstaclesLocator.h. Referenced by execute(), modelLine(), and modelRobot().

double GTCamObstaclesLocator::ry`[private]`

| Definition at line 34 of file GTCamObstaclesLocator.h. Referenced by execute(), modelLine(), and modelRobot().

double GTCamObstaclesLocator::ra`[private]`

| Definition at line 34 of file GTCamObstaclesLocator.h. Referenced by execute(), modelLine(), and modelRobot().

double GTCamObstaclesLocator::minStep`[private]`

| Definition at line 37 of file GTCamObstaclesLocator.h. Referenced by GTCamObstaclesLocator().

double GTCamObstaclesLocator::sectorWidth`[private]`

| Definition at line 37 of file GTCamObstaclesLocator.h.

int GTCamObstaclesLocator::frontSectorNr`[private]`

| Definition at line 38 of file GTCamObstaclesLocator.h. Referenced by execute(), and GTCamObstaclesLocator().

int GTCamObstaclesLocator::deltaSector45Nr`[private]`

| Definition at line 38 of file GTCamObstaclesLocator.h. Referenced by execute(), and GTCamObstaclesLocator().

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

- Modules/ObstaclesLocator/GTCamObstaclesLocator.h
- Modules/ObstaclesLocator/GTCamObstaclesLocator.cpp