Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
285 commits
Select commit Hold shift + click to select a range
298d16d
refactor chip
GrayHoang Jul 22, 2025
5136915
refactor crease defender tactic
GrayHoang Jul 22, 2025
a04258a
refactor dribble tactic
GrayHoang Jul 22, 2025
aa12a2b
refactor get_behind_ball tactic
GrayHoang Jul 22, 2025
ee78316
refactor goalie tactic
GrayHoang Jul 22, 2025
71b525b
refactor halt tactic
GrayHoang Jul 22, 2025
1ec9a70
refactor kick tactic
GrayHoang Jul 22, 2025
837eaec
refactor move tactic
GrayHoang Jul 22, 2025
64ed6fe
refactor pass_Defender tactic
GrayHoang Jul 22, 2025
7be6b3f
refacter penalty_kick tactic
GrayHoang Jul 22, 2025
491fed5
refactor pivot_kick tactic
GrayHoang Jul 22, 2025
7172689
refactor receiver tactic
GrayHoang Jul 22, 2025
d2729a7
refactor shadow_enemy tactic
GrayHoang Jul 22, 2025
cf5cf44
debug tactic.cpp
GrayHoang Jul 22, 2025
18472e7
move attacker control params
GrayHoang Jul 22, 2025
02bc609
move chip control params, use default updateprimitive
GrayHoang Jul 22, 2025
8530896
move crease defender control params and use default update primitive
GrayHoang Jul 22, 2025
b58919f
formatting in chip
GrayHoang Jul 22, 2025
53a0e0b
move dribble control params, use default updatePrimitive
GrayHoang Jul 22, 2025
d3e56eb
move get behind ball control params, use default updatePrimitive
GrayHoang Jul 22, 2025
bb77adf
move control_param constructor (I forgor)
GrayHoang Jul 22, 2025
eae0de4
goalie
GrayHoang Jul 22, 2025
c9c656f
halt
GrayHoang Jul 22, 2025
fa37b67
kick
GrayHoang Jul 22, 2025
358995a
move
GrayHoang Jul 22, 2025
1956131
pass_defender
GrayHoang Jul 22, 2025
98ed2cd
penalty_kick
GrayHoang Jul 22, 2025
c329476
pivot_kick
GrayHoang Jul 22, 2025
a12d5a0
receiver
GrayHoang Jul 22, 2025
387fcfc
I went too fast
GrayHoang Jul 22, 2025
9229ccd
shadow enemy
GrayHoang Jul 22, 2025
f117d8b
Comments, code style, default constructors for controlParam structs, …
GrayHoang Jul 23, 2025
968302a
Revert "shadow enemy"
GrayHoang Jul 23, 2025
5f335ba
Revert "I went too fast"
GrayHoang Jul 23, 2025
312fcbf
Revert "receiver"
GrayHoang Jul 23, 2025
57d67c5
Revert "pivot_kick"
GrayHoang Jul 23, 2025
849a8f6
Revert "penalty_kick"
GrayHoang Jul 23, 2025
681b336
Revert "pass_defender"
GrayHoang Jul 23, 2025
9e46d97
Revert "move"
GrayHoang Jul 23, 2025
74a1324
Revert "kick"
GrayHoang Jul 23, 2025
9a54929
Revert "halt"
GrayHoang Jul 23, 2025
66576e7
Revert "goalie"
GrayHoang Jul 23, 2025
e78f6ad
Revert "move control_param constructor (I forgor)"
GrayHoang Jul 23, 2025
b438b0a
Revert "move get behind ball control params, use default updatePrimit…
GrayHoang Jul 23, 2025
920508f
Revert "move dribble control params, use default updatePrimitive"
GrayHoang Jul 23, 2025
37d2fd6
Revert "move crease defender control params and use default update pr…
GrayHoang Jul 23, 2025
e1b4d0d
Revert "move chip control params, use default updateprimitive"
GrayHoang Jul 23, 2025
83cc9f4
Revert "move attacker control params"
GrayHoang Jul 23, 2025
1212a27
standardize updatePrimitive to definition in tactic.cpp and delete ta…
GrayHoang Jul 23, 2025
6d93909
debug
GrayHoang Jul 23, 2025
81fdbbe
revert of default constructors for control param structs
GrayHoang Jul 24, 2025
e100648
debug defenderbase
GrayHoang Jul 24, 2025
8dde60c
use template for subFsms and patch some bad issues with certain tactics
GrayHoang Jul 24, 2025
2f0ec62
Add a tactic interface class
GrayHoang Jul 29, 2025
fe5fea8
rework ai files to use shared pointer ai_config
GrayHoang Jul 29, 2025
ea56b17
type docs
GrayHoang Jul 29, 2025
8e57d49
comment
GrayHoang Jul 30, 2025
2423eed
debug
GrayHoang Jul 30, 2025
7447e9e
Add FSM base class for play, debug tactic
GrayHoang Jul 30, 2025
31c364f
refactor BallPlacementPlay
GrayHoang Jul 31, 2025
2586fa1
Crease Defense Play
GrayHoang Jul 31, 2025
4a154e9
defense Play
GrayHoang Jul 31, 2025
71ceca2
enemy ball palcement
GrayHoang Jul 31, 2025
8808929
enemy free kick
GrayHoang Jul 31, 2025
8681ede
example play
GrayHoang Jul 31, 2025
1a40da7
free kick
GrayHoang Jul 31, 2025
e53897e
halt play
GrayHoang Jul 31, 2025
71f32f1
hardware challenge plays
GrayHoang Jul 31, 2025
3cbf9ea
offense play
GrayHoang Jul 31, 2025
d9945e5
penalty kick play
GrayHoang Jul 31, 2025
c6b3b46
penalty kick enemy
GrayHoang Jul 31, 2025
39fe69b
shoot or pass play
GrayHoang Jul 31, 2025
fdc8a70
test plays
GrayHoang Jul 31, 2025
9d0266a
function comment
GrayHoang Jul 31, 2025
d9ce648
refactor the various coroutine plays
GrayHoang Jul 31, 2025
9197dad
final refactors and debugs
GrayHoang Jul 31, 2025
1dc5cf3
delete vestigial file
GrayHoang Aug 1, 2025
a0f1817
refactor tests
GrayHoang Aug 1, 2025
48e7996
move function definitions of template classes to header file
GrayHoang Aug 1, 2025
a5fff52
debug tactic
GrayHoang Aug 1, 2025
e6f1da3
debug some tactics
GrayHoang Aug 1, 2025
ed734ab
fix play tests
GrayHoang Aug 1, 2025
9b130b6
the base of logging feature
GrayHoang Aug 1, 2025
eb66b82
use logging base in all fsms
GrayHoang Aug 1, 2025
6622757
edit tests to use logger
GrayHoang Aug 2, 2025
0a1d293
resolve merge conflicts
GrayHoang Aug 2, 2025
b5586ee
resolve merge conflicts
GrayHoang Aug 2, 2025
90a4ee5
Merge branch 'master' into Tactic-and-Play-Refactor
GrayHoang Aug 2, 2025
5ddcded
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 2, 2025
80e7736
more merge conflicts??
GrayHoang Aug 2, 2025
eb6fc19
Add files via upload
GrayHoang Aug 2, 2025
30afdce
Update and rename Tactic-and-Play-Structure.md to tactic-and-play-str…
GrayHoang Aug 2, 2025
c2e14e9
Add files via upload
GrayHoang Aug 2, 2025
b780d0f
Update tactic-and-play-structure.md
GrayHoang Aug 2, 2025
1496896
Update tactic-and-play-structure.md
GrayHoang Aug 2, 2025
d275b36
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 2, 2025
f2bf8fc
fix remainder of tests
GrayHoang Aug 3, 2025
427b0b4
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 3, 2025
6efd315
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 3, 2025
a324171
fix more tests
GrayHoang Aug 3, 2025
1df6672
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 3, 2025
75313b1
resolve merge conflicts
GrayHoang Aug 3, 2025
f9e36ca
merge conflicts from cherry pick
GrayHoang Aug 2, 2025
462dadc
Add files via upload
GrayHoang Aug 2, 2025
86da5d0
Update and rename Tactic-and-Play-Structure.md to tactic-and-play-str…
GrayHoang Aug 2, 2025
c655913
Add files via upload
GrayHoang Aug 2, 2025
e3142da
Update tactic-and-play-structure.md
GrayHoang Aug 2, 2025
6265292
Update tactic-and-play-structure.md
GrayHoang Aug 2, 2025
bdb92cd
more cherry pick merge conflicts
GrayHoang Aug 3, 2025
2df9256
fix more tests
GrayHoang Aug 3, 2025
6e86eb0
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 3, 2025
d62f0a0
Merge branch 'master' of github.com:UBC-Thunderbots/Software into FSM…
GrayHoang Aug 3, 2025
2a2cf04
please be the last of the ubild errors
GrayHoang Aug 4, 2025
27826b6
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 4, 2025
da57963
docs
GrayHoang Aug 5, 2025
f1db64e
debug segfault in play factory test
GrayHoang Aug 5, 2025
cd18a7b
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 5, 2025
adbe1fd
debug penalty_kick_enemy_play_test
GrayHoang Aug 5, 2025
c3c331d
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 5, 2025
93d6b27
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 5, 2025
bee593a
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 5, 2025
7c429bb
made mistake in merge
GrayHoang Aug 5, 2025
24ed8d5
update docs
GrayHoang Aug 5, 2025
26229b1
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 5, 2025
dd821e0
more detailed logging message (really really slows down things)
GrayHoang Aug 5, 2025
66ca22d
debug
GrayHoang Aug 7, 2025
15addda
rename tactic and tactic interface
GrayHoang Aug 7, 2025
460e719
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 7, 2025
1a02f78
rename template files to .hpp
GrayHoang Aug 7, 2025
2de6c29
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 7, 2025
f5c6d53
idk why the references didn't get fixeed here
GrayHoang Aug 7, 2025
4bbe80a
move function defs
GrayHoang Aug 7, 2025
75aa809
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 7, 2025
428cc90
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 7, 2025
35201a0
debug another test that didn't get the name change
GrayHoang Aug 8, 2025
d6f5984
remove docs
GrayHoang Aug 8, 2025
9827da7
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 8, 2025
77e235c
readd logger
GrayHoang Aug 8, 2025
112a0da
Merge branch 'master' of github.com:UBC-Thunderbots/Software into FSM…
GrayHoang Aug 8, 2025
ce1a150
Merge branch 'master' of github.com:UBC-Thunderbots/Software into Tac…
GrayHoang Aug 8, 2025
f12386f
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 8, 2025
0525492
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 8, 2025
b0a00c1
early logging
GrayHoang Aug 10, 2025
6cd6fcc
singleton logger
GrayHoang Aug 12, 2025
d2f9f0a
update macro
GrayHoang Aug 19, 2025
e8c4516
update files to fit macro
GrayHoang Aug 19, 2025
9507fd3
way stronger filter
GrayHoang Aug 20, 2025
c737aed
delete comments
GrayHoang Aug 20, 2025
43ca1ca
modify some filters
GrayHoang Aug 20, 2025
314120f
Merge branch 'master' of github.com:UBC-Thunderbots/Software into FSM…
GrayHoang Aug 20, 2025
bd051ef
Merge branch 'master' of github.com:UBC-Thunderbots/Software into Tac…
GrayHoang Aug 20, 2025
7e92978
virtual fsm_init and inilne accept
GrayHoang Aug 20, 2025
51c3b23
code cleanliness
GrayHoang Aug 20, 2025
2511a40
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 20, 2025
bd4e963
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 20, 2025
e9c6292
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 20, 2025
9063b53
debug
GrayHoang Aug 20, 2025
c76f927
formatting
GrayHoang Aug 20, 2025
5260ae0
more commented code
GrayHoang Aug 21, 2025
a6404bf
disable default constructors
GrayHoang Aug 22, 2025
1e9a338
change scope of guard instantiation
GrayHoang Aug 22, 2025
096722c
change the logger class to no longer use singleton and instead contai…
GrayHoang Aug 29, 2025
f8633dc
changed ai to initialize with logger instance
GrayHoang Aug 29, 2025
400ea4f
use logger instance in play base
GrayHoang Aug 29, 2025
b372410
change tactic base to use logger instance with robot id
GrayHoang Aug 29, 2025
76c36d5
change tests
GrayHoang Aug 29, 2025
176ccaa
made a mistake on the tests
GrayHoang Aug 29, 2025
05303f0
add fields to protobuffer
GrayHoang Aug 29, 2025
093bc9a
mechanisms for protobuffer writing
GrayHoang Aug 29, 2025
34b96f9
update protobuffer
GrayHoang Aug 29, 2025
e3b9cfe
add fields to thunderscope (temp)
GrayHoang Aug 29, 2025
df1af51
add const to all ai_config_ptr
GrayHoang Aug 30, 2025
520e667
added const qualifier to ai_config_ptr
GrayHoang Aug 30, 2025
8a1bcf1
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Aug 30, 2025
ad9d505
merge conflict part 2
GrayHoang Aug 30, 2025
efc7fcc
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 30, 2025
526fd1e
bugfix test
GrayHoang Aug 31, 2025
c97d9b3
remove old singleton code
GrayHoang Aug 31, 2025
6ade3f7
remove commented code
GrayHoang Aug 31, 2025
704c5cf
use CRTP in fsm base classes
GrayHoang Sep 9, 2025
872caad
Revert "Refactor AttackerFSM"
GrayHoang Sep 9, 2025
cf91407
Revert "Refactor Dribble FSM and change references to dribble_tactic_…
GrayHoang Sep 9, 2025
a11ca47
Correct Mistakes
GrayHoang Sep 9, 2025
749d9e0
Revert "refactor crease defender"
GrayHoang Sep 9, 2025
9b86aaf
Revert "refactor goalie_fsm"
GrayHoang Sep 9, 2025
1829d66
Revert "refactor get_behind_ball"
GrayHoang Sep 9, 2025
257dba0
more mistakes
GrayHoang Sep 9, 2025
3044e65
Revert "chip fsm refactor"
GrayHoang Sep 9, 2025
66e5051
Revert "refactor haltFSM"
GrayHoang Sep 9, 2025
99412f6
Revert "refactor KeepAwayFSM"
GrayHoang Sep 9, 2025
b52702a
Revert "refactor kickFSM"
GrayHoang Sep 9, 2025
178f982
fixes
GrayHoang Sep 9, 2025
d282b91
more fixes
GrayHoang Sep 9, 2025
6792a47
Revert "refactor moveFSM"
GrayHoang Sep 9, 2025
29e9d48
Revert "refactor PassDefenderFSM"
GrayHoang Sep 9, 2025
5c97980
fixes
GrayHoang Sep 9, 2025
c792bee
Revert "refactor PenaltyKickFSM"
GrayHoang Sep 9, 2025
9b446ea
fix base class
GrayHoang Sep 9, 2025
b7776ec
Revert "refactor PivotKickFSM"
GrayHoang Sep 9, 2025
1d5560f
fixes
GrayHoang Sep 9, 2025
89b1f75
more fixes
GrayHoang Sep 9, 2025
44e708e
Revert "refactor ReceiverFSM"
GrayHoang Sep 9, 2025
ef87201
Revert "refactor ShadowEnemyFSM"
GrayHoang Sep 9, 2025
dc980c4
Revert "refactor reference to AttackerFSM::ControlParams"
GrayHoang Sep 9, 2025
b865ace
Revert "refactor references to ChipFSM::ControlParams"
GrayHoang Sep 9, 2025
7aeaae5
fix goalie
GrayHoang Sep 9, 2025
732146c
fixes
GrayHoang Sep 9, 2025
b722f87
revert the plays
GrayHoang Sep 9, 2025
1fec581
Merge branch 'master' of github.com:UBC-Thunderbots/Software into FSM…
GrayHoang Sep 9, 2025
434f43c
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Sep 9, 2025
951a39a
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 9, 2025
e4d76f3
fix tests
GrayHoang Sep 10, 2025
9b1d21a
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Sep 10, 2025
dbc753b
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 10, 2025
86d8582
Merge branch 'master' of github.com:UBC-Thunderbots/Software into Tac…
GrayHoang Sep 28, 2025
22a8fca
move constructor definitions
GrayHoang Sep 28, 2025
58345c6
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Sep 28, 2025
eab19df
comments
GrayHoang Sep 28, 2025
255e03c
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 28, 2025
f5471a4
whitespace
GrayHoang Sep 28, 2025
6a5bf40
rename play_fsm and move implementations
GrayHoang Sep 28, 2025
3afcc9d
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Sep 28, 2025
a231a60
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 28, 2025
d2ba0d0
Merge branch 'master' of github.com:UBC-Thunderbots/Software into Tac…
GrayHoang Oct 11, 2025
f085dfc
many nits
GrayHoang Oct 11, 2025
021f3a1
fixes
GrayHoang Oct 11, 2025
2c63644
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Oct 11, 2025
23a7be9
Merge branch 'master' of github.com:UBC-Thunderbots/Software into Tac…
GrayHoang Nov 8, 2025
30fbc6d
class docs
GrayHoang Nov 8, 2025
4cdae62
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Nov 8, 2025
5613222
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Nov 8, 2025
8d5d15a
Remove disk cache GC settings from .bazelrc
GrayHoang Nov 11, 2025
7e10692
Update src/software/ai/hl/stp/tactic/goalie/goalie_fsm.h
GrayHoang Nov 17, 2025
e4007e3
Update src/software/ai/hl/stp/tactic/tactic_base.hpp
GrayHoang Nov 18, 2025
66f7250
Merge branch 'master' of github.com:UBC-Thunderbots/Software into Tac…
GrayHoang Nov 19, 2025
53b4145
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Nov 19, 2025
d917d82
Merge branch 'Tactic-and-Play-Refactor' of github.com:potatoisagender…
GrayHoang Nov 19, 2025
ad7b1f5
small fix
GrayHoang Nov 20, 2025
bbd68e5
log pyqt version number
GrayHoang Nov 20, 2025
53d154b
more debugging, local import to enable webengine
GrayHoang Dec 21, 2025
fc218bd
make all thunderscope dependencies hermetic, use rules_py
GrayHoang Dec 23, 2025
4761958
bugfix qwebengine
GrayHoang Dec 23, 2025
1bed136
add mermaid diagram
GrayHoang Jan 3, 2026
4ab9179
Merge branch 'master' of github.com:UBC-Thunderbots/Software into FSM…
GrayHoang Jan 3, 2026
20f06ca
remaining merge
GrayHoang Jan 5, 2026
dfe37c0
mistake in build file
GrayHoang Jan 5, 2026
fd80056
merge conflicts
GrayHoang Jan 31, 2026
b3da03d
change the ui
GrayHoang Feb 1, 2026
0ea6b7d
some minor changes
GrayHoang Feb 1, 2026
c95b78e
Merge branch 'master' into FSMDebugWindow
GrayHoang Feb 3, 2026
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
6 changes: 3 additions & 3 deletions environment_setup/setup_software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ fi

