Skip to content
Draft
Show file tree
Hide file tree
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 Jun 3, 2022
c101d0a
more test updates
PhilD71 Jun 3, 2022
1efe449
more stuff
PhilD71 Jun 3, 2022
679f5b5
more tests
PhilD71 Jun 3, 2022
bddfc6d
play updates
PhilD71 Jun 9, 2022
6cd7863
Merge branch 'master' of github.com:UBC-Thunderbots/Software into phi…
PhilD71 Jun 10, 2022
84ad9e4
test_updates
PhilD71 Jun 22, 2022
caf5522
Merge branch 'master' into phil/pytest_one
PhilD71 Jun 22, 2022
2aea34d
minor cleanup
PhilD71 Jun 22, 2022
3b3f270
kickoff_play test concept
PhilD71 Jun 23, 2022
e7f15c3
Merge branch 'master' into phil/pytest_one
PhilD71 Jun 24, 2022
6b2b5ad
updated free kick play test
PhilD71 Jun 30, 2022
4a6d5b8
even more free_kick_play updates
PhilD71 Jun 30, 2022
caf6175
added penalty_kick_play_test
PhilD71 Jul 7, 2022
0ee4e2f
validated penalty kick
PhilD71 Jul 7, 2022
0f2d160
Merged with master
PhilD71 Sep 7, 2022
9e0ecea
removed comment
PhilD71 Oct 8, 2022
bb41198
Merge branch 'phil/pytest_one' of github.com:PhilD71/Software into ph…
PhilD71 Oct 13, 2022
634f4ff
removed validation
PhilD71 Oct 13, 2022
da16d0e
formatting and small test exclusions
PhilD71 Oct 13, 2022
0f8fc26
disabled penalty kick play
PhilD71 Oct 13, 2022
b34dcf4
Updated GPIO to follow codebase naming guidelines. Ex: instances of "…
suchirss Oct 14, 2022
f4c09df
Merge branch 'master' into phil/pytest_one
PhilD71 Jan 19, 2023
7791e35
fixed up comments, still some to go
PhilD71 Jan 20, 2023
b3b813b
Just added a comment on line 79 that clarifies my task.
suchirss Jan 27, 2023
be83cd7
Added always-validation for 6 robots in friendly half.
suchirss Feb 19, 2023
0594740
Removed unnecessary comments.
suchirss Feb 19, 2023
24dfaf2
test commit
suchirss Jun 16, 2023
bffbe18
added eventually validation for ball exiting center circle
suchirss Jun 16, 2023
2526709
Decided on new validation strategy where a certain amount of robots d…
suchirss Jun 19, 2023
1eac5a6
changed centreCircle() to centerCircle() (spelling issue)
suchirss Jun 19, 2023
1ea49a6
Ran formatting script
suchirss Jun 20, 2023
b20c9e9
Implemented pytest parametrize feature in always validation set. Adde…
suchirss Jun 26, 2023
43b87b7
Added circular region of 0.05 radius with focus at (0,0) to BallEvent…
suchirss Jun 26, 2023
3758960
Revert "added eventually validation for ball exiting center circle"
suchirss Jun 26, 2023
2583f58
pulled from upstream
suchirss Jun 26, 2023
a7be834
Merge branch 'master' into pytest-validation
suchirss Jun 26, 2023
3927b21
Ran formatting script
suchirss Jun 26, 2023
aae3ba8
Changed attributes to have correct capitalization (i.e: tbots.Field i…
suchirss Jun 26, 2023
29b8ebc
Fixed some more capitalization
suchirss Jun 26, 2023
6b8c492
Started creating orValidation.py extension which allows multiple vali…
suchirss Oct 15, 2023
6c3ea41
Futher developed get_validation_status, get_validation_type, and get_…
suchirss Nov 11, 2023
b366b5c
Further developed implementation of or validation within kickoff vali…
suchirss Nov 11, 2023
4f5e18f
Added validation of 6 robots within friendlyHalf + centreCircle in ad…
suchirss Nov 18, 2023
2538d9b
Resolves some errors when running kickoff_play_test.py
suchirss Nov 19, 2023
eb67efa
Modified NumberOfRobotsEnterRegion() in robot_enters_region.py to acc…
suchirss Jan 20, 2024
6e4ab7d
Fixed geometry concatenation in get_validation_geometry in or_validat…
suchirss Jan 20, 2024
c7a7d2d
Changed order of gamecontroller commands so NORMAL_START happens afte…
suchirss Jan 21, 2024
6a149fe
Disabled case of kickoff_play_test.py where is_friendly_test is False…
suchirss Jan 21, 2024
22121c6
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss Jan 27, 2024
1de63b0
Typo: changed BLU to BLUE.
suchirss Jan 27, 2024
98687d6
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss Jan 27, 2024
43906bc
PR changes: fixed some naming, deleted duplicate file.
suchirss Mar 30, 2024
af77463
Fixed GPIO naming. Gpio -> GPIO in comments.
suchirss Mar 30, 2024
bc891f7
Deleted robot_halt.py and associated build string.
suchirss Mar 30, 2024
87d2827
Took code segment that checks all robots are in friendly half + cente…
suchirss Mar 30, 2024
deb4d21
More naming changes. Tbots -> tbots_cpp.
suchirss Mar 30, 2024
f3930bf
Made RobotEntersRegion a child class of NumberOfRobotEntersRegion
suchirss Mar 30, 2024
590719f
Renamed NumberOfRobotsEntersRegion to MinNumberOfRobotsEntersRegion. …
suchirss Mar 30, 2024
d405467
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss Mar 31, 2024
f7fa44a
Ran formatting script
suchirss Mar 31, 2024
91c000e
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Mar 31, 2024
0966c4d
Fixed GPIO casing issue.
suchirss May 8, 2024
1ff45af
Removed unused imports. Ran formatting script.
suchirss May 8, 2024
06080b3
Added back import in or_validation.py.
suchirss May 8, 2024
16c411e
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss May 8, 2024
da100d5
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss May 8, 2024
bfb8626
Moved TypeError check to initialization function in or_validation.py.…
suchirss May 12, 2024
ee7846c
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss May 12, 2024
a3a4344
Fixed or_validation.py such that kickoff_play_test.py passes when tes…
suchirss May 12, 2024
e38f098
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss Jan 11, 2025
1cb1eeb
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jan 11, 2025
12d5d0e
Removed check that all validation class inputs must be of the same ty…
suchirss Jan 11, 2025
0a18f61
Removed check that all validation class inputs must be of the same ty…
suchirss Jan 11, 2025
91564d1
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss Jan 11, 2025
c660224
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss Jan 20, 2025
f2d4024
Modified kickoff_play_test so the validation that checks that all rob…
suchirss Feb 17, 2025
8050615
Kickoff validation areas and friendly robot behaviour corrected.
suchirss Mar 1, 2025
82a89c1
Added back validation type consistency check to OrValidation class.
suchirss Mar 1, 2025
810d8f8
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss Mar 1, 2025
468fa4d
Ran formatting script
suchirss Mar 1, 2025
7bcb391
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss Aug 1, 2025
8ad6275
Changed distance threshold to 0.05m
suchirss Aug 1, 2025
cc8a985
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 1, 2025
038e0a4
working fsm
Muxite Aug 6, 2025
9059873
implemented new chip
Muxite Aug 8, 2025
ce99e2b
kick off friendly play fsm works.
Muxite Aug 23, 2025
1c656c2
clean up
Muxite Aug 23, 2025
66df429
commiting unfinished merge
suchirss Sep 1, 2025
6a31d6f
refactored kickoff_play_test to remove duplicate code instances
suchirss Sep 1, 2025
578e0f4
Merge branch 'pytest-validation' of github.com:suchirss/Software into…
suchirss Sep 1, 2025
7e9f371
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 2, 2025
d4efedc
Update src/software/simulated_tests/or_validation.py
suchirss Sep 2, 2025
c9c85f1
Changed test_example_play to use list input to regions parameter in N…
suchirss Sep 10, 2025
591aad3
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss Sep 10, 2025
310a09f
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 10, 2025
f151132
kickoff enemy play converted to fsm success
Muxite Sep 10, 2025
d1a4d2b
Merge branch 'UBC-Thunderbots:master' into kickoff_friendly_play_fsm_…
Muxite Sep 10, 2025
dfc5856
Merge branch 'kickoff_friendly_play_fsm_cleaned' of github.com:Muxite…
Muxite Sep 10, 2025
10c5c2c
disabled enemy_free_kick_play_test.py using pytest.skip() because OrV…
suchirss Sep 13, 2025
1c05933
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss Sep 13, 2025
234cfec
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 13, 2025
76e4886
Reverted pytest.skip() in enemy_free_kick_play_test.py since CI treat…
suchirss Sep 14, 2025
d3b0403
Using @pytest.mark.skip instead to disable enemy_free_kick_play_test …
suchirss Sep 14, 2025
fa2f21c
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss Sep 14, 2025
f9985a7
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 14, 2025
0069669
Merge branch 'master' of github.com:Muxite/Thunderbots-Muk into kicko…
Muxite Sep 27, 2025
d003d48
Merge branch 'UBC-Thunderbots:master' into kickoff_friendly_play_fsm_…
Muxite Sep 27, 2025
4b9a074
Merge branch 'kickoff_friendly_play_fsm_cleaned' of github.com:Muxite…
Muxite Sep 27, 2025
0d42b71
Merge branch 'master' of github.com:UBC-Thunderbots/Software into pyt…
suchirss Oct 4, 2025
f954f5e
Merge remote-tracking branch 'origin/pytest-validation' into pytest-v…
suchirss Oct 4, 2025
21f7fa0
Tagged TODO #3503 in enemy_free_kick_play_test.py
suchirss Oct 4, 2025
78a1820
Merge branch 'suchir-branch' into kickoff_friendly_play_fsm_cleaned t…
Muxite Oct 4, 2025
9a43c10
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Oct 7, 2025
3d40fd7
Merge remote-tracking branch 'suchir/pytest-validation' into kickoff_…
Muxite Oct 13, 2025
3368e68
patch to fix or_validation
Muxite Oct 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 19 additions & 82 deletions src/software/ai/hl/stp/play/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,6 @@ package(default_visibility = ["//visibility:public"])
# "factory" design pattern to work are linked in
# https://www.bfilipek.com/2018/02/static-vars-static-lib.html

cc_library(
name = "kickoff_enemy_play",
srcs = ["kickoff_enemy_play.cpp"],
hdrs = ["kickoff_enemy_play.h"],
deps = [
":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,
)

cc_library(
name = "kickoff_friendly_play",
srcs = ["kickoff_friendly_play.cpp"],
hdrs = ["kickoff_friendly_play.h"],
deps = [
":play",
"//shared:constants",
"//software/ai/evaluation:enemy_threat",
"//software/ai/hl/stp/tactic/chip:chip_tactic",
"//software/ai/hl/stp/tactic/move:move_tactic",
"//software/logger",
"//software/util/generic_factory",
],
alwayslink = True,
)

cc_library(
name = "shoot_or_chip_play",
srcs = ["shoot_or_chip_play.cpp"],
Expand Down Expand Up @@ -105,8 +71,6 @@ cc_library(
cc_library(
name = "all_plays",
deps = [
":kickoff_enemy_play",
":kickoff_friendly_play",
":shoot_or_chip_play",
":stop_play",
"//software/ai/hl/stp/play/ball_placement:ball_placement_play",
Expand All @@ -116,6 +80,8 @@ cc_library(
"//software/ai/hl/stp/play/enemy_free_kick:enemy_free_kick_play",
"//software/ai/hl/stp/play/example:example_play",
"//software/ai/hl/stp/play/free_kick:free_kick_play",
"//software/ai/hl/stp/play/kickoff_friendly:kickoff_friendly_play",
"//software/ai/hl/stp/play/kickoff_enemy:kickoff_enemy_play",
"//software/ai/hl/stp/play/halt_play",
"//software/ai/hl/stp/play/hardware_challenge_plays:dribbling_parcour_play",
"//software/ai/hl/stp/play/hardware_challenge_plays:pass_endurance_play",
Expand All @@ -128,54 +94,9 @@ cc_library(
],
)

cc_test(
name = "kickoff_friendly_play_cpp_test",
srcs = ["kickoff_friendly_play_test.cpp"],
deps = [
"//shared/test_util:tbots_gtest_main",
"//software/ai/hl/stp/play:kickoff_friendly_play",
"//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",
],
)

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",
],
)

py_test(
name = "kickoff_play_test",
srcs = [
"kickoff_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 = "stop_play_test",
Expand Down Expand Up @@ -277,3 +198,19 @@ py_test(
requirement("pytest"),
],
)

py_test(
name = "kickoff_play_test",
srcs = [
"kickoff_play_test.py",
],
# TODO (#2619) Remove tag to run in parallel
tags = [
"exclusive",
],
deps = [
"//software:conftest",
"//software/simulated_tests:validation",
requirement("pytest"),
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
),
],
)
# TODO: #3503
@pytest.mark.skip(
"Disabling this test because OrValidation is passed both an always validation and eventually validation"
)
def test_enemy_free_kick_play(
simulated_test_runner, blue_bots, yellow_bots, ball_initial_pos
):
Expand Down
4 changes: 2 additions & 2 deletions src/software/ai/hl/stp/play/example/example_play_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ def setup(*args):
inv_eventually_validation_sequence_set=[
[
NumberOfRobotsEventuallyEntersRegion(
region=tbots_cpp.Circle(ball_initial_pos, 1.1), req_robot_cnt=6
regions=[tbots_cpp.Circle(ball_initial_pos, 1.1)], req_robot_cnt=6
),
NumberOfRobotsEventuallyExitsRegion(
region=tbots_cpp.Circle(ball_initial_pos, 0.9), req_robot_cnt=6
regions=[tbots_cpp.Circle(ball_initial_pos, 0.9)], req_robot_cnt=6
),
]
],
Expand Down
60 changes: 60 additions & 0 deletions src/software/ai/hl/stp/play/kickoff_enemy/BUILD
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,
Copy link
Contributor

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?

)

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",
],
)
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 src/software/ai/hl/stp/play/kickoff_enemy/kickoff_enemy_play.h
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;
};
Loading