GT RoboCup SSL
Soccer software, robot firmware
gameplay.tactics.coordinated_pass.CoordinatedPass Class Reference

This handles passing from one bot to another Simply run it and set it's receive point, the rest is handled for you It starts out by assigning a kicker and a receiver and instructing them to lineup for the pass Once they're aligned, the kicker kicks and the receiver adjusts itself based on the ball's movement Note: due to mechanical limitations, a kicker often gets stuck trying to adjust its angle while it's just outside of it's aim error threshold. More...

Classes

class  State
 

Public Member Functions

def __init__ (self, receive_point=None, skillreceiver=None, skillkicker=None, prekick_timeout=None, receiver_required=True, kicker_required=True, use_chipper=False)
 Init method for CoordinatedPass. More...
 
def restart (self)
 Handles restarting this behaivor. More...
 
def receive_point (self)
 
def receive_point (self, value)
 
def on_enter_running (self)
 
def use_chipper (self)
 
def use_chipper (self, value)
 
def on_exit_running (self)
 
def on_enter_kicking (self)
 
def on_enter_preparing (self)
 
def execute_running (self)
 
def get_robots (self)
 
def execute_preparing (self)
 
def prekick_timeout_exceeded (self)
 
def time_remaining (self)
 
def on_enter_receiving (self)
 
def has_roles_assigned (self)
 
def __str__ (self)
 
- Public Member Functions inherited from gameplay.composite_behavior.CompositeBehavior
def __init__
 
def add_subbehavior
 
def remove_subbehavior
 
def has_subbehavior_with_name
 
def has_subbehaviors (self)
 
def subbehavior_with_name
 
def subbehaviors_by_name (self)
 
def remove_all_subbehaviors (self)
 
def all_subbehaviors (self)
 Returns a list of all subbehaviors.
 
def all_subbehaviors_completed (self)
 
def spin (self)
 Override StateMachine.spin() so we can call spin() on subbehaviors.
 
def handle_subbehavior_exception (self, name, exception)
 Override point for exception handling this is called whenever a subbehavior throws an exception during spin() subclasses of CompositeBehavior can override this to perform custom actions, such as removing the offending subbehavior the default implementation logs the exception and re-raises it.
 
def role_requirements (self)
 returns a tree of role_requirements
 
def assign_roles (self, assignments)
 
def __str__ (self)
 
- Public Member Functions inherited from gameplay.behavior.Behavior
def __init__
 
def add_state (self, state, parent_state=None)
 
def is_done_running (self)
 
def terminate (self)
 Transitions the Behavior into a terminal state (either completed or cancelled)
 
def behavior_state (self)
 returns a state in Behavior.State that represents what the behaviors is doing use this instead of the property if you want to avoid dealing with custom subclass substates
 
def is_continuous (self)
 The Behavior's termination behavior noncontinuous: a behavior that accomplishes a specific task, then completes (example: shooting at the goal) continuous: a behavior that continually runs until told to stop (example: zone defense)
 
def __str__ (self)
 
def role_requirements (self)
 Returns a tree of RoleRequirements keyed by subbehavior reference name This is used by the dynamic role assignment system to intelligently select which robot will run which behavior.
 
def assign_roles (self, assignments)
 assignments is a tree of (RoleRequirements, OurRobot) tuples Same tree structure as the role_requirements() return value, but tuples instead of RoleRequirements as leaf nodes
 
- Public Member Functions inherited from gameplay.fsm.StateMachine
def __init__ (self, start_state)
 
def start_state (self)
 
def restart (self)
 Resets the FSM back into the start state.
 
def add_state (self, state, parent_state=None)
 Registers a new state (which can optionally be a substate of an existing state)
 
def spin (self)
 Runs the FSM checks transition conditions for all edges leading away from the current state if one evaluates to true, we transition to it if more than one evaluates to true, we throw a RuntimeError.
 
def add_transition
 
def transition (self, new_state)
 
def is_in_state (self, state)
 
def state_is_substate (self, state, possible_parent)
 
def corresponding_ancestor_state (self, ancestors)
 
def ancestors_of_state (self, state)
 
def as_graphviz (self)
 
def write_diagram_png
 
def state (self)
 

Public Attributes

 receive_point
 
 skillreceiver
 
 skillkicker
 
 prekick_timeout
 
 receiver_required
 
 kicker_required
 
 state
 

Static Public Attributes

float KickPower = 0.6
 

Detailed Description

This handles passing from one bot to another Simply run it and set it's receive point, the rest is handled for you It starts out by assigning a kicker and a receiver and instructing them to lineup for the pass Once they're aligned, the kicker kicks and the receiver adjusts itself based on the ball's movement Note: due to mechanical limitations, a kicker often gets stuck trying to adjust its angle while it's just outside of it's aim error threshold.

If this happens, the CoordinatedPass will adjust the receive point slightly because it's easier to move the receiver over a bit than have the kicker adjust its angle. This solves the problem of having a pass get stuck indefinitely while the kicker sits there not moving. TODO: # If an opponent blocks the pass channel, it will wait until it moves - you can cancel it at this point if you wish As soon as the kicker kicks, it is no longer and is released by this behavior so other behaviors can be assigned to it If the receiver gets the ball, CoordinatedPass transitions to the completed state, otherwise it goes to the failed state

+ Inheritance diagram for gameplay.tactics.coordinated_pass.CoordinatedPass:
+ Collaboration diagram for gameplay.tactics.coordinated_pass.CoordinatedPass:

Constructor & Destructor Documentation

◆ __init__()

def gameplay.tactics.coordinated_pass.CoordinatedPass.__init__ (   self,
  receive_point = None,
  skillreceiver = None,
  skillkicker = None,
  prekick_timeout = None,
  receiver_required = True,
  kicker_required = True,
  use_chipper = False 
)

Init method for CoordinatedPass.

Parameters
skillreceiveran instance of a class that will handle the receiving robot. See pass_receive and angle_receive for examples. Using this, you can change what the receiving robot does (rather than just receiving the ball, it can pass or shoot it). Subclasses of pass_receive are preferred, but check the usage of this variable to be sure.
receive_pointThe point that will be kicked too. (Target point)
skillkickerA tuple of this form (kicking_class instance, ready_lambda). If none, it will use (pivot_kick lambda x: x == pivot_kick.State.aimed).
receiver_requiredWhether the receiver subbehavior should be required or not
kicker_requiredWhether the kicker subbehavior should be required or not The lambda equation is called (passed with the state of your class instance) to see if your class is ready. Simple implementations will just compare it to your ready state.

Member Function Documentation

◆ restart()

def gameplay.tactics.coordinated_pass.CoordinatedPass.restart (   self)

Handles restarting this behaivor.

Since we save a few sub-behaviors, we need to restart those when we restart.


The documentation for this class was generated from the following file: