-
Notifications
You must be signed in to change notification settings - Fork 123
Kickoff friendly play fsm cleaned #3518
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
Draft
Muxite
wants to merge
116
commits into
UBC-Thunderbots:master
Choose a base branch
from
Muxite:kickoff_friendly_play_fsm_cleaned
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
116 commits
Select commit
Hold shift + click to select a range
d2140c1
crease defense and offense updates
PhilD71 c101d0a
more test updates
PhilD71 1efe449
more stuff
PhilD71 679f5b5
more tests
PhilD71 bddfc6d
play updates
PhilD71 6cd7863
Merge branch 'master' of github.com:UBC-Thunderbots/Software into phi…
PhilD71 84ad9e4
test_updates
PhilD71 caf5522
Merge branch 'master' into phil/pytest_one
PhilD71 2aea34d
minor cleanup
PhilD71 3b3f270
kickoff_play test concept
PhilD71 e7f15c3
Merge branch 'master' into phil/pytest_one
PhilD71 6b2b5ad
updated free kick play test
PhilD71 4a6d5b8
even more free_kick_play updates
PhilD71 caf6175
added penalty_kick_play_test
PhilD71 0ee4e2f
validated penalty kick
PhilD71 0f2d160
Merged with master
PhilD71 9e0ecea
removed comment
PhilD71 bb41198
Merge branch 'phil/pytest_one' of github.com:PhilD71/Software into ph…
PhilD71 634f4ff
removed validation
PhilD71 da16d0e
formatting and small test exclusions
PhilD71 0f8fc26
disabled penalty kick play
PhilD71 b34dcf4
Updated GPIO to follow codebase naming guidelines. Ex: instances of "…
suchirss f4c09df
Merge branch 'master' into phil/pytest_one
PhilD71 7791e35
fixed up comments, still some to go
PhilD71 b3b813b
Just added a comment on line 79 that clarifies my task.
suchirss be83cd7
Added always-validation for 6 robots in friendly half.
suchirss 0594740
Removed unnecessary comments.
suchirss 24dfaf2
test commit
suchirss bffbe18
added eventually validation for ball exiting center circle
suchirss 2526709
Decided on new validation strategy where a certain amount of robots d…
suchirss 1eac5a6
changed centreCircle() to centerCircle() (spelling issue)
suchirss 1ea49a6
Ran formatting script
suchirss b20c9e9
Implemented pytest parametrize feature in always validation set. Adde…
suchirss 43b87b7
Added circular region of 0.05 radius with focus at (0,0) to BallEvent…
suchirss 3758960
Revert "added eventually validation for ball exiting center circle"
suchirss 2583f58
pulled from upstream
suchirss a7be834
Merge branch 'master' into pytest-validation
suchirss 3927b21
Ran formatting script
suchirss aae3ba8
Changed attributes to have correct capitalization (i.e: tbots.Field i…
suchirss 29b8ebc
Fixed some more capitalization
suchirss 6b8c492
Started creating orValidation.py extension which allows multiple vali…
suchirss 6c3ea41
Futher developed get_validation_status, get_validation_type, and get_…
suchirss b366b5c
Further developed implementation of or validation within kickoff vali…
suchirss 4f5e18f
Added validation of 6 robots within friendlyHalf + centreCircle in ad…
suchirss 2538d9b
Resolves some errors when running kickoff_play_test.py
suchirss eb67efa
Modified NumberOfRobotsEnterRegion() in robot_enters_region.py to acc…
suchirss 6e4ab7d
Fixed geometry concatenation in get_validation_geometry in or_validat…
suchirss c7a7d2d
Changed order of gamecontroller commands so NORMAL_START happens afte…
suchirss 6a149fe
Disabled case of kickoff_play_test.py where is_friendly_test is False…
suchirss 22121c6
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss 1de63b0
Typo: changed BLU to BLUE.
suchirss 98687d6
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss 43906bc
PR changes: fixed some naming, deleted duplicate file.
suchirss af77463
Fixed GPIO naming. Gpio -> GPIO in comments.
suchirss bc891f7
Deleted robot_halt.py and associated build string.
suchirss 87d2827
Took code segment that checks all robots are in friendly half + cente…
suchirss deb4d21
More naming changes. Tbots -> tbots_cpp.
suchirss f3930bf
Made RobotEntersRegion a child class of NumberOfRobotEntersRegion
suchirss 590719f
Renamed NumberOfRobotsEntersRegion to MinNumberOfRobotsEntersRegion. …
suchirss d405467
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss f7fa44a
Ran formatting script
suchirss 91c000e
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 0966c4d
Fixed GPIO casing issue.
suchirss 1ff45af
Removed unused imports. Ran formatting script.
suchirss 06080b3
Added back import in or_validation.py.
suchirss 16c411e
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss da100d5
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss bfb8626
Moved TypeError check to initialization function in or_validation.py.…
suchirss ee7846c
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss a3a4344
Fixed or_validation.py such that kickoff_play_test.py passes when tes…
suchirss e38f098
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss 1cb1eeb
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 12d5d0e
Removed check that all validation class inputs must be of the same ty…
suchirss 0a18f61
Removed check that all validation class inputs must be of the same ty…
suchirss 91564d1
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss c660224
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss f2d4024
Modified kickoff_play_test so the validation that checks that all rob…
suchirss 8050615
Kickoff validation areas and friendly robot behaviour corrected.
suchirss 82a89c1
Added back validation type consistency check to OrValidation class.
suchirss 810d8f8
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss 468fa4d
Ran formatting script
suchirss 7bcb391
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss 8ad6275
Changed distance threshold to 0.05m
suchirss cc8a985
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 038e0a4
working fsm
Muxite 9059873
implemented new chip
Muxite ce99e2b
kick off friendly play fsm works.
Muxite 1c656c2
clean up
Muxite 66df429
commiting unfinished merge
suchirss 6a31d6f
refactored kickoff_play_test to remove duplicate code instances
suchirss 578e0f4
Merge branch 'pytest-validation' of github.com:suchirss/Software into…
suchirss 7e9f371
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] d4efedc
Update src/software/simulated_tests/or_validation.py
suchirss c9c85f1
Changed test_example_play to use list input to regions parameter in N…
suchirss 591aad3
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss 310a09f
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] f151132
kickoff enemy play converted to fsm success
Muxite d1a4d2b
Merge branch 'UBC-Thunderbots:master' into kickoff_friendly_play_fsm_…
Muxite dfc5856
Merge branch 'kickoff_friendly_play_fsm_cleaned' of github.com:Muxite…
Muxite 10c5c2c
disabled enemy_free_kick_play_test.py using pytest.skip() because OrV…
suchirss 1c05933
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss 234cfec
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 76e4886
Reverted pytest.skip() in enemy_free_kick_play_test.py since CI treat…
suchirss d3b0403
Using @pytest.mark.skip instead to disable enemy_free_kick_play_test …
suchirss fa2f21c
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss f9985a7
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 0069669
Merge branch 'master' of github.com:Muxite/Thunderbots-Muk into kicko…
Muxite d003d48
Merge branch 'UBC-Thunderbots:master' into kickoff_friendly_play_fsm_…
Muxite 4b9a074
Merge branch 'kickoff_friendly_play_fsm_cleaned' of github.com:Muxite…
Muxite 0d42b71
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss f954f5e
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss 21f7fa0
Tagged TODO #3503 in enemy_free_kick_play_test.py
suchirss 78a1820
Merge branch 'suchir-branch' into kickoff_friendly_play_fsm_cleaned t…
Muxite 9a43c10
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 3d40fd7
Merge remote-tracking branch 'suchir/pytest-validation' into kickoff_…
Muxite 3368e68
patch to fix or_validation
Muxite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| load("@simulated_tests_deps//:requirements.bzl", "requirement") | ||
|
|
||
| cc_library( | ||
| name = "kickoff_enemy_play", | ||
| srcs = [ | ||
| "kickoff_enemy_play.cpp", | ||
| "kickoff_enemy_play_fsm.cpp" | ||
| ], | ||
| hdrs = [ | ||
| "kickoff_enemy_play.h", | ||
| "kickoff_enemy_play_fsm.h", | ||
| ], | ||
| deps = [ | ||
| "//software/ai/hl/stp/play", | ||
| "//shared:constants", | ||
| "//software/ai/evaluation:enemy_threat", | ||
| "//software/ai/evaluation:possession", | ||
| "//software/ai/hl/stp/tactic/goalie:goalie_tactic", | ||
| "//software/ai/hl/stp/tactic/move:move_tactic", | ||
| "//software/ai/hl/stp/tactic/shadow_enemy:shadow_enemy_tactic", | ||
| "//software/logger", | ||
| "//software/util/generic_factory", | ||
| ], | ||
| alwayslink = True, | ||
| ) | ||
|
|
||
| py_test( | ||
| name = "kickoff_enemy_play_test", | ||
| srcs = [ | ||
| "kickoff_enemy_play_test.py", | ||
| ], | ||
| # TODO (#2619) Remove tag to run in parallel | ||
| tags = [ | ||
| "exclusive", | ||
| ], | ||
| deps = [ | ||
| "//software:conftest", | ||
| "//software/simulated_tests:validation", | ||
| requirement("pytest"), | ||
| ], | ||
| ) | ||
|
|
||
| cc_test( | ||
| name = "kickoff_enemy_play_cpp_test", | ||
| srcs = ["kickoff_enemy_play_test.cpp"], | ||
| deps = [ | ||
| "//shared/test_util:tbots_gtest_main", | ||
| "//software/ai/hl/stp/play:kickoff_enemy_play", | ||
| "//software/geom/algorithms", | ||
| "//software/simulated_tests:simulated_er_force_sim_play_test_fixture", | ||
| "//software/simulated_tests/non_terminating_validation_functions", | ||
| "//software/simulated_tests/terminating_validation_functions", | ||
| "//software/simulated_tests/validation:validation_function", | ||
| "//software/test_util", | ||
| "//software/time:duration", | ||
| "//software/world", | ||
| ], | ||
| ) | ||
35 changes: 35 additions & 0 deletions
35
src/software/ai/hl/stp/play/kickoff_enemy/kickoff_enemy_play.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #include "software/ai/hl/stp/play/kickoff_enemy/kickoff_enemy_play.h" | ||
|
|
||
| #include "shared/constants.h" | ||
| #include "software/util/generic_factory/generic_factory.h" | ||
|
|
||
| KickoffEnemyPlay::KickoffEnemyPlay(TbotsProto::AiConfig config) | ||
| : Play(config, true), fsm{KickoffEnemyPlayFSM{config}}, control_params{} | ||
| { | ||
| } | ||
|
|
||
| void KickoffEnemyPlay::getNextTactics(TacticCoroutine::push_type &yield, | ||
| const WorldPtr &world_ptr) | ||
| { | ||
| // Does not get called. | ||
| while (true) | ||
| { | ||
| yield({{}}); | ||
| } | ||
| } | ||
|
|
||
| void KickoffEnemyPlay::updateTactics(const PlayUpdate &play_update) | ||
| { | ||
| fsm.process_event(KickoffEnemyPlayFSM::Update(control_params, play_update)); | ||
| } | ||
|
|
||
| std::vector<std::string> KickoffEnemyPlay::getState() | ||
| { | ||
| std::vector<std::string> state; | ||
| state.emplace_back(objectTypeName(*this) + " - " + getCurrentFullStateName(fsm)); | ||
| return state; | ||
| } | ||
|
|
||
|
|
||
| // Register this play in the genericFactory | ||
| static TGenericFactory<std::string, Play, KickoffEnemyPlay, TbotsProto::AiConfig> factory; |
29 changes: 29 additions & 0 deletions
29
src/software/ai/hl/stp/play/kickoff_enemy/kickoff_enemy_play.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #pragma once | ||
|
|
||
| #include "proto/parameters.pb.h" | ||
| #include "software/ai/hl/stp/play/kickoff_enemy/kickoff_enemy_play_fsm.h" | ||
| #include "software/ai/hl/stp/play/play.h" | ||
|
|
||
| /** | ||
| * A play that runs when its currently the enemy kick off. | ||
| */ | ||
|
|
||
| class KickoffEnemyPlay : public Play | ||
| { | ||
| public: | ||
| /** | ||
| * Creates an enemy kickoff play | ||
| * | ||
| * @param ai_config the play config for this play | ||
| */ | ||
| KickoffEnemyPlay(TbotsProto::AiConfig config); | ||
|
|
||
| void getNextTactics(TacticCoroutine::push_type &yield, | ||
| const WorldPtr &world_ptr) override; | ||
| void updateTactics(const PlayUpdate &play_update) override; | ||
| std::vector<std::string> getState() override; | ||
|
|
||
| private: | ||
| FSM<KickoffEnemyPlayFSM> fsm; | ||
| KickoffEnemyPlayFSM::ControlParams control_params; | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why does this need to be statically linked?