virtualenv_opt_args=""
if [[ $(lsb_release -rs) == "24.04" ]]; then
host_software_packages+=(python3-pyqt6)
host_software_packages+=(pyqt6-dev-tools)
host_software_packages+=(python3-pyqt6.qtsvg)
# host_software_packages+=(python3-pyqt6)
# host_software_packages+=(pyqt6-dev-tools)
# host_software_packages+=(python3-pyqt6.qtsvg)

virtualenv_opt_args="--system-site-packages"
fi
Expand Down
1 change: 0 additions & 1 deletion environment_setup/ubuntu24_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ansible-lint==25.8.1
pyqtgraph==0.13.7
thefuzz==0.19.0
iterfzf==0.5.0.20.0
python-Levenshtein==0.25.1
Expand Down
1 change: 1 addition & 0 deletions src/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "yaml-cpp", version = "0.8.0")
bazel_dep(name = "buildifier_prebuilt", version = "8.0.3")
bazel_dep(name = "pybind11_protobuf", version = "0.0.0-20250210-f02a2b7")
bazel_dep(name = "aspect_rules_py", version = "1.6.6")
bazel_dep(name = "bazel_lib", version = "3.1.0")

##############################################
Expand Down
163 changes: 163 additions & 0 deletions src/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/proto/play_info_msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ message PlayInfo
message Play
{
repeated string play_state = 1;
string last_transition = 2;
string last_guard = 3;
}

