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

#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() ()
 

Detailed Description

This FSM implements the enemy ball placement play.

  • If the ball placement point does not exist yet, then we wait
  • 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 +--—+

Constructor & Destructor Documentation

◆ EnemyBallPlacementPlayFSM()

EnemyBallPlacementPlayFSM ( TbotsProto::AiConfig  ai_config)
explicit

Creates an enemy ball placement play FSM

Parameters
ai_configthe play config for this play FSM

Member Function Documentation

◆ avoid()

void avoid ( const Update &  event)

Action that positions robots to avoid ball placement interference

Parameters
eventthe EnemyBallPlacementPlayFSM Update event

◆ enterDefensiveFormation()

void enterDefensiveFormation ( const Update &  event)

Action that positions robots in a defensive formation

Parameters
eventthe EnemyBallPlacementPlayFSM Update event

◆ hasPlacementPoint()

bool hasPlacementPoint ( const Update &  event)

Guard that checks if the ball placement point exists

Parameters
eventthe EnemyBallPlacementPlayFSM Update event

◆ isNearlyPlaced()

bool isNearlyPlaced ( const Update &  event)

Guard that checks if the ball is nearly placed

Parameters
eventthe EnemyBallPlacementPlayFSM Update event

◆ setPlacementPoint()

void setPlacementPoint ( const Update &  event)

Action that initializes the enemy ball placement behaviour

Parameters
eventthe EnemyBallPlacementPlayFSM Update event

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