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

# KickSelectionTable Class Reference

`#include <KickSelectionTable.h>`

List of all members.

## Public Types
enum | ActionID { nothing = 0, headLeft, headRight, anyLeft, anyRight, hookLeft, hookRight, leftPaw, rightPaw, armLeft, armRight, pushSoft, pushStrong, chestSoft, chestStrong, putRight, putLeft, forwardKickFast, forwardKickHard, slapRight, slapLeft, headLeftSoft, headRightSoft, backKickLeft, backKickRight, kickAlongArmLeft, kickAlongArmRight, bbHeadLeftSoft, bbHeadLeftStrong, bbHeadRightSoft, bbHeadRightStrong, kickWithBackLegLeft, kickWithBackLegRight, numberOfActions }
| Ids for all possible actions. More...
enum | KickSelectionTableID { inCenterOfField, atLeftBorder, atRightBorder, atLeftOpponentBorder, atRightOpponentBorder, nearOwnGoal, goalie, whenStuck, passing, intentionalKick, hardKicks, numberOfKickSelectionTableIDs }
| IDs for different kick selection tables. More...
enum | { xRange = 20 }
enum | { yRange = 40 }
enum | { maxNumberOfSectors = 24 }
## Public Member Functions
| KickSelectionTable ()
| Constructor.
| ~KickSelectionTable ()
| Destructor.
ActionID | retrieveKick (double ballOffsetX, double ballOffsetY, double destinationAngle, double destinationAngleWidth, KickSelectionTableID kickSelectionTableID) const
| Calculates the best kick based on the position of the ball relative to the robot and a target angle.
Vector2< double > | searchKickInNeighbourhood (double ballOffsetX, double ballOffsetY, double destinationAngle, KickSelectionTableID kickSelectionTableID, RobotPose robotPose, double maxDistance, double &kick) const
void | load (const char *fileName)
| Loads a kick selection table from a file.
## Static Public Member Functions
const char * | getActionName (ActionID id)
| returns names for action ids
const char * | getShortActionName (ActionID id)
| returns short names for action ids (used by streaming operator)
const char * | getKickSelectionTableIDName (KickSelectionTableID id)
| returns a name for an action table id
const ActionID | getActionIDFromSpecialActionID (SpecialActionRequest::SpecialActionID id)
| Returns an action id for a special action id.
KickSelectionTableID | getTableIDFromName (const char *name)
| Returns a table id for a name.
ActionID | getActionIDFromShortName (const char *name)
| Returns an action id for a short name.
## Public Attributes
ActionID | action [xRange][yRange][maxNumberOfSectors][numberOfKickSelectionTableIDs]
| The action tables.
int | numberOfSectors
| The number of sectors.
## Private Member Functions
int | getSectorFromAngle (double destinationAngle) const

## Detailed Description

Author:
  Matthias Jüngel

  Martin Lötzsch

Provides for a set of tables which provides a kick selection depending on a desired kick angle and ball position.

Definition at line 61 of file KickSelectionTable.h.

## Member Enumeration Documentation

enum KickSelectionTable::ActionID

  | Ids for all possible actions. Enumeration values:
  nothing |
  headLeft |
  headRight |
  anyLeft |
  anyRight |
  hookLeft |
  hookRight |
  leftPaw |
  rightPaw |
  armLeft |
  armRight |
  pushSoft |
  pushStrong |
  chestSoft |
  chestStrong |
  putRight |
  putLeft |
  forwardKickFast |
  forwardKickHard |
  slapRight |
  slapLeft |
  headLeftSoft |
  headRightSoft |
  backKickLeft |
  backKickRight |
  kickAlongArmLeft |
  kickAlongArmRight |
  bbHeadLeftSoft |
  bbHeadLeftStrong |
  bbHeadRightSoft |
  bbHeadRightStrong |
  kickWithBackLegLeft |
  kickWithBackLegRight |
  numberOfActions |
Definition at line 71 of file KickSelectionTable.h. Referenced by getActionIDFromShortName(), getActionIDFromSpecialActionID(), and retrieveKick().

enum KickSelectionTable::KickSelectionTableID

  | IDs for different kick selection tables. Enumeration values:
  inCenterOfField |
  atLeftBorder |
  atRightBorder |
  atLeftOpponentBorder |
  atRightOpponentBorder |
  nearOwnGoal |
  goalie |
  whenStuck |
  passing |
  intentionalKick |
  hardKicks |
  numberOfKickSelectionTableIDs |