message Tactic
{
string tactic_name = 1;
string tactic_fsm_state = 2;
string last_transition = 3;
string last_guard = 4;
}

map<uint32, Tactic> robot_tactic_assignment = 1;
Expand Down
9 changes: 6 additions & 3 deletions src/software/ai/ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@


Ai::Ai(std::shared_ptr<const TbotsProto::AiConfig> ai_config_ptr)
: ai_config_ptr(ai_config_ptr),
fsm(std::make_unique<FSM<PlaySelectionFSM>>(PlaySelectionFSM{ai_config_ptr})),
: logger(),
ai_config_ptr(ai_config_ptr),
fsm(std::make_unique<FSM<PlaySelectionFSM>>(PlaySelectionFSM{ai_config_ptr}, logger)),
override_play(nullptr),
current_play(std::make_unique<HaltPlay>(ai_config_ptr)),
ai_config_changed(false)
Expand Down Expand Up @@ -46,7 +47,7 @@ void Ai::checkAiConfig()
{
ai_config_changed = false;

fsm = std::make_unique<FSM<PlaySelectionFSM>>(PlaySelectionFSM{ai_config_ptr});
fsm = std::make_unique<FSM<PlaySelectionFSM>>(PlaySelectionFSM{ai_config_ptr}, logger);

auto current_override = ai_config_ptr->ai_control_config().override_ai_play();
if (current_override != TbotsProto::PlayName::UseAiSelection)
Expand Down Expand Up @@ -121,5 +122,7 @@ TbotsProto::PlayInfo Ai::getPlayInfo() const
(*info.mutable_robot_tactic_assignment())[robot_id] = tactic_msg;
}

