Thunderbots Project
Loading...
Searching...
No Matches
PassDefenderFSM Struct Reference
Inheritance diagram for PassDefenderFSM:
Collaboration diagram for PassDefenderFSM:

Classes

struct  ControlParams
 

Public Member Functions

 PassDefenderFSM (const TbotsProto::AiConfig &ai_config)
 
bool passStarted (const Update &event)
 
bool ballDeflected (const Update &event)
 
void blockPass (const Update &event)
 
void interceptBall (const Update &event)
 
bool ballNearbyWithoutThreat (const Update &event)
 
void prepareGetPossession (const Update &event, boost::sml::back::process< DribbleFSM::Update > processEvent)
 
auto operator() ()
 

Static Public Attributes

static DEFINE_TACTIC_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS constexpr double MIN_PASS_SPEED = 0.5
 
static constexpr Angle MAX_PASS_ANGLE_DIFFERENCE = Angle::fromDegrees(30)
 
static constexpr Angle MIN_DEFLECTION_ANGLE = Angle::fromDegrees(30)
 

Additional Inherited Members

- Static Public Member Functions inherited from DefenderFSMBase
static bool ballNearbyWithoutThreat (const WorldPtr &world_ptr, const Robot &robot, const TbotsProto::BallStealMode &ball_steal_mode, const TbotsProto::DefenderStealConfig &defender_steal_config)
 
static void prepareGetPossession (const TacticUpdate &tactic_update, boost::sml::back::process< DribbleFSM::Update > processEvent)
 

Constructor & Destructor Documentation

◆ PassDefenderFSM()

PassDefenderFSM ( const TbotsProto::AiConfig &  ai_config)
inlineexplicit

Constructor for PassDefenderFSM struct

Parameters
ai_configThe ai config required

Member Function Documentation

◆ ballDeflected()

bool ballDeflected ( const Update &  event)

Guard that checks if the ball is deviating more than MIN_DEFLECTION_ANGLE when the ball has been kicked and a pass is in progress. Ball could be deflected due to another robot intercepting the pass, or the pass defender could have chipped the ball away themselves.

Parameters
eventPassDefenderFSM::Update event
Returns
true if ball deflected

◆ ballNearbyWithoutThreat()

bool ballNearbyWithoutThreat ( const Update &  event)

Guard that determines whether it is appropriate to steal the ball

Parameters
eventPassDefenderFSM::Update event
Returns
true if stealing is enabled and the ball is nearby, unguarded by the enemy, and within a max get possession threshold

◆ blockPass()

void blockPass ( const Update &  event)

Action to move to the specified location to block a potential pass

Parameters
eventPassDefenderFSM::Update event

◆ interceptBall()

void interceptBall ( const Update &  event)

Action to intercept an active pass and chip the ball away, adjusting the defender's position to be directly in front of the ball's trajectory for better interception

Parameters
eventPassDefenderFSM::Update event

◆ passStarted()

bool passStarted ( const Update &  event)

Guard that checks if the ball has been kicked

Parameters
eventPassDefenderFSM::Update event
Returns
if the ball has been kicked

◆ prepareGetPossession()

void prepareGetPossession ( const Update &  event,
boost::sml::back::process< DribbleFSM::Update >  processEvent 
)

This is the Action that prepares for getting possession of the ball

Parameters
eventPassDefenderFSM::Update event
processEventprocesses the DribbleFSM::Update

The documentation for this struct was generated from the following files: