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

ObstaclesModel Class Reference

A class describing the distance to obstacles around the robot,. More...

#include <ObstaclesModel.h>

List of all members.

Public Types

enum  Directions {
  back, backRight, right,
  frontRight, front, frontLeft,
  left, backLeft, numberOfDirections
}
enum  SearchDirections { searchLeft, searchLeftAndRight, searchRight }
enum  { numOfSectors = 90, maxDistance = 1500 }
enum  { ownGoal = 0, opponentGoal = 1 }

Public Member Functions

 ObstaclesModel ()
 ~ObstaclesModel ()
void operator= (const ObstaclesModel &other)
 copies another ObstaclesModel to this one

void setFrameNumber (unsigned long frameNumber)
double getDistanceInCorridor (double angle, double width) const
 returns the distance to the closest obstacle in the corridor specified by angle and width

double getAngleOfNextFreeSector (double sizeOfSector, double angle, int minDistance) const
 returns the angle of the closest free sector with angle sizeOfSector relative to angle.

double getAngleOfNextFreeSectorLeft (double sizeOfSector, double angle, int minDistance) const
 returns the angle of the closest free with angle sizeOfSector relative to angle.

double getAngleOfNextFreeSectorRight (double sizeOfSector, double angle, int minDistance) const
int getDistanceInMajorDirection (Directions direction) const
 returns the distance to the closest obstacle in one of the major directions defined above

int getDistanceInDirection (double direction, double openingAngle) const
 return the distance to the closest obstacle in a given direction and a given opening angle

double getTotalFreeSpaceInSector (double direction, double openingAngle, double maxDist) const
 sums up all distances in a sector specified by direction and opening angle; the maxDist(ance) specifies what the maximum distance should be when adding up (you don't want really big single values to distort the sum)

int getMinimalDistanceInRange (double centerAngle, double openingAngle, double &angleWithMinimalDistance) const
 Calculates the angle with the closest distance to an obstacle.

int getMinimalDistanceInRange (double centerAngle, double openingAngle, double &angleWithMinimalDistance, ObstaclesPercept::ObstacleType obstacleType) const
 Calculates the angle with the closest distance to an obstacle of a certain obstacle type.

double getPercentageOfLowDistanceObstaclesInRange (double centerAngle, double openingAngle, int maxDistance) const
 Calculates the percentage of sectors with obstacles that are closer than the specified distance in the specified range.

double getAngleOfLargeGapInRange (double centerAngle, double openingAngle, SearchDirections searchDirection) const
 Calculates the angle with the farsest distance to an obstacle.

double getAngleOfLargeGapInRange2 (double centerAngle, double openingAngle, SearchDirections searchDirection) const
 Calculates the angle with the farsest distance to an obstacle.


Static Public Member Functions

double getAngleOfSector (int sector)
 return the center angle of a given sector

int getSectorFromAngle (double angle)
 return the corresponding sector to a given angle


Public Attributes

unsigned long frameNumber
 the frame number when perceived

int distance [numOfSectors]
 the distance to the closest obstacle in an angular sector

ObstaclesPercept::ObstacleType obstacleType [numOfSectors]
int corridorInFront
 the distance to the closest obstacle in a rectangular corridor in front of the robot

bool angleToFreePartOfGoalWasDetermined [2]
double angleToFreePartOfGoal [2]
double widthOfFreePartOfGoal [2]
double distanceToFreePartOfGoal [2]
bool angleToNextFreeTeammateWasDetermined
double angleToNextFreeTeammate
double distanceToNextFreeTeammate
double bodyPSD
 last value of the body psd sensor (if present)


Detailed Description

A class describing the distance to obstacles around the robot,.

Definition at line 21 of file ObstaclesModel.h.


Member Enumeration Documentation

enum ObstaclesModel::Directions
 

Enumeration values:
back 
backRight 
right 
frontRight 
front 
frontLeft 
left 
backLeft 
numberOfDirections 

Definition at line 30 of file ObstaclesModel.h.

enum ObstaclesModel::SearchDirections
 

Enumeration values:
searchLeft 
searchLeftAndRight 
searchRight 

Definition at line 31 of file ObstaclesModel.h.

anonymous enum
 

Enumeration values:
numOfSectors 
maxDistance 

Definition at line 32 of file ObstaclesModel.h.

anonymous enum
 

Enumeration values:
ownGoal 
opponentGoal 

Definition at line 131 of file ObstaclesModel.h.


Constructor & Destructor Documentation

ObstaclesModel::ObstaclesModel  ) 
 

Definition at line 13 of file ObstaclesModel.cpp.

References angleToFreePartOfGoalWasDetermined, angleToNextFreeTeammateWasDetermined, bodyPSD, corridorInFront, distance, maxDistance, and numOfSectors.

ObstaclesModel::~ObstaclesModel  ) 
 

Definition at line 26 of file ObstaclesModel.cpp.


Member Function Documentation

void ObstaclesModel::operator= const ObstaclesModel other  ) 
 

copies another ObstaclesModel to this one

Definition at line 494 of file ObstaclesModel.cpp.

References corridorInFront, distance, numOfSectors, and obstacleType.

double ObstaclesModel::getAngleOfSector int  sector  )  [inline, static]
 

return the center angle of a given sector

Definition at line 37 of file ObstaclesModel.h.

References numOfSectors, pi, and pi2.

Referenced by getAngleOfLargeGapInRange(), getAngleOfLargeGapInRange2(), getAngleOfNextFreeSector(), getAngleOfNextFreeSectorLeft(), getAngleOfNextFreeSectorRight(), and getDistanceInCorridor().

void ObstaclesModel::setFrameNumber unsigned long  frameNumber  )  [inline]
 

Definition at line 53 of file ObstaclesModel.h.

Referenced by GT2004ObstaclesLocator::execute().

double ObstaclesModel::getDistanceInCorridor double  angle,
double  width
const
 

returns the distance to the closest obstacle in the corridor specified by angle and width

Definition at line 87 of file ObstaclesModel.cpp.

References Geometry::Line::base, Geometry::Line::direction, distance, getAngleOfSector(), getSectorFromAngle(), LINE, maxDistance, numOfSectors, pi_2, point, Vector2< int >::x, Vector2< double >::x, Vector2< int >::y, and Vector2< double >::y.

Referenced by GT2004BasicBehaviorGoToPointAndAvoidObstacles::execute(), and GT2004ConfigurationSymbols::update().

Here is the call graph for this function:

double ObstaclesModel::getAngleOfNextFreeSector double  sizeOfSector,
double  angle,
int  minDistance
const
 

returns the angle of the closest free sector with angle sizeOfSector relative to angle.

Free means free up to minDistance

Definition at line 237 of file ObstaclesModel.cpp.

References distance, getAngleOfSector(), getSectorFromAngle(), numOfSectors, and pi2.

Referenced by GT2004BasicBehaviorGoToPointAndAvoidObstacles::execute().

Here is the call graph for this function:

double ObstaclesModel::getAngleOfNextFreeSectorLeft double  sizeOfSector,
double  angle,
int  minDistance
const
 

returns the angle of the closest free with angle sizeOfSector relative to angle.

Free means free up to minDistance

Definition at line 143 of file ObstaclesModel.cpp.

References distance, getAngleOfSector(), getSectorFromAngle(), numOfSectors, and pi2.

Referenced by AngleSymbols::calculateCombinedAngles().

Here is the call graph for this function:

double ObstaclesModel::getAngleOfNextFreeSectorRight double  sizeOfSector,
double  angle,
int  minDistance
const
 

Definition at line 191 of file ObstaclesModel.cpp.

References distance, getAngleOfSector(), getSectorFromAngle(), numOfSectors, and pi2.

Referenced by AngleSymbols::calculateCombinedAngles().

Here is the call graph for this function:

int ObstaclesModel::getDistanceInMajorDirection Directions  direction  )  const
 

returns the distance to the closest obstacle in one of the major directions defined above

Definition at line 30 of file ObstaclesModel.cpp.

References distance, maxDistance, numberOfDirections, and numOfSectors.

int ObstaclesModel::getDistanceInDirection double  direction,
double  openingAngle
const
 

return the distance to the closest obstacle in a given direction and a given opening angle

Definition at line 51 of file ObstaclesModel.cpp.

References distance, getSectorFromAngle(), maxDistance, and numOfSectors.

Referenced by GTStandardConverter::setData(), and GT2004ConfigurationSymbols::update().

Here is the call graph for this function:

double ObstaclesModel::getTotalFreeSpaceInSector double  direction,
double  openingAngle,
double  maxDist
const
 

sums up all distances in a sector specified by direction and opening angle; the maxDist(ance) specifies what the maximum distance should be when adding up (you don't want really big single values to distort the sum)

Definition at line 68 of file ObstaclesModel.cpp.

References distance, getSectorFromAngle(), and numOfSectors.

Referenced by GT2004BasicBehaviorGoToPointAndAvoidObstacles::execute().

Here is the call graph for this function:

int ObstaclesModel::getMinimalDistanceInRange double  centerAngle,
double  openingAngle,
double &  angleWithMinimalDistance
const
 

Calculates the angle with the closest distance to an obstacle.

Returns the distance.

Definition at line 296 of file ObstaclesModel.cpp.

Referenced by ObstaclesSymbols::update().

int ObstaclesModel::getMinimalDistanceInRange double  centerAngle,
double  openingAngle,
double &  angleWithMinimalDistance,
ObstaclesPercept::ObstacleType  obstacleType
const
 

Calculates the angle with the closest distance to an obstacle of a certain obstacle type.

Returns the distance.

Definition at line 326 of file ObstaclesModel.cpp.

double ObstaclesModel::getPercentageOfLowDistanceObstaclesInRange double  centerAngle,
double  openingAngle,
int  maxDistance
const
 

Calculates the percentage of sectors with obstacles that are closer than the specified distance in the specified range.

Definition at line 357 of file ObstaclesModel.cpp.

Referenced by ObstaclesSymbols::update().

double ObstaclesModel::getAngleOfLargeGapInRange double  centerAngle,
double  openingAngle,
SearchDirections  searchDirection
const
 

Calculates the angle with the farsest distance to an obstacle.

Returns the angle.

Definition at line 379 of file ObstaclesModel.cpp.

References RingBufferWithSum< n >::add(), distance, getAngleOfSector(), getSectorFromAngle(), RingBufferWithSum< n >::getSum(), min, searchLeft, and searchRight.

Here is the call graph for this function:

double ObstaclesModel::getAngleOfLargeGapInRange2 double  centerAngle,
double  openingAngle,
SearchDirections  searchDirection
const
 

Calculates the angle with the farsest distance to an obstacle.

Returns the angle.

Definition at line 436 of file ObstaclesModel.cpp.

References RingBufferWithSum< n >::add(), distance, getAngleOfSector(), RingBufferWithSum< n >::getMinimum(), getSectorFromAngle(), RingBufferWithSum< n >::getSum(), min, searchLeft, and searchRight.

Here is the call graph for this function:

int ObstaclesModel::getSectorFromAngle double  angle  )  [inline, static]
 

return the corresponding sector to a given angle

Definition at line 126 of file ObstaclesModel.h.

References normalize(), numOfSectors, pi, and pi2.

