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

int getSectorDistanceInDirection (double direction) const
 return the distance of an sector to the closest obstacle in a given direction

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

int currentlySeenStartSector
 currently seen begining sector and end sector

int currentlySeenEndSector
double angleToFreePartOfGoal [2]
double widthOfFreePartOfGoal [2]
double distanceToFreePartOfGoal [2]
unsigned long lastTimeFreePartOfGoalWasDetermined [2]
bool angleToFreePartOfGoalWasDetermined [2]
bool angleToNextFreeTeammateWasDetermined
double angleToNextFreeTeammate
double distanceToNextFreeTeammate
double angleToSeenGoal [2]
 angle to seen goal, updated by vision and odometry

double distanceToSeenGoal [2]
 distance to seen goal, updated by vision and odometry

bool trustSeenGoal [2]
 something is definitely wrong with the seen goal (occurs only when not seeing the goal)

unsigned long timeOfSeenGoal [2]
 time since last seen goal

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 139 of file ObstaclesModel.h.


Constructor & Destructor Documentation

ObstaclesModel::ObstaclesModel  ) 
 

Definition at line 16 of file ObstaclesModel.cpp.

References angleToFreePartOfGoalWasDetermined, angleToNextFreeTeammateWasDetermined, bodyPSD, corridorInFront, currentlySeenEndSector, currentlySeenStartSector, distance, lastTimeFreePartOfGoalWasDetermined, maxDistance, numOfSectors, and trustSeenGoal.

ObstaclesModel::~ObstaclesModel  ) 
 

Definition at line 36 of file ObstaclesModel.cpp.


Member Function Documentation

void ObstaclesModel::operator= const ObstaclesModel other  ) 
 

copies another ObstaclesModel to this one

Definition at line 514 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(), getDistanceInCorridor(), GTCamObstaclesLocator::modelLine(), and GTCamObstaclesLocator::modelRobot().

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

Definition at line 53 of file ObstaclesModel.h.

Referenced by GT2005ObstaclesLocator::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 107 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 GT2005BasicBehaviorGoToPointAndAvoidObstacles::execute(), and GT2005ConfigurationSymbols::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 257 of file ObstaclesModel.cpp.

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

Referenced by GT2005BasicBehaviorGoToPointAndAvoidObstacles::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 163 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 211 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 40 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 61 of file ObstaclesModel.cpp.

References distance, getSectorFromAngle(), and numOfSectors.

Referenced by GT2005BasicBehaviorDirectedScanForObstacles::execute(), ObstaclesSymbols::getNearestObstacleFrontLeft(), ObstaclesSymbols::getNearestObstacleFrontRight(), ObstaclesSymbols::getObstacleInFront(), GTStandardConverter::setData(), and GT2005ConfigurationSymbols::update().

Here is the call graph for this function:

int ObstaclesModel::getSectorDistanceInDirection double  direction  )  const
 

return the distance of an sector to the closest obstacle in a given direction

Definition at line 81 of file ObstaclesModel.cpp.

References distance, and getSectorFromAngle().

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 88 of file ObstaclesModel.cpp.

References distance, getSectorFromAngle(), and numOfSectors.

Referenced by GT2005BasicBehaviorGoToPointAndAvoidObstacles::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 316 of file ObstaclesModel.cpp.

Referenced by ObstaclesSymbols::getMinDistanceLeft(), ObstaclesSymbols::getMinDistanceRight(), and 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 346 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 377 of file ObstaclesModel.cpp.

Referenced by ObstaclesSymbols::getObstacleInFront(), and 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 399 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 456 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 134 of file ObstaclesModel.h.

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

Referenced by GT2005ObstaclesLocator::addObstaclePoint(), GT2005ObstaclesLocator::addObstaclePoints(), GT2005ObstaclesLocator::addPSDPercept(), GT2005ObstaclesLocator::determineNextFreeTeammate(), GTCamObstaclesLocator::execute(), getAngleOfLargeGapInRange(), getAngleOfLargeGapInRange2(), getAngleOfNextFreeSector(), getAngleOfNextFreeSectorLeft(), getAngleOfNextFreeSectorRight(), getDistanceInCorridor(), getDistanceInDirection(), getSectorDistanceInDirection(), getTotalFreeSpaceInSector(), GTCamObstaclesLocator::GTCamObstaclesLocator(), GTCamObstaclesLocator::modelLine(), GTCamObstaclesLocator::modelRobot(), GT2005ObstaclesLocator::moveObstaclesByOdometry(), and GT2005ObstaclesLocator::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 GTCamObstaclesLocator::execute(), 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 GTCamObstaclesLocator::execute(), getAngleOfLargeGapInRange(), getAngleOfLargeGapInRange2(), getAngleOfNextFreeSector(), getAngleOfNextFreeSectorLeft(), getAngleOfNextFreeSectorRight(), getDistanceInCorridor(), getDistanceInDirection(), getDistanceInMajorDirection(), getSectorDistanceInDirection(), getTotalFreeSpaceInSector(), GTCamObstaclesLocator::modelLine(), GTCamObstaclesLocator::modelRobot(), ObstaclesModel(), operator=(), and GT2005ObstaclesLocator::setObstaclesModel().

