Software icon indicating copy to clipboard operation
Software copied to clipboard

Move keep away logic into its own tactic

Open annieisawesome2 opened this issue 10 months ago • 6 comments

Please fill out the following before requesting review on this PR

Description

Created a new tactic, keep_away, taken out of attacker tactic. Created a new FSM for keep away which has a dribbleFSM sub state as well as keepAway action. Keep away tactic FSM runs the keepAway action in DribbleFSM until termination.

keepAway action is triggered within the AttackerFSM when the attacker doesn't have a good shot or pass option. If a valid kick is available, the attacker stays in the dribble state; otherwise, they transition into the KeepAwayFSM. Once the KeepAwayFSM terminates, the attacker returns to the dribble state in the AttackerFSM.

Testing Done

Tested through building new tactic 'keep_away_tactic'.

Resolved Issues

resolves #3419

Length Justification and Key Files to Review

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

annieisawesome2 avatar Feb 23 '25 23:02 annieisawesome2

@annieisawesome2 Is this PR ready for review?

Andrewyx avatar Feb 25 '25 04:02 Andrewyx

@annieisawesome2 Is this PR ready for review?

Yep! However, I may need to figure out how to format my FSM still...

annieisawesome2 avatar Feb 25 '25 04:02 annieisawesome2

@annieisawesome2 Is this PR ready for review?

Yep! However, I may need to figure out how to format my FSM still...

Did you want help with that? Or are you referring to the failing CI?

Andrewyx avatar Feb 26 '25 01:02 Andrewyx

@annieisawesome2 Is this PR ready for review?

Yep! However, I may need to figure out how to format my FSM still...

Did you want help with that? Or are you referring to the failing CI?

Just the cl check!

annieisawesome2 avatar Feb 26 '25 03:02 annieisawesome2

changes made! Thanks Andrew :)

annieisawesome2 avatar Mar 08 '25 04:03 annieisawesome2

Actually, this might be resolved by #3441 , so just william's comment and it's all good for me!

itsarune avatar Mar 27 '25 09:03 itsarune

Looks right to me, except I think Andrew wanted .hasValue(), not just best_pass_so_far. Unless it's implied in the if statement, but it looks a bit weird without the .hasValue() call

std::optional when converted to bool gives the same value as has_value(), so there's no difference between the two. Similar to how using the * operator on a std::optional (like you're dereferencing it) is the same as calling value() on it.

williamckha avatar May 13 '25 05:05 williamckha