Thunderbots Project
Loading...
Searching...
No Matches
PenaltyKickFSM Struct Reference

Classes

struct  ControlParams
 

Public Member Functions

 PenaltyKickFSM ()
 
void shoot (const Update &event, boost::sml::back::process< KickFSM::Update > processEvent)
 
void updateApproachKeeper (const Update &event, boost::sml::back::process< DribbleFSM::Update > processEvent)
 
void adjustOrientationForShot (const Update &event, boost::sml::back::process< DribbleFSM::Update > processEvent)
 
bool takePenaltyShot (const Update &event)
 
bool timeOutApproach (const Update &event)
 
auto operator() ()
 

Static Public Member Functions

static DEFINE_TACTIC_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS bool evaluatePenaltyShot (std::optional< Robot > enemy_goalie, Field field, Point ball_position, Robot robot)
 
static const Point evaluateNextShotPosition (std::optional< Robot > enemy_goalie, Field field)
 

Constructor & Destructor Documentation

◆ PenaltyKickFSM()

Constructor for DribbleFSM

Member Function Documentation

◆ adjustOrientationForShot()

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

Action that orients the shooter to prepare for a shot.

Parameters
eventPenaltyKickFSM::Update
processEventprocesses the DribbleFSM::Update

◆ evaluateNextShotPosition()

const Point evaluateNextShotPosition ( std::optional< Robot enemy_goalie,
Field  field 
)
static

Helper function that returns the point on the enemy goal line where the shooter should aim at.

Parameters
enemy_goaliethe goalie that the shooter is scoring against
fieldthe field being played on
Returns
the Point on the enemy goal-line where the shooter robot should aim

◆ evaluatePenaltyShot()

bool evaluatePenaltyShot ( std::optional< Robot enemy_goalie,
Field  field,
Point  ball_position,
Robot  robot 
)
static

Helper function that determines whether the shooter robot has a viable shot on net.

Parameters
enemy_goaliethe enemy goalie that we are scoring against
fieldthe current field being played on
ball_positionthe coordinate location of the ball
robotthe shooter robot
Returns
true if the robot has a viable shot and false if the enemy goalkeeper will likely save the shot.
 B
+--\----------------------------------+ goal line
   \              +-------+
    \           C |       | enemy_goalie
     \         ---+-------+
      \        ---/
       \        ---/
        \   ---/
       A --/
          \
           \
            \
             \ D
         +-------+
         |       | bot
         +-------+

Segment BD represents the ball's path to the goal Segment AC is the smallest path required by the enemy to intercept BD

This function returns true when the enemy goalie doesn't have enough time to block the shot at A before the ball moves past that point.

◆ shoot()

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

Action that causes the shooter to shoot the ball.

Parameters
eventPenaltyKickFSM::Update event
processEventprocesses the KickFSM::Update

◆ takePenaltyShot()

bool takePenaltyShot ( const Update &  event)

Guard that returns true if the shooter has a good shot on goal or if it is forced to shoot due to the penalty timeout.

Requires complete approach to already be set.

Parameters
eventPenaltyKickFSM::Update

◆ timeOutApproach()

bool timeOutApproach ( const Update &  event)

Returns true if we pass the timeout for completing the approach play towards the keeper.

Requires complete approach to already be set.

Parameters
eventPenaltyKickFSM::Update

◆ updateApproachKeeper()

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

Action that updates the shooter's approach to the opposition net.

Parameters
eventPenaltyKickFSM::Update event
processEventprocesses the DribbleFSM::Update

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