#include <free_kick_play_fsm.h>
This FSM implements the free kick play. The logic of this play is:
- One robot (the kicker) attempts to shoot first. If there is a good shot, then it will shoot the ball.
- If there is no good shot, the kicker will attempt to pass. Two robots try to get in good receiving positions to receive a pass.
- If we cannot find a pass in time, the kicker will chip the ball towards the friendly robot furthest up the field.
◆ FreeKickPlayFSM()
Creates a free kick play FSM
- Parameters
-
| ai_config | the play config for this play FSM |
◆ chipBall()
| void chipBall |
( |
const Update & |
event | ) |
|
Action to chip the ball towards the enemy net
- Parameters
-
◆ chipDone()
| bool chipDone |
( |
const Update & |
event | ) |
|
Guard that checks if the chip is completed
- Parameters
-
- Returns
- whether the chip is completed
◆ lookForPass()
| void lookForPass |
( |
const Update & |
event | ) |
|
Action that looks for a pass between the kicker and another robot
- Parameters
-
◆ passBall()
| void passBall |
( |
const Update & |
event | ) |
|
Action to pass the ball to a friendly robot
- Parameters
-
◆ passDone()
| bool passDone |
( |
const Update & |
event | ) |
|
Guard that checks if the pass is completed
- Parameters
-
- Returns
- whether the pass is completed
◆ passFound()
| bool passFound |
( |
const Update & |
event | ) |
|
Guard that checks if we should pass the ball to a friendly robot
- Parameters
-
- Returns
- whether we should pass the ball
◆ setReceiverAndDefenderTactics()
| void setReceiverAndDefenderTactics |
( |
PriorityTacticVector & |
tactics_to_run, |
|
|
const Update & |
event, |
|
|
int |
ideal_num_receivers, |
|
|
int |
num_tactics_already_assigned, |
|
|
const std::vector< Point > & |
existing_receiver_positions = {}, |
|
|
const std::optional< Point > & |
pass_origin_override = std::nullopt |
|
) |
| |
Sets the receiver and defender tactics for the free kick play
- Parameters
-
| tactics_to_run | The priority tactic vector to add the tactics to |
| event | The update event |
| ideal_num_receivers | The ideal number of receivers to assign. This value may be adjusted based on the number of available tactics. |
| num_tactics_already_assigned | The number of tactics already assigned from event.common.num_tactics |
| existing_receiver_positions | A set of positions of existing receiver positions that should be taken into account when assigning additional offensive tactics. |
| pass_origin_override | An optional point that the pass origin should be overridden to |
◆ setupDone()
| bool setupDone |
( |
const Update & |
event | ) |
|
Guard that checks if the robots are in position to start the free kick
- Parameters
-
- Returns
- whether the robots are in position to start the free kick
◆ setupPosition()
| void setupPosition |
( |
const Update & |
event | ) |
|
Action that sets up the robots in position to perform the free kick
- Parameters
-
◆ shootBall()
| void shootBall |
( |
const Update & |
event | ) |
|
Action to shoot the ball towards the enemy goal directly
- Parameters
-
◆ shotDone()
| bool shotDone |
( |
const Update & |
event | ) |
|
Guard that checks if the shot is completed
- Parameters
-
- Returns
- whether the shot is completed
◆ shotFound()
| bool shotFound |
( |
const Update & |
event | ) |
|
Guard that checks if we should shoot the ball towards the enemy goal
- Parameters
-
- Returns
- whether we should shoot the ball directly
◆ shouldAbortPass()
| bool shouldAbortPass |
( |
const Update & |
event | ) |
|
Guard on whether to abort the pass
- Parameters
-
- Returns
- whether the pass should be aborted
◆ startLookingForPass()
| void startLookingForPass |
( |
const Update & |
event | ) |
|
Action that starts the process of looking for a pass
- Parameters
-
◆ timeExpired()
| bool timeExpired |
( |
const Update & |
event | ) |
|
Guard that checks if the allotted time to search for a pass is over
- Parameters
-
- Returns
- whether the time to search for a pass is over
◆ updateAlignToBallTactic()
| void updateAlignToBallTactic |
( |
const WorldPtr & |
world_ptr | ) |
|
Updates the kicker to align to the ball
- Parameters
-
◆ updateReceiverPositioningTactics()
| void updateReceiverPositioningTactics |
( |
const WorldPtr |
world, |
|
|
unsigned int |
num_tactics, |
|
|
const std::vector< Point > & |
existing_receiver_positions = {}, |
|
|
const std::optional< Point > & |
pass_origin_override = std::nullopt |
|
) |
| |
Updates the offensive positioning tactics
- Parameters
-
| world | the world |
| num_tactics | the number of tactics to assign |
| existing_receiver_positions | A set of positions of existing receiver positions that should be taken into account when assigning additional offensive tactics. |
| pass_origin_override | An optional point that the pass origin should be overridden to |
The documentation for this struct was generated from the following files:
- src/software/ai/hl/stp/play/free_kick/free_kick_play_fsm.h
- src/software/ai/hl/stp/play/free_kick/free_kick_play_fsm.cpp