Definition at line 195 of file KickSelectionTable.h. Referenced by getTableIDFromName().

anonymous enum

  | Enumeration values:
  xRange |
Definition at line 274 of file KickSelectionTable.h.

anonymous enum

  | Enumeration values:
  yRange |
Definition at line 277 of file KickSelectionTable.h.

anonymous enum

  | Enumeration values:
  maxNumberOfSectors |
Definition at line 280 of file KickSelectionTable.h.

## Constructor & Destructor Documentation

KickSelectionTable::KickSelectionTable | ( |  | ) |

| Constructor. Definition at line 23 of file KickSelectionTable.cpp. References action.

KickSelectionTable::~KickSelectionTable | ( |  | ) |

| Destructor. Definition at line 28 of file KickSelectionTable.cpp.

## Member Function Documentation

const char* KickSelectionTable::getActionName | ( | ActionID | id | ) | `[inline, static]`

| returns names for action ids Definition at line 109 of file KickSelectionTable.h. References anyLeft, anyRight, armLeft, armRight, backKickLeft, backKickRight, bbHeadLeftSoft, bbHeadLeftStrong, bbHeadRightSoft, bbHeadRightStrong, chestSoft, chestStrong, forwardKickFast, forwardKickHard, headLeft, headLeftSoft, headRight, headRightSoft, hookLeft, hookRight, kickAlongArmLeft, kickAlongArmRight, kickWithBackLegLeft, kickWithBackLegRight, leftPaw, nothing, pushSoft, pushStrong, putLeft, putRight, rightPaw, slapLeft, and slapRight.

const char* KickSelectionTable::getShortActionName | ( | ActionID | id | ) | `[inline, static]`

| returns short names for action ids (used by streaming operator) Definition at line 151 of file KickSelectionTable.h. References anyLeft, anyRight, armLeft, armRight, ASSERT, backKickLeft, backKickRight, bbHeadLeftSoft, bbHeadLeftStrong, bbHeadRightSoft, bbHeadRightStrong, chestSoft, chestStrong, forwardKickFast, forwardKickHard, headLeft, headLeftSoft, headRight, headRightSoft, hookLeft, hookRight, kickAlongArmLeft, kickAlongArmRight, kickWithBackLegLeft, kickWithBackLegRight, leftPaw, nothing, pushSoft, pushStrong, putLeft, putRight, rightPaw, slapLeft, and slapRight. Referenced by getActionIDFromShortName(), and operator<<().

const char* KickSelectionTable::getKickSelectionTableIDName | ( | KickSelectionTableID | id | ) | `[inline, static]`

| returns a name for an action table id Definition at line 212 of file KickSelectionTable.h. References ASSERT, atLeftBorder, atLeftOpponentBorder, atRightBorder, atRightOpponentBorder, goalie, hardKicks, inCenterOfField, intentionalKick, nearOwnGoal, passing, and whenStuck. Referenced by getTableIDFromName(), and operator<<().

const ActionID KickSelectionTable::getActionIDFromSpecialActionID | ( | SpecialActionRequest::SpecialActionID | id | ) | `[inline, static]`

| Returns an action id for a special action id. Definition at line 234 of file KickSelectionTable.h. References ActionID, anyLeft, SpecialActionRequest::anyLeft, anyRight, SpecialActionRequest::anyRight, armLeft, SpecialActionRequest::armLeft, armRight, SpecialActionRequest::armRight, backKickLeft, SpecialActionRequest::backKickLeft, backKickRight, SpecialActionRequest::backKickRight, bbHeadLeftSoft, SpecialActionRequest::bbHeadLeftSoft, bbHeadLeftStrong, SpecialActionRequest::bbHeadLeftStrong, bbHeadRightSoft, SpecialActionRequest::bbHeadRightSoft, bbHeadRightStrong, SpecialActionRequest::bbHeadRightStrong, chestSoft, SpecialActionRequest::chestSoft, forwardKickFast, SpecialActionRequest::forwardKickFast, forwardKickHard, SpecialActionRequest::forwardKickHard, headLeft, SpecialActionRequest::headLeft, headLeftSoft, SpecialActionRequest::headLeftSoft, headRight, SpecialActionRequest::headRight, headRightSoft, SpecialActionRequest::headRightSoft, hookLeft, SpecialActionRequest::hookLeft, hookRight, SpecialActionRequest::hookRight, kickAlongArmLeft, SpecialActionRequest::kickAlongArmLeft, kickAlongArmRight, SpecialActionRequest::kickAlongArmRight, kickWithBackLegLeft, SpecialActionRequest::kickWithBackLegLeft, kickWithBackLegRight, SpecialActionRequest::kickWithBackLegRight, leftPaw, SpecialActionRequest::leftPaw, nothing, pushSoft, SpecialActionRequest::pushSoft, pushStrong, SpecialActionRequest::pushStrong, putLeft, SpecialActionRequest::putLeft, putRight, SpecialActionRequest::putRight, rightPaw, SpecialActionRequest::rightPaw, slapLeft, SpecialActionRequest::slapLeft, slapRight, and SpecialActionRequest::slapRight.

