-
Notifications
You must be signed in to change notification settings - Fork 111
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
EnemyFreeKickPlay FSM Conversion #3179
Conversation
…into Andrewyx/ThunderscopePaths
…ware into Andrewyx/ThunderscopePaths
…into Andrewyx/ThunderscopePaths
…into Andrewyx/ThunderscopePaths
…into Andrewyx/FreeKick
…into Andrewyx/FreeKick
…into Andrewyx/FreeKick
…into Andrewyx/FreeKick
…into Andrewyx/FreeKick
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.
Looks great! I just left a few minor comments about variable/constant names.
|
||
DEFINE_PLAY_UPDATE_STRUCT_WITH_CONTROL_AND_COMMON_PARAMS | ||
|
||
static constexpr double THRESHOLD_DISTANCE_METERS = 0.1; |
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.
Perhaps a name like TOO_CLOSE_THRESHOLD_METERS
would better?
DEFINE_SML_STATE(BlockFreeKicker) | ||
|
||
DEFINE_SML_EVENT(Update) | ||
|
||
DEFINE_SML_ACTION(setupEnemyKickerStrategy) |
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.
DEFINE_SML_STATE(BlockFreeKicker) | |
DEFINE_SML_EVENT(Update) | |
DEFINE_SML_ACTION(setupEnemyKickerStrategy) | |
DEFINE_SML_STATE(BlockEnemyKickerState) | |
DEFINE_SML_EVENT(Update) | |
DEFINE_SML_ACTION(blockEnemyKicker) |
An FSM state should usually include State
in the name, to distinguish it from an action.
The action setupEnemyKickerStrategy
is a bit confusing, something like blockEnemyKicker
could be more clear.
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.
👍
…into Andrewyx/FreeKick
… Andrewyx/FreeKick
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.
The changes look great in Thunderscope! Just had a small nit
src/software/logger/logger.h
Outdated
@@ -3,7 +3,7 @@ | |||
#include <g3sinks/LogRotate.h> | |||
#include <g3sinks/LogRotateWithFilter.h> | |||
|
|||
#include <experimental/filesystem> | |||
//#include <experimental/filesystem> |
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.
I think you forgot to uncomment the lines in this file
src/software/logger/logger.h
Outdated
if (!std::experimental::filesystem::exists(runtime_dir)) | ||
{ | ||
std::experimental::filesystem::create_directories(runtime_dir); | ||
} | ||
// if (!std::experimental::filesystem::exists(runtime_dir)) | ||
// { | ||
// std::experimental::filesystem::create_directories(runtime_dir); | ||
// } |
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.
same here
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.
nuts I forgot to recomment that when I went in to fix the bad merge. Should be fixed now thought
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.
LGTM ⚽
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.
LGTM!
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.
I merged EnemyBallPlacementPlay #3146 into master, and there seems to be some merge conflicts with this PR.
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.
Praying that CI passes 🙏
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.
Looks good!
Please fill out the following before requesting review on this PR
Description
This PR addresses the EnemyFreeKickPlay redesign in which we transform the existing design utilizing co-routines into the current FSM framework.
NOTE: This PR contains a stopgap redesign of DefensePlayFSM to suit the case of EnemyFreeKickPlayFSM. This PR shares significant similarities with DefensePlayFSM and is planned to be refactored along with DefensePlayFSM in a following PR.
Otherwise same behaviour as DefensePlayFSM, but:
this implementation uses 0.6m to better avoid violation area
Other Changes:
Testing Done
Pytests have been written to test behaviour. This can be run with
./tbots.py run enemy_free_kick_play_test.py -o -t
KNOWN BUGS:FIXED- If the Main Pass Defender switches roles, it may cut through the foul region,this will be most likely fixed in the new dynamic trajectory planner PR #3152
Resolved Issues
Resolves #3011, Re-implements #2970
Length Justification and Key Files to Review
This PR is broken up into two PRs, this one focuses on the implementation of the FSM. A future PR will be used to refactor EnemyFreeKickPlayFSM and DefensePlayFSM and abstract away shared functionality.
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