Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1ce04f9
Improved logic past original state using FSMs
Muxite Nov 15, 2025
ce5d32e
Merge branch 'master' of github.com:Muxite/Thunderbots-Muk into kicko…
Muxite Nov 15, 2025
1be72c4
testing almost done except mystery halt issue
Muxite Nov 15, 2025
197d7ff
mystery halt issue persists, adjusted fsm
Muxite Nov 22, 2025
f200673
Merge remote-tracking branch 'upstream/master' into kickoff_fsm
Muxite Jan 24, 2026
28d107a
post merge checking
Muxite Jan 24, 2026
9a304b4
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jan 24, 2026
1be1c15
temporary
Muxite Feb 22, 2026
fcaaa97
Merge branch 'kickoff_fsm' of github.com:Muxite/Thunderbots-Muk into …
Muxite Feb 22, 2026
3734594
Merge branch 'master' into kickoff_fsm
Muxite Feb 22, 2026
637c516
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 22, 2026
01f1b49
removed merge conflicts
Muxite Feb 22, 2026
ca0d2d3
merging
Muxite Feb 22, 2026
46a7613
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 22, 2026
20571a5
it works, testing doesnt tho
Muxite Feb 22, 2026
9aced51
works
Muxite Feb 22, 2026
be6267c
Merge branch 'kickoff_fsm' of github.com:Muxite/Thunderbots-Muk into …
Muxite Feb 22, 2026
fd7d6b5
removed shooting
Muxite Mar 7, 2026
7786676
merged
Muxite Mar 7, 2026
b9805f5
updated docs
Muxite Mar 7, 2026
2bc6999
linted
Muxite Mar 7, 2026
059cff1
BUILD fix
Muxite Mar 7, 2026
e01a895
added javadoc
Muxite Mar 7, 2026
3fa2da8
remove cc test
Muxite Mar 8, 2026
213d1c6
Comment out cc test
Muxite Mar 8, 2026
aa30d73
mod const and style
Muxite Mar 14, 2026
75c72e8
merge attempted before crash
Muxite Mar 14, 2026
dfc831f
format
Muxite Mar 14, 2026
308d5ef
enemy play fix
Muxite Mar 14, 2026
91f7bba
enemy play fix
Muxite Mar 14, 2026
3993066
address nits
StarrryNight Mar 21, 2026
d109370
merge master
StarrryNight Mar 21, 2026
44045fe
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Mar 21, 2026
27392d4
Fix BUILD errors
StarrryNight Mar 21, 2026
20fc1a3
merge new master
StarrryNight Mar 21, 2026
a69a452
fix merge traces
StarrryNight Mar 22, 2026
ca64244
merge
StarrryNight Mar 22, 2026
7041c03
merge again
StarrryNight Mar 22, 2026
6bca8d3
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Mar 22, 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
28 changes: 28 additions & 0 deletions docs/fsm-diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,34 @@ Terminate:::terminate --> Terminate:::terminate : <i>updateStop</i>

```

## [KickoffEnemyPlayFSM](/src/software/ai/hl/stp/play/kickoff_enemy/kickoff_enemy_play_fsm.h)

```mermaid

stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> SetupState
SetupState --> SetupState : <i>kickoff</i>

```

## [KickoffFriendlyPlayFSM](/src/software/ai/hl/stp/play/kickoff_friendly/kickoff_friendly_play_fsm.h)

```mermaid

stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> SetupState
SetupState --> SetupState : [!isSetupDone]\n<i>setupKickoff</i>
SetupState --> ChipState : [isSetupDone]
ChipState --> ChipState : [!isPlaying]\n<i>chipBall</i>
ChipState --> Terminate:::terminate : [isPlaying]
Terminate:::terminate --> Terminate:::terminate

```

## [OffensePlayFSM](/src/software/ai/hl/stp/play/offense/offense_play_fsm.h)

```mermaid
Expand Down
24 changes: 0 additions & 24 deletions docs/useful-robot-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<!--TOC-->