FSMLogger::getTransitionAndGuard(info);

return info;
}
3 changes: 2 additions & 1 deletion src/software/ai/ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ class Ai final
*/
void updateAiConfig();

private:
private:
void checkAiConfig();

FSMLogger logger;
std::shared_ptr<const TbotsProto::AiConfig> ai_config_ptr;
std::unique_ptr<FSM<PlaySelectionFSM>> fsm;
std::unique_ptr<Play> override_play;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ struct BallPlacementPlayFSM : public PlayFSM<BallPlacementPlayFSM>
*/
void setupMoveTactics(const Update& event);

DEFINE_SML_GUARD_CLASS(shouldKickOffWall, BallPlacementPlayFSM)
DEFINE_SML_GUARD_CLASS(alignDone, BallPlacementPlayFSM)
DEFINE_SML_GUARD_CLASS(kickDone, BallPlacementPlayFSM)
DEFINE_SML_GUARD_CLASS(ballPlaced, BallPlacementPlayFSM)
DEFINE_SML_GUARD_CLASS(waitDone, BallPlacementPlayFSM)
DEFINE_SML_GUARD_CLASS(retreatDone, BallPlacementPlayFSM)

auto operator()()
{
using namespace boost::sml;
Expand All @@ -155,19 +162,20 @@ struct BallPlacementPlayFSM : public PlayFSM<BallPlacementPlayFSM>
DEFINE_SML_STATE(RetreatState)
DEFINE_SML_EVENT(Update)

DEFINE_SML_ACTION(alignPlacement)
DEFINE_SML_ACTION(placeBall)
DEFINE_SML_ACTION(kickOffWall)
DEFINE_SML_ACTION(startWait)
DEFINE_SML_ACTION(retreat)

DEFINE_SML_GUARD(shouldKickOffWall)
DEFINE_SML_GUARD(alignDone)
DEFINE_SML_GUARD(kickDone)
DEFINE_SML_GUARD(ballPlaced)
DEFINE_SML_GUARD(waitDone)
DEFINE_SML_GUARD(retreatDone)

DEFINE_SML_ACTION(alignPlacement)
DEFINE_SML_ACTION(placeBall)
DEFINE_SML_ACTION(kickOffWall)
DEFINE_SML_ACTION(startWait)
DEFINE_SML_ACTION(retreat)


return make_transition_table(
// src_state + event [guard] / action = dest_state
*StartState_S + Update_E[!shouldKickOffWall_G] / alignPlacement_A =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ TEST(BallPlacementPlayFSMTest, test_transitions)
game_state.setBallPlacementPoint(ball_placement_point);
world_ptr->updateGameState(game_state);


FSMLogger logger{};
FSM<BallPlacementPlayFSM> fsm(
BallPlacementPlayFSM{std::make_shared<TbotsProto::AiConfig>()});
BallPlacementPlayFSM{std::make_shared<TbotsProto::AiConfig>()}, logger);

EXPECT_TRUE(fsm.is(boost::sml::state<BallPlacementPlayFSM::StartState>));

Expand Down Expand Up @@ -50,10 +50,11 @@ TEST(BallPlacementPlayFSMTest, test_kick_off_wall_transitions)
Point ball_placement_point(0, 0);
game_state.setBallPlacementPoint(ball_placement_point);
world_ptr->updateGameState(game_state);


FSMLogger logger{};
FSM<BallPlacementPlayFSM> fsm(
BallPlacementPlayFSM{std::make_shared<TbotsProto::AiConfig>()});
BallPlacementPlayFSM{std::make_shared<TbotsProto::AiConfig>()}, logger);