Referenced by GT2004ObstaclesLocator::addObstaclePoint(), GT2004ObstaclesLocator::addObstaclePoints(), GT2004ObstaclesLocator::addPSDPercept(), GT2004ObstaclesLocator::determineNextFreeTeammate(), getAngleOfLargeGapInRange(), getAngleOfLargeGapInRange2(), getAngleOfNextFreeSector(), getAngleOfNextFreeSectorLeft(), getAngleOfNextFreeSectorRight(), getDistanceInCorridor(), getDistanceInDirection(), getTotalFreeSpaceInSector(), GT2004ObstaclesLocator::moveObstaclesByOdometry(), and GT2004ObstaclesLocator::setObstaclesModel().

Here is the call graph for this function:


Member Data Documentation

unsigned long ObstaclesModel::frameNumber
 

the frame number when perceived

Definition at line 51 of file ObstaclesModel.h.

Referenced by operator<<(), and operator>>().

int ObstaclesModel::distance[numOfSectors]
 

the distance to the closest obstacle in an angular sector

Definition at line 56 of file ObstaclesModel.h.

Referenced by getAngleOfLargeGapInRange(), getAngleOfLargeGapInRange2(), getAngleOfNextFreeSector(), getAngleOfNextFreeSectorLeft(), getAngleOfNextFreeSectorRight(), getDistanceInCorridor(), getDistanceInDirection(), getDistanceInMajorDirection(), getTotalFreeSpaceInSector(), ObstaclesModel(), operator=(), and GT2004ObstaclesLocator::setObstaclesModel().

ObstaclesPercept::ObstacleType ObstaclesModel::obstacleType[numOfSectors]
 

Definition at line 59 of file ObstaclesModel.h.

Referenced by operator=(), and GT2004ObstaclesLocator::setObstaclesModel().

int ObstaclesModel::corridorInFront
 

the distance to the closest obstacle in a rectangular corridor in front of the robot

Definition at line 62 of file ObstaclesModel.h.

Referenced by ObstaclesModel(), operator=(), and GT2004ObstaclesLocator::setObstaclesModel().

bool ObstaclesModel::angleToFreePartOfGoalWasDetermined[2]
 

Definition at line 132 of file ObstaclesModel.h.

Referenced by AngleSymbols::calculateCombinedAngles(), GT2004ObstaclesLocator::determineFreePartsOfGoals(), and ObstaclesModel().

double ObstaclesModel::angleToFreePartOfGoal[2]
 

Definition at line 133 of file ObstaclesModel.h.

Referenced by AngleSymbols::calculateCombinedAngles(), AngleSymbols::calculateVisionBasedAngles(), and GT2004ObstaclesLocator::determineFreePartsOfGoals().

double ObstaclesModel::widthOfFreePartOfGoal[2]
 

Definition at line 134 of file ObstaclesModel.h.

Referenced by GT2004ObstaclesLocator::determineFreePartsOfGoals().

double ObstaclesModel::distanceToFreePartOfGoal[2]
 

Definition at line 135 of file ObstaclesModel.h.

Referenced by GT2004ObstaclesLocator::determineFreePartsOfGoals().

bool ObstaclesModel::angleToNextFreeTeammateWasDetermined
 

Definition at line 137 of file ObstaclesModel.h.

Referenced by GT2004ObstaclesLocator::determineNextFreeTeammate(), and ObstaclesModel().

double ObstaclesModel::angleToNextFreeTeammate
 

Definition at line 138 of file ObstaclesModel.h.

Referenced by GT2004ObstaclesLocator::determineNextFreeTeammate().

double ObstaclesModel::distanceToNextFreeTeammate
 

Definition at line 139 of file ObstaclesModel.h.

Referenced by GT2004ObstaclesLocator::determineNextFreeTeammate().

double ObstaclesModel::bodyPSD
 

last value of the body psd sensor (if present)

Definition at line 144 of file ObstaclesModel.h.

Referenced by ObstaclesModel(), and GT2004ObstaclesLocator::setObstaclesModel().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:10:03 2004 for GT2004 by doxygen 1.3.6