rj_gameplay.role.receiver

Module Contents

Classes

State

Create a collection of name/value pairs.

ReceiverRole

Complex single-robot role, such as Goalie or Striker. Uses Skills to achieve behavior.

class rj_gameplay.role.receiver.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
PASS_READY
RECEIVE_PASS
DONE
class rj_gameplay.role.receiver.ReceiverRole(robot: stp.rc.Robot)

Bases: stp.role.Role

Complex single-robot role, such as Goalie or Striker. Uses Skills to achieve behavior.

property pass_ready
set_receive_pass()
tick(world_state: stp.rc.WorldState) rj_msgs.msg.RobotIntent
Assume passer already has ball on init. Then:
  • on init: continue seeking

  • interrupt signal from Tactic: go get ball

  • when got ball: done

is_done(world_state) bool

True if Role is done; False otherwise.