Move keep away logic into its own tactic
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
.hfile) should have a javadoc style comment at the start of them. For examples, see the functions defined inthunderbots/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 Is this PR ready for review?
@annieisawesome2 Is this PR ready for review?
Yep! However, I may need to figure out how to format my FSM still...
@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?
@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!
changes made! Thanks Andrew :)
Actually, this might be resolved by #3441 , so just william's comment and it's all good for me!
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.