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

Classes

struct  ControlParams
 

Public Member Functions

 GoalieFSM (TbotsProto::GoalieTacticConfig goalie_tactic_config, TbotsProto::RobotNavigationObstacleConfig robot_navigation_obstacle_config, TbotsProto::MaxAllowedSpeedMode max_allowed_speed_mode)
 
bool shouldEvacuateCrease (const Update &event)
 
bool shouldPanic (const Update &event)
 
bool shouldMoveToGoalLine (const Update &event)
 
bool shouldPivotChip (const Update &event)
 
bool panicDone (const Update &event)
 
void panic (const Update &event)
 
bool retrieveDone (const Update &event)
 
void retrieveFromDeadZone (const Update &event, boost::sml::back::process< DribbleFSM::Update > processEvent)
 
void moveToGoalLine (const Update &event)
 
void updatePivotKick (const Update &event, boost::sml::back::process< PivotKickFSM::Update > processEvent)
 
void positionToBlock (const Update &event)
 
bool ballInInflatedDefenseArea (const Update &event)
 
auto operator() ()
 

Static Public Member Functions

static Point getGoaliePositionToBlock (const Ball &ball, const Field &field, TbotsProto::GoalieTacticConfig goalie_tactic_config)
 
static std::vector< PointgetIntersectionsBetweenBallVelocityAndFullGoalSegment (const Ball &ball, const Field &field)
 
static Rectangle getNoChipRectangle (const Field &field)
 
static Point findGoodChipTarget (const World &world, const TbotsProto::GoalieTacticConfig &goalie_tactic_config)
 

Static Public Attributes

static DEFINE_TACTIC_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS constexpr double YEET_CHIP_DISTANCE_METERS = 2.0
 

Constructor & Destructor Documentation

◆ GoalieFSM()

GoalieFSM ( TbotsProto::GoalieTacticConfig  goalie_tactic_config,
TbotsProto::RobotNavigationObstacleConfig  robot_navigation_obstacle_config,
TbotsProto::MaxAllowedSpeedMode  max_allowed_speed_mode 
)
inlineexplicit

Constructor for GoalieFSM struct

Parameters
goalie_tactic_configThe config to fetch parameters from
max_allowed_speed_modeThe maximum allowed speed mode

Member Function Documentation

◆ ballInInflatedDefenseArea()

bool ballInInflatedDefenseArea ( const Update &  event)

Checks if ball is in the friendly defense area

Parameters
eventGoalieFSM::Update event

◆ findGoodChipTarget()

Point findGoodChipTarget ( const World world,
const TbotsProto::GoalieTacticConfig &  goalie_tactic_config 
)
static

Finds a good point to chip the ball to from its current position

Parameters
worldthe world
goalie_tactic_configthe goalie tactic config
Returns
a point on the field that is a good place to chip to

◆ getGoaliePositionToBlock()

Point getGoaliePositionToBlock ( const Ball ball,
const Field field,
TbotsProto::GoalieTacticConfig  goalie_tactic_config 
)
static

Gets the position for the goalie to move to, to best position itself between the ball and the friendly goal

Parameters
ballthe ball to position the goalie relative to
fieldthe field to position the goalie on
goalie_tactic_configthe goalie tactic config
Returns
the position that the goalie should move to

◆ getIntersectionsBetweenBallVelocityAndFullGoalSegment()

std::vector< Point > getIntersectionsBetweenBallVelocityAndFullGoalSegment ( const Ball ball,
const Field field 
)
static

Gets intersections between the ball velocity ray and the full goal segment

Parameters
ballthe ball to find interceptions with the full goal segment
fieldthe field to find interceptions on
Returns
the intersections between the ball velocity ray and the full goal segment

◆ getNoChipRectangle()

Rectangle getNoChipRectangle ( const Field field)
static

Gets the area within the friendly goalie's no-chip rectangle

Returns
the area within the friendly goalie's no-chip rectangle

◆ moveToGoalLine()

void moveToGoalLine ( const Update &  event)

Move the robot to the goal line

Parameters
eventGoalieFSM::Update event

◆ panic()

void panic ( const Update &  event)

Action that updates the MovePrimitive to time_to_panic and stop the ball

Parameters
eventGoalieFSM::Update event

◆ panicDone()

bool panicDone ( const Update &  event)

Guard that checks if the ball is moving slower than the panic threshold or has no intersections with the friendly goal, if true then the goalie should stop panicking

Parameters
eventGoalieFSM::Update
Returns
if the goalie should stop panicking

◆ positionToBlock()

void positionToBlock ( const Update &  event)

Action that updates the MovePrimitive to position the goalie in the best spot to block shots.

Parameters
eventGoalieFSM::Update event

◆ retrieveDone()

bool retrieveDone ( const Update &  event)

Guard that checks whether the goalie has finished retrieving the ball from the dead zone

Parameters
event

◆ retrieveFromDeadZone()

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

Action that prompts the goalie to leave the crease momentarily to chip the ball away

Parameters
event

◆ shouldEvacuateCrease()

bool shouldEvacuateCrease ( const Update &  event)

Guard that checks if the goalie should leave the crease the intercept the ball when it is stuck in the dead zone right that exists right outside of the crease

Parameters
event
Returns
if the goalie should leave the crease

◆ shouldPanic()

bool shouldPanic ( const Update &  event)

Guard that checks if the ball is moving faster than the time_to_panic threshold and has a clear path to the goal, if both are true then the goalie should panic and move to block the ball

Parameters
eventGoalieFSM::Update
Returns
if the goalie should panic

◆ shouldPivotChip()

bool shouldPivotChip ( const Update &  event)

Guard that checks if the ball is moving slower than the panic threshold and is inside the defense area, if true then the goalie should dribble and chip the ball

Parameters
eventGoalieFSM::Update
Returns
if the goalie should pivot chip the ball

◆ updatePivotKick()

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

Action that updates the PivotKickFSM

Parameters
eventGoalieFSM::Update event
processEventprocesses the PivotKickFSM::Update

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