|
Thunderbots Project
|
#include <ball_state.h>
Public Member Functions | |
| BallState (const Point &position, const Vector &velocity, double distance_from_ground=0.0) | |
| BallState (const TbotsProto::BallState &ball_state_proto) | |
| Point | position () const |
| Vector | velocity () const |
| double | distanceFromGround () const |
| bool | operator== (const BallState &other) const |
| bool | operator!= (const BallState &other) const |
Represents the state of a ball
|
explicit |
Creates a new ball state with the given position and velocity
| position | The position of the ball, with coordinates in metres |
| velocity | The velocity of the ball, in metres per second |
| distance_from_ground | The distance of the bottom of the ball from the ground in metres. For example, a ball rolling along the ground has a distance from ground of 0 |
|
explicit |
Creates a new ball state based on the TbotsProto::BallState protobuf representation
| ball_state_proto | The TbotsProto::BallState protobuf which this ball state should be based on |
| double distanceFromGround | ( | ) | const |
Returns the distance of the bottom of the ball from the ground in metres
| bool operator!= | ( | const BallState & | other | ) | const |
Defines the inequality operator for a BallState.
| other | The ball state to compare against for inequality |
| bool operator== | ( | const BallState & | other | ) | const |
Defines the equality operator for a BallState. BallStates are equal if their positions and velocities are the same
| other | The ball state to compare against for equality |
| Point position | ( | ) | const |
Returns the position of the ball represented by this state
| Vector velocity | ( | ) | const |
Returns the velocity of the ball represented by this state