#include <robot.h>
|
| | Robot (RobotId id, const Point &position, const Vector &velocity, const Angle &orientation, const AngularVelocity &angular_velocity, const Timestamp ×tamp, const std::set< RobotCapability > &unavailable_capabilities=std::set< RobotCapability >(), const RobotConstants_t &robot_constants=DEFAULT_ROBOT_CONSTANTS) |
| |
| | Robot (RobotId id, const RobotState &initial_state, const Timestamp ×tamp, const std::set< RobotCapability > &unavailable_capabilities=std::set< RobotCapability >(), const RobotConstants_t &robot_constants=DEFAULT_ROBOT_CONSTANTS) |
| |
| | Robot (const TbotsProto::Robot &robot_proto) |
| |
| void | updateState (const RobotState &state, const Timestamp ×tamp) |
| |
| RobotState | currentState () const |
| |
| Timestamp | timestamp () const |
| |
| RobotId | id () const |
| |
| Point | position () const |
| |
| Vector | velocity () const |
| |
| Angle | orientation () const |
| |
| AngularVelocity | angularVelocity () const |
| |
| const std::set< RobotCapability > & | getUnavailableCapabilities () const |
| |
| Polygon | dribblerArea () const |
| |
| std::set< RobotCapability > | getAvailableCapabilities () const |
| |
| std::set< RobotCapability > & | getMutableRobotCapabilities () |
| |
| const RobotConstants_t & | robotConstants () const |
| |
| bool | isNearDribbler (const Point &test_point, double TOLERANCE=BALL_TO_FRONT_OF_ROBOT_DISTANCE_WHEN_DRIBBLING) const |
| |
| Duration | getTimeToOrientation (const Angle &desired_orientation, const AngularVelocity &final_angular_velocity=AngularVelocity::zero()) const |
| |
| Duration | getTimeToPosition (const Point &destination, const Vector &final_velocity=Vector()) const |
| |
| bool | operator== (const Robot &other) const |
| |
| bool | operator!= (const Robot &other) const |
| |
◆ Robot() [1/3]
| Robot |
( |
RobotId |
id, |
|
|
const Point & |
position, |
|
|
const Vector & |
velocity, |
|
|
const Angle & |
orientation, |
|
|
const AngularVelocity & |
angular_velocity, |
|
|
const Timestamp & |
timestamp, |
|
|
const std::set< RobotCapability > & |
unavailable_capabilities = std::set<RobotCapability>(), |
|
|
const RobotConstants_t & |
robot_constants = DEFAULT_ROBOT_CONSTANTS |
|
) |
| |
|
explicit |
Creates a new robot given robot data
- Parameters
-
| id | The id of the robot to create |
| position | the new position of the robot. Coordinates are in metres. |
| velocity | the new velocity of the robot, in metres / second. |
| orientation | the new orientation of the robot, in Radians. |
| angular_velocity | the new angular velocity of the robot, in Radians per second |
| timestamp | The timestamp at which the robot was observed to be in the given state |
| unavailable_capabilities | The set of unavailable capabilities for this robot |
| robot_constants | The robot constants for this robot |
◆ Robot() [2/3]
| Robot |
( |
RobotId |
id, |
|
|
const RobotState & |
initial_state, |
|
|
const Timestamp & |
timestamp, |
|
|
const std::set< RobotCapability > & |
unavailable_capabilities = std::set<RobotCapability>(), |
|
|
const RobotConstants_t & |
robot_constants = DEFAULT_ROBOT_CONSTANTS |
|
) |
| |
|
explicit |
Creates a new robot with the given initial state
- Parameters
-
| id | The id of the robot to create |
| initial_state | The initial state of the robot |
| timestamp | The timestamp at which the robot was observed to be in the given state |
| unavailable_capabilities | The set of unavailable capabilities for this robot |
| robot_constants | The robot constants for this robot |
◆ Robot() [3/3]
| Robot |
( |
const TbotsProto::Robot & |
robot_proto | ) |
|
|
explicit |
Creates a new robot based on the TbotsProto::Robot protobuf representation NOTE: TbotsProto::Robot does not store the robot constants and the original robot constants is lost in the conversion, as a result, the 2021 robot constants are used as default.
- Parameters
-
| robot_proto | The TbotsProto::Robot protobuf which this robot should be based on |
◆ angularVelocity()
Returns the current angular velocity of the robot
- Returns
- the current angular velocity of the robot
◆ currentState()
Gets the current state of the robot
- Returns
- current state of the robot
◆ dribblerArea()
Creates and returns a rectangle representing the dribbler area
- Returns
- the dribbler area rectangle
◆ getAvailableCapabilities()
| std::set< RobotCapability > getAvailableCapabilities |
( |
| ) |
const |
Returns all available capabilities this robot has
- Returns
- Returns all available capabilities this robot has
◆ getMutableRobotCapabilities()
| std::set< RobotCapability > & getMutableRobotCapabilities |
( |
| ) |
|
Returns the mutable hardware capabilities of the robot
- Returns
- the mutable hardware capabilities of the robot
◆ getTimeToOrientation()
Estimate the minimum time it would take to turn to the desired orientation
- Parameters
-
| desired_orientation | The orientation which we want the robot to be at |
| final_angular_velocity | The desired angular velocity which the robot will be moving at, once it reaches the desired orientation |
- Returns
- The time required for this robot to rotate to the given orientation
◆ getTimeToPosition()
Estimate the minimum time it would take to reach the desired point
- Parameters
-
| destination | The destination that the robot is going to |
| final_velocity | The desired final velocity which the robot should be moving at |
- Returns
- The minimum theoretical time it would take this robot to reach the destination
◆ getUnavailableCapabilities()
| const std::set< RobotCapability > & getUnavailableCapabilities |
( |
| ) |
const |
Returns the missing capabilities of the robot
- Returns
- the missing capabilities of the robot
◆ id()
Returns the id of the robot
- Returns
- the id of the robot
◆ isNearDribbler()
| bool isNearDribbler |
( |
const Point & |
test_point, |
|
|
double |
TOLERANCE = BALL_TO_FRONT_OF_ROBOT_DISTANCE_WHEN_DRIBBLING |
|
) |
| const |
Decides if a point is near the dribbler of the robot
- Parameters
-
| test_point | The point to check |
| TOLERANCE | The tolerance for the distance between the dribbler and the ball |
- Returns
- whether the test_point is near the dribbler of the robot
◆ operator!=()
| bool operator!= |
( |
const Robot & |
other | ) |
const |
Defines the inequality operator for a Robot.
- Parameters
-
| other | The robot to compare against for inequality |
- Returns
- True if the other robot is not equal to this robots, and false otherwise
◆ operator==()
| bool operator== |
( |
const Robot & |
other | ) |
const |
Defines the equality operator for a Robot. Robots are equal if their IDs and all other parameters (position, orientation, etc) are equal. The last update timestamp is not part of the equality.
- Parameters
-
| other | The robot to compare against for equality |
- Returns
- True if the other robot is equal to this robot, and false otherwise
◆ orientation()
| Angle orientation |
( |
| ) |
const |
Returns the current orientation of the robot
- Returns
- the current orientation of the robot
◆ position()
Returns the current position of the robot
- Returns
- the current position of the robot
◆ robotConstants()
Returns the robot constants for this robot
- Returns
- the robot constants for this robot
◆ timestamp()
Returns the current timestamp of this robot
- Returns
- the current timestamp
◆ updateState()
Updates the robot with new data
- Parameters
-
| robot_state | A robot state containing new robot data |
| timestamp | New timestamp |
◆ velocity()
Returns the current velocity of the robot
- Returns
- the current velocity of the robot
The documentation for this class was generated from the following files:
- src/software/world/robot.h
- src/software/world/robot.cpp