- [Table of Contents](#table-of-contents)
- [Common Debugging Steps](#common-debugging-steps)
- [Off Robot Commands](#off-robot-commands)
- [Wifi Disclaimer](#wifi-disclaimer)
- [Miscellaneous Ansible Tasks & Options](#miscellaneous-ansible-tasks--options)
- [Flashing the robot's compute module](#flashing-the-robots-compute-module)
- [Flashing the powerboard](#flashing-the-powerboard)
- [Setting up the embedded host](#setting-up-the-embedded-host)
Expand All @@ -22,26 +18,6 @@
- [Debugging Uart](#debugging-uart)

<!--TOC-->

# Common Debugging Steps
```mermaid
---
title: Robot Debugging Steps
---
flowchart TD
ssh("Can you SSH into the robot?
`ssh robot@192.168.5.20RobotID` OR `ssh robot@robot_name.local`
e.g. `ssh robot@192.168.5.203` or `ssh robot@robert.local`
for a robot called robert with robot id 3")
ssh ---> |Yes| tloop_status
ssh --> |No - Second Try| monitor("Connect Pi to an external monitor and check wifi connection or SSH using an ethernet cable")
ssh --> |No - First Try| restart(Restart robot)
restart --> ssh

diagnostics("`Run Diagnostics while connected to '**tbots**' wifi`") --> robot_view
robot_view(Robot is shown as connected in 'Robot View' widget?) --> |Yes| check_motors(All motors move?)
style diagnostics stroke:#f66,stroke-width:2px,stroke-dasharray: 5 5

check_motors -->|Yes| field_test(Running AI?)
field_test -->|No| done(Done)
style done stroke:#30fa02,stroke-width:2px,stroke-dasharray: 5 5
Expand Down
71 changes: 2 additions & 69 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 = "stop_play",
srcs = ["stop_play.cpp"],
Expand Down Expand Up @@ -82,8 +48,6 @@ cc_library(
cc_library(
name = "all_plays",
deps = [
":kickoff_enemy_play",
":kickoff_friendly_play",
":stop_play",
"//software/ai/hl/stp/play/ball_placement:ball_placement_play",
"//software/ai/hl/stp/play/crease_defense:crease_defense_play",
Expand All @@ -93,6 +57,8 @@ cc_library(
"//software/ai/hl/stp/play/example:example_play",
"//software/ai/hl/stp/play/free_kick:free_kick_play",
"//software/ai/hl/stp/play/halt_play",
"//software/ai/hl/stp/play/kickoff_enemy:kickoff_enemy_play",
"//software/ai/hl/stp/play/kickoff_friendly:kickoff_friendly_play",
"//software/ai/hl/stp/play/offense:offense_play",
"//software/ai/hl/stp/play/penalty_kick:penalty_kick_play",
"//software/ai/hl/stp/play/penalty_kick_enemy:penalty_kick_enemy_play",
Expand All @@ -101,39 +67,6 @@ 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/cpp_validation:validation_function",
"//software/simulated_tests/non_terminating_validation_functions",
"//software/simulated_tests/terminating_validation_functions",
"//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/cpp_validation:validation_function",
"//software/simulated_tests/non_terminating_validation_functions",
"//software/simulated_tests/terminating_validation_functions",
"//software/test_util",
"//software/time:duration",
"//software/world",
],
)

py_test(
name = "kickoff_play_test",
srcs = [
Expand Down
44 changes: 44 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,44 @@
load("@simulated_tests_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//visibility:public"])

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 = [
"//shared:constants",
"//software/ai/evaluation:enemy_threat",
"//software/ai/evaluation:possession",
"//software/ai/hl/stp/play",
"//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_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:kickoff_enemy_play",
"//software/geom/algorithms",
"//software/simulated_tests:simulated_er_force_sim_play_test_fixture",
"//software/simulated_tests/cpp_validation:validation_function",
"//software/simulated_tests/non_terminating_validation_functions",
"//software/simulated_tests/terminating_validation_functions",
"//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 "proto/parameters.pb.h"
#include "shared/constants.h"
#include "software/util/generic_factory/generic_factory.h"

KickoffEnemyPlay::KickoffEnemyPlay(
std::shared_ptr<const TbotsProto::AiConfig> ai_config_ptr)
: PlayBase<KickoffEnemyPlayFSM>(ai_config_ptr, false)
{
}

void KickoffEnemyPlay::getNextTactics(TacticCoroutine::push_type &yield,
const WorldPtr &world_ptr)
{
// Does not get called.
}

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,
std::shared_ptr<const TbotsProto::AiConfig>>
factory;
27 changes: 27 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,27 @@
#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"
#include "software/ai/hl/stp/play/play_base.hpp"
#include "software/ai/hl/stp/play/play_fsm.hpp"

/**
* A play that runs when its currently the enemy kick off.
*/

class KickoffEnemyPlay : public PlayBase<KickoffEnemyPlayFSM>
{
public:
/**
* Creates an enemy kickoff play
*
* @param ai_config_ptr the play config for this play
*/
explicit KickoffEnemyPlay(std::shared_ptr<const TbotsProto::AiConfig> ai_config_ptr);

void getNextTactics(TacticCoroutine::push_type &yield,
const WorldPtr &world_ptr) override;
void updateTactics(const PlayUpdate &play_update) override;
std::vector<std::string> getState() override;
};
Loading
Loading