KickSelectionTable::ActionID KickSelectionTable::retrieveKick | ( | double | ballOffsetX,
|  | double | ballOffsetY,
|  | double | destinationAngle,
|  | double | destinationAngleWidth,
|  | KickSelectionTableID | kickSelectionTableID
| ) | const

| Calculates the best kick based on the position of the ball relative to the robot and a target angle. Definition at line 136 of file KickSelectionTable.cpp. References ActionID, fromDegrees(), normalize(), pi, xRange, and yRange. Referenced by KickSelectionSymbols::retrieveKick().

Here is the call graph for this function:

Vector2< double > KickSelectionTable::searchKickInNeighbourhood | ( | double | ballOffsetX,
|  | double | ballOffsetY,
|  | double | destinationAngle,
|  | KickSelectionTableID | kickSelectionTableID,
|  | RobotPose | robotPose,
|  | double | maxDistance,
|  | double & | kick
| ) | const

| Definition at line 72 of file KickSelectionTable.cpp. References Vector2< V >::abs(), action, CIRCLE, CROSS, DEBUG_DRAWING_FINISHED, getSectorFromAngle(), nothing, Geometry::relative2FieldCoord(), Vector2< V >::x, Vector2< V >::y, and yRange. Referenced by KickSelectionSymbols::intentionalKickPossible().

Here is the call graph for this function:

KickSelectionTable::KickSelectionTableID KickSelectionTable::getTableIDFromName | ( | const char * | name | ) | `[static]`

| Returns a table id for a name. Definition at line 32 of file KickSelectionTable.cpp. References getKickSelectionTableIDName(), inCenterOfField, KickSelectionTableID, and numberOfKickSelectionTableIDs. Referenced by operator>>().

Here is the call graph for this function:

KickSelectionTable::ActionID KickSelectionTable::getActionIDFromShortName | ( | const char * | name | ) | `[static]`

| Returns an action id for a short name. Definition at line 45 of file KickSelectionTable.cpp. References ActionID, getShortActionName(), nothing, and numberOfActions. Referenced by operator>>().

Here is the call graph for this function:

void KickSelectionTable::load | ( | const char * | fileName | ) |

| Loads a kick selection table from a file. Definition at line 58 of file KickSelectionTable.cpp. References InFile::exists(), and getLocation(). Referenced by KickSelectionSymbols::KickSelectionSymbols().

Here is the call graph for this function:

int KickSelectionTable::getSectorFromAngle | ( | double | destinationAngle | ) | const`[private]`

| Definition at line 68 of file KickSelectionTable.cpp. References fromDegrees(), normalize(), numberOfSectors, pi, and pi2. Referenced by searchKickInNeighbourhood().

Here is the call graph for this function:

## Member Data Documentation

ActionID KickSelectionTable::action[xRange][yRange][maxNumberOfSectors][numberOfKickSelectionTableIDs]

| The action tables. Definition at line 302 of file KickSelectionTable.h. Referenced by KickSelectionTable(), operator<<(), operator>>(), and searchKickInNeighbourhood().

int KickSelectionTable::numberOfSectors

| The number of sectors. Definition at line 305 of file KickSelectionTable.h. Referenced by getSectorFromAngle(), operator<<(), and operator>>().

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

- Tools/KickSelectionTable.h
- Tools/KickSelectionTable.cpp