ObstaclesPercept::ObstacleType ObstaclesModel::obstacleType[numOfSectors]
 

Definition at line 59 of file ObstaclesModel.h.

Referenced by GTCamObstaclesLocator::execute(), GTCamObstaclesLocator::modelLine(), GTCamObstaclesLocator::modelRobot(), operator=(), and GT2005ObstaclesLocator::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 GTCamObstaclesLocator::execute(), ObstaclesSymbols::getMinDistanceMiddle(), ObstaclesModel(), operator=(), and GT2005ObstaclesLocator::setObstaclesModel().

int ObstaclesModel::currentlySeenStartSector
 

currently seen begining sector and end sector

Definition at line 65 of file ObstaclesModel.h.

Referenced by GT2005ObstaclesLocator::addObstaclesPercept(), and ObstaclesModel().

int ObstaclesModel::currentlySeenEndSector
 

Definition at line 66 of file ObstaclesModel.h.

Referenced by GT2005ObstaclesLocator::addObstaclesPercept(), and ObstaclesModel().

double ObstaclesModel::angleToFreePartOfGoal[2]
 

Definition at line 140 of file ObstaclesModel.h.

Referenced by AngleSymbols::calculateCombinedAngles(), AngleSymbols::calculateVisionBasedAngles(), GT2005ObstaclesLocator::determineFreePartsOfGoals(), and GTCamObstaclesLocator::execute().

double ObstaclesModel::widthOfFreePartOfGoal[2]
 

Definition at line 141 of file ObstaclesModel.h.

Referenced by AngleSymbols::calculateVisionBasedAngles(), GT2005ObstaclesLocator::determineFreePartsOfGoals(), GTCamObstaclesLocator::execute(), operator<<(), and operator>>().

double ObstaclesModel::distanceToFreePartOfGoal[2]
 

Definition at line 142 of file ObstaclesModel.h.

Referenced by GT2005ObstaclesLocator::determineFreePartsOfGoals(), and GTCamObstaclesLocator::execute().

unsigned long ObstaclesModel::lastTimeFreePartOfGoalWasDetermined[2]
 

Definition at line 143 of file ObstaclesModel.h.

Referenced by GT2005ObstaclesLocator::determineFreePartsOfGoals(), GTCamObstaclesLocator::execute(), AngleSymbols::getTimeSinceOpponentGoalDetection(), and ObstaclesModel().

bool ObstaclesModel::angleToFreePartOfGoalWasDetermined[2]
 

Definition at line 144 of file ObstaclesModel.h.

Referenced by AngleSymbols::calculateCombinedAngles(), GT2005ObstaclesLocator::determineFreePartsOfGoals(), GTCamObstaclesLocator::execute(), ObstaclesModel(), operator<<(), and operator>>().

bool ObstaclesModel::angleToNextFreeTeammateWasDetermined
 

Definition at line 146 of file ObstaclesModel.h.

Referenced by GT2005ObstaclesLocator::determineNextFreeTeammate(), GTCamObstaclesLocator::execute(), and ObstaclesModel().

double ObstaclesModel::angleToNextFreeTeammate
 

Definition at line 147 of file ObstaclesModel.h.

Referenced by GT2005ObstaclesLocator::determineNextFreeTeammate(), and GTCamObstaclesLocator::execute().

double ObstaclesModel::distanceToNextFreeTeammate
 

Definition at line 148 of file ObstaclesModel.h.

Referenced by GT2005ObstaclesLocator::determineNextFreeTeammate(), and GTCamObstaclesLocator::execute().

double ObstaclesModel::angleToSeenGoal[2]
 

angle to seen goal, updated by vision and odometry

Definition at line 151 of file ObstaclesModel.h.

Referenced by AngleSymbols::calculateVisionBasedAngles(), and GT2005ObstaclesLocator::determineSeenGoals().

double ObstaclesModel::distanceToSeenGoal[2]
 

distance to seen goal, updated by vision and odometry

Definition at line 154 of file ObstaclesModel.h.

Referenced by GT2005ObstaclesLocator::determineSeenGoals().

bool ObstaclesModel::trustSeenGoal[2]
 

something is definitely wrong with the seen goal (occurs only when not seeing the goal)

Definition at line 157 of file ObstaclesModel.h.

Referenced by AngleSymbols::calculateCombinedAngles(), GT2005ObstaclesLocator::determineSeenGoals(), AngleSymbols::getTrustOfSeenAngleToOpponentGoal(), and ObstaclesModel().

unsigned long ObstaclesModel::timeOfSeenGoal[2]
 

time since last seen goal

Definition at line 161 of file ObstaclesModel.h.

Referenced by AngleSymbols::calculateCombinedAngles(), GT2005ObstaclesLocator::determineSeenGoals(), and AngleSymbols::getTimeSinceLastSeenOpponentGoal().

double ObstaclesModel::bodyPSD
 

last value of the body psd sensor (if present)

Definition at line 167 of file ObstaclesModel.h.

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


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 22:18:23 2006 for GT2005 by doxygen 1.3.6