#include <GT2004ObstaclesLocator.h>
Inheritance diagram for GT2004ObstaclesLocator:
Definition at line 18 of file GT2004ObstaclesLocator.h.
anonymous enum |
Definition at line 22 of file GT2004ObstaclesLocator.h.
GT2004ObstaclesLocator::GT2004ObstaclesLocator | ( | const ObstaclesLocatorInterfaces & | interfaces | ) |
Constructor.
interfaces | The paramters of the ObstaclesLocator module. |
Definition at line 24 of file GT2004ObstaclesLocator.cpp.
References ObstaclesModel::numOfSectors, obstacles, obstacleTypes, pi2, sectorWidth, ObstaclesPercept::unknown, useAging, useLinesPercept, useObstaclesPercept, usePSD, and Vector2< V >::y.
void GT2004ObstaclesLocator::addLinesPercept | ( | ) |
Definition at line 269 of file GT2004ObstaclesLocator.cpp.
References addObstaclePoint(), LinesPercept::blueRobot, LinesPercept::border, extend, limit, ObstaclesLocatorInterfaces::linesPercept, LinesPercept::numberOfPoints, LinesPercept::points, LinesPercept::redRobot, and Vector2< V >::y.
Referenced by execute().
void GT2004ObstaclesLocator::addObstaclePoint | ( | const Vector2< double > & | obstaclePoint, | |
UpdateMode | mode | |||
) |
Definition at line 316 of file GT2004ObstaclesLocator.cpp.
References Vector2< V >::angle(), Drawings::blue, DOT, SystemCall::getCurrentSystemTime(), ObstaclesModel::getSectorFromAngle(), idText, normalize(), ObstaclesModel::numOfSectors, OUTPUT, and text.
Referenced by addLinesPercept().
void GT2004ObstaclesLocator::addObstaclePoints | ( | const Vector2< int > & | nearPoint, | |
const Vector2< int > & | farPoint, | |||
bool | farPointIsOnImageBorder, | |||
ObstaclesPercept::ObstacleType | obstacleType | |||
) |
Definition at line 384 of file GT2004ObstaclesLocator.cpp.
References Vector2< V >::angle(), SystemCall::getCurrentSystemTime(), ObstaclesModel::getSectorFromAngle(), idText, normalize(), ObstaclesModel::numOfSectors, OUTPUT, text, ObstaclesPercept::unknown, and Vector2< V >::x.
Referenced by addObstaclesPercept().
void GT2004ObstaclesLocator::addObstaclesPercept | ( | ) |
Definition at line 289 of file GT2004ObstaclesLocator.cpp.
References addObstaclePoints(), ObstaclesPercept::farPointIsOnImageBorder, ObstaclesPercept::farPoints, ObstaclesPercept::nearPoints, ObstaclesPercept::numberOfPoints, ObstaclesLocatorInterfaces::obstaclesPercept, and ObstaclesPercept::obstacleType.
Referenced by execute().
void GT2004ObstaclesLocator::addPSDPercept | ( | ) |
Definition at line 217 of file GT2004ObstaclesLocator.cpp.
References Geometry::angleTo(), ObstaclesLocatorInterfaces::ballModel, DOT, SystemCall::getCurrentSystemTime(), RobotPose::getPose(), ObstaclesModel::getSectorFromAngle(), SystemCall::getTimeSince(), Drawings::green, headTiltClipPSD, normalize(), PSDPercept::numOfPercepts, obstacles, ObstaclesLocatorInterfaces::psdPercept, ObstaclesLocatorInterfaces::robotPose, BallModel::seen, timestamps, SeenBallPosition::timeWhenLastSeen, toDegrees(), Vector2< V >::x, and Vector2< V >::y.
void GT2004ObstaclesLocator::determineFreePartsOfGoals | ( | ) | [private] |
Definition at line 422 of file GT2004ObstaclesLocator.cpp.
References ObstaclesPercept::angleToFreePartOfGoal, angleToFreePartOfGoal, ObstaclesModel::angleToFreePartOfGoalWasDetermined, ObstaclesPercept::angleToFreePartOfGoalWasDetermined, ObstaclesPercept::distanceToFreePartOfGoal, distanceToFreePartOfGoal, SystemCall::getCurrentSystemTime(), lastTimeFreePartOfGoalWasDetermined, ObstaclesLocatorInterfaces::obstaclesModel, ObstaclesLocatorInterfaces::obstaclesPercept, widthOfFreePartOfGoal, and ObstaclesPercept::widthOfFreePartOfGoal.
Referenced by execute().
void GT2004ObstaclesLocator::determineNextFreeTeammate | ( | ) | [private] |
Definition at line 467 of file GT2004ObstaclesLocator.cpp.
References abs(), Geometry::angleTo(), ObstaclesModel::angleToNextFreeTeammate, ObstaclesModel::angleToNextFreeTeammateWasDetermined, ObstaclesModel::distanceToNextFreeTeammate, PlayerPoseCollection::getOwnPlayerPose(), RobotPose::getPose(), ObstaclesModel::getSectorFromAngle(), int(), normalize(), PlayerPoseCollection::numberOfOwnPlayers, obstacles, ObstaclesLocatorInterfaces::obstaclesModel, ObstaclesLocatorInterfaces::playerPoseCollection, ObstaclesLocatorInterfaces::robotPose, and Pose2D::translation.
Referenced by execute().
void GT2004ObstaclesLocator::execute | ( | ) | [virtual] |
Executes the module
Implements Module.
Definition at line 43 of file GT2004ObstaclesLocator.cpp.
References addLinesPercept(), addObstaclesPercept(), DEBUG_DRAWING_FINISHED, determineFreePartsOfGoals(), determineNextFreeTeammate(), ObstaclesPercept::frameNumber, lastOdometry, moveObstaclesByOdometry(), ObstaclesLocatorInterfaces::obstaclesModel, ObstaclesLocatorInterfaces::obstaclesPercept, odometry, ObstaclesLocatorInterfaces::odometryData, ObstaclesModel::setFrameNumber(), setObstaclesModel(), useLinesPercept, and useObstaclesPercept.
bool GT2004ObstaclesLocator::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.
message | The message that can be read. |
Reimplemented from Module.
Definition at line 508 of file GT2004ObstaclesLocator.cpp.
References InMessage::bin, d, GenericDebugData::defaultObstaclesLocator, InMessage::getMessageID(), headTiltClipPSD, idGenericDebugData, idText, OUTPUT, text, useAging, useLinesPercept, and usePSD.
void GT2004ObstaclesLocator::moveObstaclesByOdometry | ( | ) |
Definition at line 63 of file GT2004ObstaclesLocator.cpp.
References ObstaclesModel::getSectorFromAngle(), SystemCall::getTimeSince(), ObstaclesModel::numOfSectors, obstacles, obstacleTypes, odometry, Pose2D::rotation, timeAfterWhichObstacleIsForgotten, timestamps, Pose2D::translation, ObstaclesPercept::unknown, useAging, Vector2< V >::x, and Vector2< V >::y.
Referenced by execute().
void GT2004ObstaclesLocator::setObstaclesModel | ( | bool | addWorldModel = true |
) |
Definition at line 122 of file GT2004ObstaclesLocator.cpp.
References abs(), buffer, ObstaclesModel::distance, distance(), FieldDimensions::distanceToOwnPenaltyArea(), field, ObstaclesModel::getAngleOfSector(), Field::getDistanceToOwnPenaltyArea(), getPlayer(), int(), ObstaclesModel::maxDistance, ObstaclesModel::numOfSectors, obstacles, ObstaclesLocatorInterfaces::obstaclesModel, ObstaclesModel::obstacleType, obstacleTypes, Player::one, ObstaclesLocatorInterfaces::robotPose, and ObstaclesPercept::unknown.
Referenced by execute().
double GT2004ObstaclesLocator::angleToFreePartOfGoal[2] [private] |
angle to a free part of the goal, updated by vision and turn(!) odometry
Definition at line 81 of file GT2004ObstaclesLocator.h.
Referenced by determineFreePartsOfGoals().
double GT2004ObstaclesLocator::distanceToFreePartOfGoal[2] [private] |
the distance to the free part of the goal
Definition at line 87 of file GT2004ObstaclesLocator.h.
Referenced by determineFreePartsOfGoals().
head tilt angle below which psd percepts are ignored
Definition at line 45 of file GT2004ObstaclesLocator.h.
Referenced by addPSDPercept(), and handleMessage().
unsigned long GT2004ObstaclesLocator::lastTimeFreePartOfGoalWasDetermined[2] [private] |
Last time a free part of a goal was detected
Definition at line 78 of file GT2004ObstaclesLocator.h.
Referenced by determineFreePartsOfGoals().
Vector2<double> GT2004ObstaclesLocator::obstacles[ObstaclesModel::numOfSectors] |
Definition at line 35 of file GT2004ObstaclesLocator.h.
Referenced by addPSDPercept(), determineNextFreeTeammate(), GT2004ObstaclesLocator(), moveObstaclesByOdometry(), and setObstaclesModel().
ObstaclesPercept::ObstacleType GT2004ObstaclesLocator::obstacleTypes[ObstaclesModel::numOfSectors] |
Definition at line 36 of file GT2004ObstaclesLocator.h.
Referenced by GT2004ObstaclesLocator(), moveObstaclesByOdometry(), and setObstaclesModel().
Definition at line 42 of file GT2004ObstaclesLocator.h.
Referenced by execute(), and moveObstaclesByOdometry().
Definition at line 32 of file GT2004ObstaclesLocator.h.
unsigned long GT2004ObstaclesLocator::timestamps[ObstaclesModel::numOfSectors] |
Definition at line 38 of file GT2004ObstaclesLocator.h.
Referenced by addPSDPercept(), and moveObstaclesByOdometry().
Definition at line 53 of file GT2004ObstaclesLocator.h.
Referenced by GT2004ObstaclesLocator(), handleMessage(), and moveObstaclesByOdometry().
Definition at line 51 of file GT2004ObstaclesLocator.h.
Referenced by execute(), GT2004ObstaclesLocator(), and handleMessage().
Definition at line 52 of file GT2004ObstaclesLocator.h.
Referenced by execute(), and GT2004ObstaclesLocator().
Definition at line 50 of file GT2004ObstaclesLocator.h.
Referenced by GT2004ObstaclesLocator(), and handleMessage().
double GT2004ObstaclesLocator::widthOfFreePartOfGoal[2] [private] |
the width of the free part of goal
Definition at line 84 of file GT2004ObstaclesLocator.h.
Referenced by determineFreePartsOfGoals().