Skip to content
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

Example play to FSM #3402

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

someone2060
Copy link
Contributor

Please fill out the following before requesting review on this PR

Description

Converts the Example Play from a co-routine to an FSM.

The example play was moved to its own folder, with appropriate BUILD files modified. This was done to maintain consistency with other FSMs.

Testing Done

example_play_test.cpp successfully passed, and Example Play successfully ran on Thunderscope.

Resolved Issues

resolves #3298

Length Justification and Key Files to Review

  • example_play.cpp and corresponding .h file
  • example_play_fsm.cpp and corresponding .h file
  • example/BUILD

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

Sorry, something went wrong.

someone2060 and others added 20 commits September 28, 2024 11:58

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Remove Qt dependency from ER Force Simulator (UBC-Thunderbots#3311)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge main project to own branch
…cessary

Files still need to be refactored, which will be done in the next commit
… `halt_tactic.h`, renaming variables and strings where necessary

Variables and strings renamed for consistency and to allow tests to successfully run
…e necessary

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
`example_play_fsm.cpp` and associated files have not been implemented; planned to be implemented next commit
Still giving errors, as `example_play_fsm.cpp` has not been implemented
…play-to-fsm

# Conflicts:
#	src/software/ai/hl/stp/play/example/example_play_fsm.h
Debugging still necessary, as the `example_play_test.cpp` is not passing
test case works now yippee

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@someone2060 someone2060 requested review from a team, GrayHoang and axiev1 and removed request for a team October 28, 2024 21:05
Copy link
Contributor

@williamckha williamckha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! The FSM looks good to me, just two comments

Copy link

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should also write a FSM test and a pytest for your changes.

Take a look at Grayson's PR on how he does the FSM test: #3398

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good mostly. William had some good comments and I left some comments about adding more tests.

someone2060 and others added 4 commits November 11, 2024 12:41

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copied from UBC-Thunderbots#3398 by @potatoisagender

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@GrayHoang
Copy link
Contributor

One of your tests is failing (software/geom/algorithms:end_in_obstacle_sample_test).
Did you change this file? Try buildiing it in bazel and see what happens.

Copy link
Contributor

@GrayHoang GrayHoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, from what I can see.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that if you have implemented the example_play_fsm_test.cpp file you can remove this file, as it is now redundant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay some lore...

This is a simulated test. Simulated tests execute your AI changes against a simulator to simulate the world. We have two forms of these tests: a C++ test fixture and a newer Python test fixture. We are in the process of phasing the C++ tests out and replacing them with Python. Could you make a new example_play_test.py? Here's an example of what these look like: https://github.com/UBC-Thunderbots/Software/blob/master/src/software/ai/hl/stp/play/defense/defense_play_test.py

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comment

Copy link
Contributor

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale Inactive pull requests label Dec 22, 2024
@itsarune itsarune removed the Stale Inactive pull requests label Dec 24, 2024
Copy link
Contributor

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale Inactive pull requests label Jan 23, 2025
@williamckha williamckha removed the Stale Inactive pull requests label Jan 25, 2025
@@ -119,7 +105,11 @@ cc_library(
cc_library(
name = "all_plays",
deps = [
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you've got merge conflict markers in here. Needs merge conflict fixing

from proto.ssl_gc_common_pb2 import Team


# TODO issue #2599 - Remove Duration parameter from test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this issue does not seem to exist. we may not need it

Comment on lines +73 to +79
[RobotSpeedEventuallyBelowThreshold(1e-3)]
],
ag_always_validation_sequence_set=[[]],
ag_eventually_validation_sequence_set=[
[RobotSpeedEventuallyBelowThreshold(1e-3)]
],
test_timeout_s=10,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead, I think you should assert that the robots come within a 1 m radius of the ball

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you have a bad merge that you need to fix

Copy link
Contributor

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale Inactive pull requests label Mar 20, 2025
@GrayHoang GrayHoang removed the Stale Inactive pull requests label Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert ExamplePlay into an FSM play
4 participants