rj_gameplay.play.offense

Module Contents

Classes

State

Create a collection of name/value pairs.

Offense

play to score goals. Set up two flank and one center handler. Pass ball as needed.

class rj_gameplay.play.offense.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
WAIT_TO_PASS
INIT_PASS
PASSING
PASSING_ASSIGN_ROLES
INIT_SHOOT
SHOOTING
DONE
class rj_gameplay.play.offense.Offense

Bases: stp.play.Play

play to score goals. Set up two flank and one center handler. Pass ball as needed. See tick() for more details.

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

INIT: assign goalie, 2 seekers WAIT_TO_PASS: loop until seekers reach pt INIT_PASS: assign goalie, pass tac PASSING: pass to one of two seekers, when pass done, shoot PASSING_ASSIGN_ROLES: when pass tactic needs role assignment while psasing, assign roles for it, then go back to PASSING INIT_SHOOT: assign goalie, striker, seeker SHOOTING: striker shoots DONE: shot taken