|
Thunderbots Project
|
#include <field.h>
Public Member Functions | |
| Field (double field_x_length, double field_y_length, double defense_x_length, double defense_y_length, double goal_x_length, double goal_y_length, double boundary_buffer_size, double center_circle_radius) | |
| Field (const TbotsProto::Field &field_proto) | |
| double | xLength () const |
| double | totalXLength () const |
| double | yLength () const |
| double | totalYLength () const |
| double | goalYLength () const |
| double | goalXLength () const |
| double | centerCircleRadius () const |
| Circle | centerCircle () const |
| Point | centerPoint () const |
| Segment | halfwayLine () const |
| double | defenseAreaYLength () const |
| double | defenseAreaXLength () const |
| const Rectangle & | friendlyDefenseArea () const |
| const Rectangle & | enemyDefenseArea () const |
| Rectangle | friendlyHalf () const |
| Rectangle | friendlyPositiveYQuadrant () const |
| Rectangle | friendlyNegativeYQuadrant () const |
| Rectangle | enemyHalf () const |
| Rectangle | enemyPositiveYQuadrant () const |
| Rectangle | enemyNegativeYQuadrant () const |
| const Rectangle & | fieldLines () const |
| Rectangle | fieldBoundary () const |
| Point | friendlyGoalCenter () const |
| Point | enemyGoalCenter () const |
| const Rectangle & | friendlyGoal () const |
| const Rectangle & | enemyGoal () const |
| Point | friendlyPenaltyMark () const |
| Point | enemyPenaltyMark () const |
| Point | friendlyCornerPos () const |
| Point | friendlyCornerNeg () const |
| Point | enemyCornerPos () const |
| Point | enemyCornerNeg () const |
| Point | friendlyGoalpostPos () const |
| Point | friendlyGoalpostNeg () const |
| Point | enemyGoalpostPos () const |
| Point | enemyGoalpostNeg () const |
| double | boundaryMargin () const |
| bool | pointInFriendlyDefenseArea (const Point &p) const |
| bool | pointInEnemyDefenseArea (const Point &p) const |
| bool | pointInFriendlyHalf (const Point &p) const |
| bool | pointInEnemyHalf (const Point &p) const |
| bool | pointInFriendlyCorner (const Point &p, double radius) const |
| bool | pointInEnemyCorner (const Point &p, double radius) const |
| bool | operator== (const Field &other) const |
| bool | operator!= (const Field &other) const |
Static Public Member Functions | |
| static Field | createSSLDivisionBField () |
| static Field | createSSLDivisionAField () |
| static Field | createField (TbotsProto::FieldType field_type) |
Exposes the dimensions of various parts of the field.
+-------+-------+-------+ | | Enemy | | | +-------+ | | | | ^ +x | | | | | | | | | | | +y | | | <--------+ (0,0) | | | | | | | | +----------+ | | | Friendly | | +------+----------+-----+
|
explicit |
Constructs a new field with the given dimensions
| invalid_argument | if at least one dimension is <= 0 |
| field_x_length | the length of the playing area (along the x-axis) |
| field_y_length | the length of the playing area (along the y-axis) |
| defense_x_length | the length of the defense area (along the x-axis) |
| defense_y_length | the length of the defense area (along the y-axis) |
| goal_x_length | the length of the goal (along the x-axis) |
| goal_y_length | the length of the goal (along the y-axis) |
| boundary_buffer_size | the size of the boundary area between the edge of the playing area and the physical border/perimeter of the field |
| center_circle_radius | the radius of the center circle |
|
explicit |
Constructs a new field based on the TbotsProto::Field protobuf representation
| invalid_argument | if at least one dimension is <= 0 |
| field_proto |
| double boundaryMargin | ( | ) | const |
Gets the margin for being out of bounds on the top or bottom of the field in metres.
| Circle centerCircle | ( | ) | const |
Returns the center circle at the middle of the field
| double centerCircleRadius | ( | ) | const |
Gets the radius of the centre circle in metres.
| Point centerPoint | ( | ) | const |
Returns the center point of the field
|
static |
Creates a field with the standard SSL Division A or B dimensions
| field_type | The field type |
|
static |
Creates a field with the standard SSL Division A dimensions
|
static |
Creates a field with the standard SSL Division B dimensions
| double defenseAreaXLength | ( | ) | const |
Gets the length of the defense area in metres, which runs along the x-axis. This is how far the defense area extends in front of the goal.
| double defenseAreaYLength | ( | ) | const |
Gets the width of the defense area in metres, which runs along the y-axis. This is the total width of how far the defense area stretches from one side of the goal to the other.
| Point enemyCornerNeg | ( | ) | const |
Gets the position of the enemy corner with the negative y-axis
| Point enemyCornerPos | ( | ) | const |
Gets the position of the enemy corner with the positive y-axis
| const Rectangle & enemyDefenseArea | ( | ) | const |
Gets the enemy defense area as a Rectangle.
| const Rectangle & enemyGoal | ( | ) | const |
Gets the area within the enemy goal.
| Point enemyGoalCenter | ( | ) | const |
Gets the position of the centre of the enemy goal.
| Point enemyGoalpostNeg | ( | ) | const |
Gets the position of the enemy goalpost with the negative y-axis
| Point enemyGoalpostPos | ( | ) | const |
Gets the position of the enemy goalpost with the positive y-axis
| Rectangle enemyHalf | ( | ) | const |
Gets the enemy half of the field within field lines
| Rectangle enemyNegativeYQuadrant | ( | ) | const |
Gets the enemy negative Y quadrant of the field
| Point enemyPenaltyMark | ( | ) | const |
Gets the position of the enemy team's penalty mark.
| Rectangle enemyPositiveYQuadrant | ( | ) | const |
Gets the enemy positive Y quadrant of the field
| Rectangle fieldBoundary | ( | ) | const |
Gets the area within the field boundary (the physical walls surrounding the Field). This is the entire area where the robots and ball can move, and is a superset of the area inside the field lines.
| const Rectangle & fieldLines | ( | ) | const |
Gets the area within the field lines as a rectangle. This is the set of locations where the ball is considered "in play".
| Point friendlyCornerNeg | ( | ) | const |
Gets the position of our corner with the negative y-axis
| Point friendlyCornerPos | ( | ) | const |
Gets the position of our corner with the positive y-axis
| const Rectangle & friendlyDefenseArea | ( | ) | const |
Gets the friendly defense area as a Rectangle.
| const Rectangle & friendlyGoal | ( | ) | const |
Gets the area within the friendly goal.
| Point friendlyGoalCenter | ( | ) | const |
Gets the position of the centre of the friendly goal.
| Point friendlyGoalpostNeg | ( | ) | const |
Gets the position of the friendly goalpost with the negative y-axis
| Point friendlyGoalpostPos | ( | ) | const |
Gets the position of the friendly goalpost with the positive y-axis
| Rectangle friendlyHalf | ( | ) | const |
Gets the friendly half of the field within field lines
| Rectangle friendlyNegativeYQuadrant | ( | ) | const |
Gets the friendly negative Y quadrant of the field
| Point friendlyPenaltyMark | ( | ) | const |
Gets the position of the friendly team's penalty mark.
| Rectangle friendlyPositiveYQuadrant | ( | ) | const |
Gets the friendly positive Y quadrant of the field
| double goalXLength | ( | ) | const |
Gets the "depth" of the goal along the x-axis, in metres.
| double goalYLength | ( | ) | const |
Gets the y-axis length of the goal, symmetric above and below the centreline, from goalpost to goalpost in metres.
| Segment halfwayLine | ( | ) | const |
Returns the halfway line of the field (as a segment) The segment is on the Y axis and is bounded by the field lines
| bool operator!= | ( | const Field & | other | ) | const |
Compares two fields for inequality
| other | the field the compare to |
| bool operator== | ( | const Field & | other | ) | const |
Compares two fields for equality
| other | the field to compare to |
| bool pointInEnemyCorner | ( | const Point & | p, |
| double | radius | ||
| ) | const |
Returns true if the point is in within the provided radius in one of the enemy corner.
| point | |
| the | radius from the corner, to decide whether or not the point is in the field. |
| bool pointInEnemyDefenseArea | ( | const Point & | p | ) | const |
Returns whether p is in the enemy defense area
| bool pointInEnemyHalf | ( | const Point & | p | ) | const |
Returns true if the point is in the enemy half of the field, and false otherwise
| point |
| bool pointInFriendlyCorner | ( | const Point & | p, |
| double | radius | ||
| ) | const |
Returns true if the point is in within the provided radius in one of the friendly corner.
| point | |
| the | radius from the corner, to decide whether or not the point is in the field. |
| bool pointInFriendlyDefenseArea | ( | const Point & | p | ) | const |
Returns whether p is in the friendly defense area
| bool pointInFriendlyHalf | ( | const Point & | p | ) | const |
Returns true if the point is in the friendly half of the field, and false otherwise
| point |
| double totalXLength | ( | ) | const |
Gets the x-axis length of the field including the boundary area in metres.
| double totalYLength | ( | ) | const |
Gets the y-axis length of the field including the boundary area in metres.
| double xLength | ( | ) | const |
Gets the x-axis length of the field from goal-line to goal-line in metres.
| double yLength | ( | ) | const |
Gets the y-axis length of the field from sideline to sideline in metres.