Skip to content

Free kick play tests and validation added#3666

Open
Muxite wants to merge 4 commits intoUBC-Thunderbots:masterfrom
Muxite:freekickplaytest
Open

Free kick play tests and validation added#3666
Muxite wants to merge 4 commits intoUBC-Thunderbots:masterfrom
Muxite:freekickplaytest

Conversation

@Muxite
Copy link
Copy Markdown
Contributor

@Muxite Muxite commented Mar 29, 2026

-->

Description

added validation to free kick play test, checks every branch of the fsm.

Testing Done

write tests for each branch, watched the test videos to confirm they are valid, all pass.

Resolved Issues

resolves #3636

Length Justification and Key Files to Review

free_kick_play_test.py

Review Checklist

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

  • [x ] 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.
  • [ x] Remove all commented out code
  • [ x] Remove extra print statements: for example, those just used for testing
  • [x ] Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

Copy link
Copy Markdown
Contributor

@Andrewyx Andrewyx 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 @nycrat may have already addressed this issue already in #3632. Maybe we should hold off on this PR if that is the case.

Comment on lines +141 to +144
# FSM path: SetupPositionState -> AttemptPassState -> PassState
# -> AttemptPassState -> ... -> X (chip or second pass)
# Triggers: passFound=True, shouldAbortPass=True
# shouldAbortPass fires when ratePass() drops below abs_min_pass_score (0.05)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What are these comments referring to? There are already doc strings included in the tests below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was trying to make it really clear what the test was for in relation to the fsms, I'll delete them and make the docstring a little more detailed

@Andrewyx
Copy link
Copy Markdown
Contributor

Andrewyx commented Apr 7, 2026

@nycrat Can you confirm that this PR is not containing any duplicate work?

@nycrat
Copy link
Copy Markdown
Member

nycrat commented Apr 7, 2026

I think this PR does add additional test cases which are useful. I think it would be good to merge this first and I could handle the conflicts in #3632

Copy link
Copy Markdown
Member

@nycrat nycrat left a comment

Choose a reason for hiding this comment

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

Tests look good 👍

Comment on lines +279 to +283
inv_eventually = [[FriendlyTeamEventuallyScored()]]
ag_eventually = [[FriendlyTeamEventuallyScored()]]
else:
inv_eventually = [[BallSpeedEventuallyAtOrAboveThreshold(0.05)]]
ag_eventually = [[BallSpeedEventuallyAtOrAboveThreshold(0.05)]]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: it is possible to just specify one eventually_validation_set variable instead since they are the same

"play_name": PlayName.FreeKickPlay,
}
setup=setup,
params=[0],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: params does not need to be specified, this applies to all the run_test() calls in the file

setup=setup,
params=[0],
inv_always_validation_sequence_set=[
[BallAlwaysStaysInRegion(regions=[field.fieldBoundary()])]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fieldBoundary() is actually the entire physical field so this validation technically could never fail. Perhaps this does not need to be validated? Or instead use the playing area

@nycrat nycrat self-requested a review April 11, 2026 20:46
inv_always_validation_sequence_set=[[]],
inv_eventually_validation_sequence_set=[[]],
inv_eventually_validation_sequence_set=[
[BallSpeedEventuallyAtOrAboveThreshold(0.05)]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could potentially use BallIsOffGround validation to check for chip

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.

Add validations for free kick play test

3 participants