Thunderbots Project
Loading...
Searching...
No Matches
ReceiverFSM Struct Reference
Collaboration diagram for ReceiverFSM:

Classes

struct  ControlParams
 

Public Member Functions

 ReceiverFSM (TbotsProto::ReceiverTacticConfig receiver_tactic_config)
 
std::optional< ShotfindFeasibleShot (const World &world, const Robot &assigned_robot)
 
bool onetouchPossible (const Update &event)
 
void updateOnetouch (const Update &event)
 
void updateReceive (const Update &event)
 
void adjustReceive (const Update &event)
 
bool passStarted (const Update &event)
 
bool passFinished (const Update &event)
 
bool strayPass (const Update &event)
 
auto operator() ()
 

Static Public Member Functions

static Angle getOneTouchShotDirection (const Ray &shot, const Ball &ball)
 
static Shot getOneTouchShotPositionAndOrientation (const Robot &robot, const Ball &ball, const Point &best_shot_target)
 

Static Public Attributes

static DEFINE_TACTIC_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS constexpr double MIN_PASS_START_SPEED_M_PER_SEC = 0.02
 
static constexpr double BALL_MIN_MOVEMENT_SPEED_M_PER_SEC = 0.04
 
static constexpr Angle MIN_STRAY_PASS_ANGLE = Angle::fromDegrees(60)
 
static constexpr double MIN_STRAY_PASS_SPEED = 0.3
 

Constructor & Destructor Documentation

◆ ReceiverFSM()

ReceiverFSM ( TbotsProto::ReceiverTacticConfig  receiver_tactic_config)
inlineexplicit

Constructor for ReceiverFSM

Parameters
receiver_tactic_configThe config to fetch parameters from

Member Function Documentation

◆ adjustReceive()

void adjustReceive ( const Update &  event)

Constantly adjust the receives position to be directly infront of the ball for better reception. This is especially useful for long passes where the ball might not end up exactly at the pass.receiverPoint()

Parameters
eventReceiverFSM::Update event

◆ getOneTouchShotDirection()

Angle getOneTouchShotDirection ( const Ray shot,
const Ball ball 
)
static

Given a shot and the ball, figures out the angle the robot should be facing to perform a one-touch shot.

Parameters
shotThe shot to take
ballThe ball on the field

◆ getOneTouchShotPositionAndOrientation()

Shot getOneTouchShotPositionAndOrientation ( const Robot robot,
const Ball ball,
const Point best_shot_target 
)
static

Figures out the location of the one-touch shot and orientation the robot should face

Parameters
robotThe robot performing the one-touch
ballThe ball on the field
best_shot_targetThe point to shoot at

◆ onetouchPossible()

bool onetouchPossible ( const Update &  event)

Checks if a one touch shot is possible

Parameters
eventReceiverFSM::Update event
Returns
true if one-touch possible

◆ passFinished()

bool passFinished ( const Update &  event)

Check if the pass has finished by checking if we the robot has a ball near its dribbler.

Parameters
eventReceiverFSM::Update event
Returns
true if the ball is near a robots mouth

◆ passStarted()

bool passStarted ( const Update &  event)

Guard that checks if the ball has been kicked

Parameters
eventPivotKickFSM::Update event
Returns
if the ball has been kicked

◆ strayPass()

bool strayPass ( const Update &  event)

If the pass is in progress and is deviating more than MIN_STRAY_PASS_ANGLE, return true so that the receiver can react and intercept the ball.

Parameters
eventReceiverFSM::Update event
Returns
true if stray pass

◆ updateOnetouch()

void updateOnetouch ( const Update &  event)

If we have a shot on net, then update the receiver fsm to setup for a one-touch shot.

NOTE: This must be used with the onetouch_possible guard, which checks for one-touch feasibility.

Parameters
eventReceiverFSM::Update event

◆ updateReceive()

void updateReceive ( const Update &  event)

One-touch shot is not possible, just receive ball as cleanly as possible.

Parameters
eventReceiverFSM::Update event

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