|
Thunderbots Project
|
#include <enemy_ball_placement_play_fsm.h>
Classes | |
| struct | ControlParams |
Public Member Functions | |
| DEFINE_PLAY_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS | EnemyBallPlacementPlayFSM (TbotsProto::AiConfig ai_config) |
| bool | hasPlacementPoint (const Update &event) |
| void | setPlacementPoint (const Update &event) |
| bool | isNearlyPlaced (const Update &event) |
| void | avoid (const Update &event) |
| void | enterDefensiveFormation (const Update &event) |
| auto | operator() () |
This FSM implements the enemy ball placement play.
If the ball placement point exists, but the ball is far from the placement point, then we focus on avoiding ball placement interference. If our robot R is in the ball placement stadium, then it will move perpendicular to the segment connecting * and +, to either p1 or p2, whichever one is within the field boundaries and closest to R
/‾‾‾‾‾\ | + | placement point | | | | p1 | R | p2 | | | * | ball _____/
Once the ball is near the placement point, we set up 1 goalie, 2 crease defenders and 3 robots to stay near the ball without interfering
+
R x enemy robot with ball R R
D D
G +--—+
|
explicit |
Creates an enemy ball placement play FSM
| ai_config | the play config for this play FSM |
| void avoid | ( | const Update & | event | ) |
Action that positions robots to avoid ball placement interference
| event | the EnemyBallPlacementPlayFSM Update event |
| void enterDefensiveFormation | ( | const Update & | event | ) |
Action that positions robots in a defensive formation
| event | the EnemyBallPlacementPlayFSM Update event |
| bool hasPlacementPoint | ( | const Update & | event | ) |
Guard that checks if the ball placement point exists
| event | the EnemyBallPlacementPlayFSM Update event |
| bool isNearlyPlaced | ( | const Update & | event | ) |
Guard that checks if the ball is nearly placed
| event | the EnemyBallPlacementPlayFSM Update event |
| void setPlacementPoint | ( | const Update & | event | ) |
Action that initializes the enemy ball placement behaviour
| event | the EnemyBallPlacementPlayFSM Update event |