rj_gameplay.role.striker

Module Contents

Classes

State

Create a collection of name/value pairs.

StrikerRole

Grabs ball and shoots on goal. Should eventually be merged with some hybrid PassOrShoot role.

Attributes

OPPONENT_SPEED

KICK_SPEED

EFF_BLOCK_WIDTH

class rj_gameplay.role.striker.State(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

INIT
CAPTURING
INIT_SHOOT
SHOOTING
KICK_DONE
rj_gameplay.role.striker.OPPONENT_SPEED = 1.5
rj_gameplay.role.striker.KICK_SPEED = 4.5
rj_gameplay.role.striker.EFF_BLOCK_WIDTH = 0.7
class rj_gameplay.role.striker.StrikerRole(robot: stp.rc.Robot)

Bases: stp.role.Role

Grabs ball and shoots on goal. Should eventually be merged with some hybrid PassOrShoot role.

tick(world_state: stp.rc.WorldState) rj_msgs.msg.RobotIntent

Handle behavior of Role by handling which Skill is ticked, and with what params. Return the RobotIntent returned from ticking a Skill.

is_done(world_state: stp.rc.WorldState) bool

True if Role is done; False otherwise.

_blocker_margin(kick_origin: numpy.array, kick_target: numpy.array, kick_speed: float, blocker: stp.rc.Robot)
_kick_cost(point: numpy.array, kick_speed: float, kick_origin: numpy.array, world_state: stp.rc.WorldState)
_find_target_point(world_state: stp.rc.WorldState, kick_speed: float) numpy.ndarray