|
| | Ball (const Point &position, const Vector &velocity, const Timestamp ×tamp, const Vector &acceleration=Vector(0, 0)) |
| |
| | Ball (const BallState &initial_state, const Timestamp ×tamp, const Vector &acceleration=Vector(0, 0)) |
| |
| | Ball (const TbotsProto::Ball &ball_proto) |
| |
| BallState | currentState () const |
| |
| void | updateState (const BallState &new_state, const Timestamp &new_timestamp, const Vector &new_acceleration=Vector(0, 0)) |
| |
| Timestamp | timestamp () const |
| |
| Point | position () const |
| |
| Vector | velocity () const |
| |
| Vector | acceleration () const |
| |
| BallState | estimateFutureState (const Duration &duration_in_future) const |
| |
| bool | hasBallBeenKicked (const Angle &expected_kick_direction, double min_kick_speed=0.5, const Angle &max_angle_difference=Angle::fromDegrees(20)) const |
| |
| bool | operator== (const Ball &other) const |
| |
| bool | operator!= (const Ball &other) const |
| |
◆ Ball() [1/3]
Creates a new ball with the given initial state
- Parameters
-
| position | The position of the ball, with coordinates in metres |
| velocity | The velocity of the ball, in metres per second |
| timestamp | The timestamp at which the ball was observed to be at the given position and velocity |
| acceleration | acceleration being applied to the ball |
◆ Ball() [2/3]
Creates a new ball with the given initial state
- Parameters
-
| initial_state | The initial state of the ball |
| timestamp | the initial timestamp |
| acceleration | acceleration being applied to the ball |
◆ Ball() [3/3]
| Ball |
( |
const TbotsProto::Ball & |
ball_proto | ) |
|
|
explicit |
Creates a new ball based on the TbotsProto::Ball protobuf representation
- Parameters
-
| ball_proto | The TbotsProto::Ball protobuf which this ball should be based on |
◆ acceleration()
Returns the current acceleration of the ball
- Returns
- the current acceleration of the ball
◆ currentState()
Returns the current state of the ball
- Returns
- BallState
◆ estimateFutureState()
Returns the estimated state of the ball at the specified amount of time in the future
- Parameters
-
| duration_in_future | The Duration into the future at which to predict the ball's position |
- Returns
- The future state of the ball
◆ hasBallBeenKicked()
| bool hasBallBeenKicked |
( |
const Angle & |
expected_kick_direction, |
|
|
double |
min_kick_speed = 0.5, |
|
|
const Angle & |
max_angle_difference = Angle::fromDegrees(20) |
|
) |
| const |
Software approximation that finds if a ball has been kicked, regardless of whether the kick was a pass, shot, or chip.
- Parameters
-
| expected_kick_direction | The direction that we expect the ball to be kicked towards |
| min_kick_speed | The minimum speed of the ball to be considered a kick, in metres per second |
| max_angle_difference | The maximum angle difference for determining if ball has been kicked in the approximate direction as expected |
- Returns
- True if ball was kicked in the approximate direction we expect, false otherwise
◆ operator!=()
| bool operator!= |
( |
const Ball & |
other | ) |
const |
Defines the inequality operator for a Ball.
- Parameters
-
| other | The ball to compare against for inequality |
- Returns
- True if the other ball is not equal to this ball, and false otherwise
◆ operator==()
| bool operator== |
( |
const Ball & |
other | ) |
const |
Defines the equality operator for a Ball. Balls are equal if their positions and velocities are the same
- Parameters
-
| other | The Ball to compare against for equality |
- Returns
- True if the other ball is equal to this ball, and false otherwise
◆ position()
Returns the current position of the ball
- Returns
- the current position of the ball
◆ timestamp()
Returns the current timestamp for this ball
- Returns
- the current timestamp
◆ updateState()
Updates the ball with new data
- Parameters
-
| new_state | the new state of the ball |
| new_timestamp | the new timestamp |
| new_acceleration | acceleration being applied to the ball |
◆ velocity()
Returns the current velocity of the ball
- Returns
- the current velocity of the ball
The documentation for this class was generated from the following files:
- src/software/world/ball.h
- src/software/world/ball.cpp