EXPECT_TRUE(fsm.is(boost::sml::state<BallPlacementPlayFSM::StartState>));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ TEST(CreaseDefensePlayFSMTest, test_transitions)
{
std::shared_ptr<World> world = ::TestUtil::createBlankTestingWorld();

FSM<CreaseDefensePlayFSM> fsm(
CreaseDefensePlayFSM{std::make_shared<TbotsProto::AiConfig>()});
FSMLogger logger{};
FSM<CreaseDefensePlayFSM> fsm(CreaseDefensePlayFSM{std::make_shared<TbotsProto::AiConfig>()}, logger);
EXPECT_TRUE(fsm.is(boost::sml::state<CreaseDefensePlayFSM::DefenseState>));

fsm.process_event(CreaseDefensePlayFSM::Update(
Expand Down
1 change: 1 addition & 0 deletions src/software/ai/hl/stp/play/defense/defense_play_fsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ struct DefensePlayFSM : public DefensePlayFSMBase
void setTactics(const Update& event);


DEFINE_SML_GUARD_CLASS(shouldDefendAggressively, DefensePlayFSM)

auto operator()()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ TEST(DefensePlayFSMTest, test_transitions)
{
std::shared_ptr<World> world = ::TestUtil::createBlankTestingWorld();

FSM<DefensePlayFSM> fsm(DefensePlayFSM{std::make_shared<TbotsProto::AiConfig>()});
FSMLogger logger{};
FSM<DefensePlayFSM> fsm(DefensePlayFSM{std::make_shared<TbotsProto::AiConfig>()}, logger);
EXPECT_TRUE(fsm.is(boost::sml::state<DefensePlayFSM::DefenseState>));

// Place enemy robots behind the ball implying there is a large attack
Expand Down
Loading
Loading