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

Classes

struct  ControlParams
 

Public Member Functions

DEFINE_PLAY_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS BallPlacementPlayFSM (TbotsProto::AiConfig ai_config)
 
void kickOffWall (const Update &event)
 
void alignPlacement (const Update &event)
 
void placeBall (const Update &event)
 
void startWait (const Update &event)
 
void retreat (const Update &event)
 
bool shouldKickOffWall (const Update &event)
 
bool alignDone (const Update &event)
 
bool kickDone (const Update &event)
 
bool ballPlaced (const Update &event)
 
bool waitDone (const Update &event)
 
bool retreatDone (const Update &event)
 
Angle calculateWallKickoffAngle (const Point &ball_pos, const Rectangle &field_lines)
 
void setupMoveTactics (const Update &event)
 
auto operator() ()
 

Constructor & Destructor Documentation

◆ BallPlacementPlayFSM()

BallPlacementPlayFSM ( TbotsProto::AiConfig  ai_config)
explicit

Creates a ball placement play FSM

Parameters
ai_configthe play config for this play FSM

Member Function Documentation

◆ alignDone()

bool alignDone ( const Update &  event)

Guard on whether the robot is aligned with the ball and placement point

Parameters
eventthe BallPlacementPlayFSM Update event
Returns
whether the robot is in position to begin placing the ball

◆ alignPlacement()

void alignPlacement ( const Update &  event)

Action that finds a point where the ball's current position aligns with the ball placement position, and moves the robot so that it is aligned to dribble straight directly to the placement point

Parameters
eventthe BallPlacementPlayFSM Update event

◆ ballPlaced()

bool ballPlaced ( const Update &  event)

Guard on whether the placing robot has finished placing the ball into the desired position

Parameters
eventthe BallPlacementPlayFSM Update event
Returns
whether the ball has been placed into the desired position

◆ calculateWallKickoffAngle()

Angle calculateWallKickoffAngle ( const Point ball_pos,
const Rectangle field_lines 
)

Helper function for calculating the angle to kick the ball off of a wall

Parameters
ball_posthe ball position to use when calculating the kick angle
field_linesthe field lines of the playing area
Returns
the kick angle

◆ kickDone()

bool kickDone ( const Update &  event)

Guard on whether the placing robot has finished moving the ball into a better position with a kick

Parameters
eventthe BallPlacementPlayFSM Update event
Returns
whether the kick has been performed

◆ kickOffWall()

void kickOffWall ( const Update &  event)

Action that has the placing robot kick the ball off the wall to give more space to dribble

Parameters
eventthe BallPlacementPlayFSM Update event

◆ placeBall()

void placeBall ( const Update &  event)

Action that has the placing robot dribble the ball to the destination, while other robots line up outside of the defense area

Parameters
eventthe BallPlacementPlayFSM Update event

◆ retreat()

void retreat ( const Update &  event)

Action that has the placing robot retreat after placing the ball

Parameters
eventthe BallPlacementPlayFSM Update event

◆ retreatDone()

bool retreatDone ( const Update &  event)

Guard on whether the robot has retreated outside of the required range

Parameters
eventthe BallPlacementPlayFSM Update event
Returns
whether the robot has retreated outside of the required range

◆ setupMoveTactics()

void setupMoveTactics ( const Update &  event)

Helper function that populates the move_tactics field with MoveTactics that organize the robots away from the ball placing robot

Parameters
eventthe BallPlacementPlayFSM Update event

◆ shouldKickOffWall()

bool shouldKickOffWall ( const Update &  event)

Guard on whether the ball is in a "dead zone"

Parameters
eventthe BallPlacementPlayFSM Update event
Returns
whether the ball is in a "dead zone"

◆ startWait()

void startWait ( const Update &  event)

Action that waits stationary 5 seconds for the dribbler to stop spinning

Parameters
eventthe BallPlacementPlayFSM Update event

◆ waitDone()

bool waitDone ( const Update &  event)

Guard on whether the robot has waited sufficiently

Parameters
eventthe BallPlacementPlayFSM Update event
Returns
whether the robot has waited for 5 seconds

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