-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve FreeKickPlay behaviour and convert it to use FSMs #2953
base: master
Are you sure you want to change the base?
Improve FreeKickPlay behaviour and convert it to use FSMs #2953
Conversation
…rav_banna/pass_speed_cost � Conflicts: � src/software/thunderscope/thunderscope.py
…rav_banna/pass_speed_cost
…rav_banna/pass_speed_cost
…/new_free_kick # Conflicts: # src/software/ai/hl/stp/play/BUILD # src/software/ai/hl/stp/play/free_kick_play.cpp # src/software/ai/hl/stp/play/free_kick_play.h
|
||
void FreeKickPlay::updateTactics(const PlayUpdate &play_update) | ||
{ | ||
fsm.process_event(FreeKickPlayFSM::Update(control_params, play_update)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FreeKickPlayFSM shouldn't be in control of all the robots and do its own defense behavior. Delegate some of the robots to DefensePlay and remove defensive behaviors from FreeKickPlayFSM
Take a look at offense_play.cpp
for an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! I've updated it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some quick feedback right now. I'll take a closer look at thinderscope later.
I've made this PR a draft until #3200 is merged (more details in the PR description). However, the play/FSM have been updated and are good to be reviewed again. |
I've added some basic validations for the friendly freekick simulated tests. The tests show how the receivers position themselves and the best passes/shots which are selected. I'm not sure if I will have the time to add more complex validations. |
LOG(INFO) << "Pass Score: " << best_pass_and_score_so_far.rating | ||
<< " Score threshold: " << min_score; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember to remove this log, it's a bit spammy
LOG(INFO) << "Found pass with score: " << best_pass_and_score_so_far.rating | ||
<< ". Passing..."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bit spammy, remember to remove
if (shoot_tactic->done()) | ||
{ | ||
LOG(INFO) << "Finished shot."; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove when you're done
if (receiver_tactic->done()) | ||
{ | ||
LOG(INFO) << "Finished pass."; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove when you're done
if (chip_tactic->done()) | ||
{ | ||
LOG(INFO) << "Finished chip."; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove when you're done
Description
❗ This PR is dependent on the changes from #3200, as such, it's in a draft state until that is merged. Please comment any passing/receiving related suggestions in that PR and for the time being only focus on suggestions around the changes listed below in this PR.
Improved FreeKickPlay:
Reimplemented it using FSMs
Used KickTactic instead of AttackerTactic to ensure that we do not dribble
Deleted
CornerKickPlay
Update
KickFSM
andChipFSM
to make sure that the robot is aligned to the kick/chip direction of the latest control params. Also update how far we drive into the ball.Update
![image](https://private-user-images.githubusercontent.com/28585597/344288912-aacad008-fc29-4a9c-869c-9d417224456a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNTU3NjcsIm5iZiI6MTcyMDE1NTQ2NywicGF0aCI6Ii8yODU4NTU5Ny8zNDQyODg5MTItYWFjYWQwMDgtZmMyOS00YTljLTg2OWMtOWQ0MTcyMjQ0NTZhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3cz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BZzgc8e70vOg)
GetBehindBallFSM
's guard to be more strict on the robot's alignment with the ball. The width of the region has been updated to have the same tolerance that the ball has to be within for it to not hit the side of the dribbler.Old region that the robot had to be within to be counted as "behind ball":
Updated region:
Update some of the constants related to the robots based on the most up to date CAD.
Todo:
Testing Done
Tried free kicks in AI vs AI.
Resolved Issues
resolves #2950, resolves #3205
Length Justification and Key Files to Review
free_kick_play_fsm.h
andfree_kick_play_fsm.cpp
.Review Checklist
It is the reviewers responsibility to also make sure every item here has been covered
.h
file) should have a javadoc style comment at the start of them. For examples, see the functions defined inthunderbots/software/geom
. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.TODO
(or similar) statements should either be completed or associated with a github issue