rj_gameplay.tactic.pass_tactic

Module Contents

Classes

State

Create a collection of name/value pairs.

PassTactic

High-level construct that coordinates one or more roles. Creates role requests to be handled by Plays.

class rj_gameplay.tactic.pass_tactic.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
ACTIVE
INIT_PASSER_CAPTURE
PASSER_CAPTURE
GET_RECEIVER
INIT_EXECUTE_PASS
EXECUTE_PASS
AWAIT_PASSER_KICK
PASS_IN_TRANSIT
INIT_AWAIT_RECEIVE
EXECUTE_RECEIVE
AWAIT_RECEIVE
DONE
class rj_gameplay.tactic.pass_tactic.PassTactic(world_state: stp.rc.WorldState, init_passer_cost: stp.role.CostFn, init_receiver_cost: stp.role.CostFn)

Bases: stp.tactic.Tactic

High-level construct that coordinates one or more roles. Creates role requests to be handled by Plays.

property needs_assign
init_roles(world_state: stp.rc.WorldState) None

Given assigned robots by the Play, initialize each role of role_requests with its assigned robot.

tick(world_state: stp.rc.WorldState) List[Tuple[int, rj_msgs.msg.RobotIntent]]
FSM
  • init: request passer

  • on filled req: init_roles > tick passer’s capture

  • when passer ready to pass: request receiver

  • on filled req: init_roles > tick passer pass

  • on ball passed: tick receiver, release passer role

  • when receiver done: done

is_done(world_state: stp.rc.WorldState) bool

True when Tactic is done; False otherwise.