Stopplay intelligent positioning fsm#3630
Stopplay intelligent positioning fsm#3630annieisawesome2 merged 34 commits intoUBC-Thunderbots:masterfrom
Conversation
StarrryNight
left a comment
There was a problem hiding this comment.
lgtm. left a nit and a comment on how you can improve stop play
nycrat
left a comment
There was a problem hiding this comment.
Looks good 👍, just added a small nit about the python test
| @@ -25,6 +25,18 @@ Terminate:::terminate --> Terminate:::terminate | |||
|
|
|||
| ``` | |||
|
|
|||
There was a problem hiding this comment.
not sure where this came from.. had a divergent branch and did a merge..
e25b3bf
StarrryNight
left a comment
There was a problem hiding this comment.
Look good! left a nit
| // goal-to-ball line at CENTRAL_SUPPORT_FRACTION, then mirror it across the | ||
| // field center so the support robot is on the opposite side of the field | ||
| // from the ball (stretching the field). | ||
| constexpr double CENTRAL_SUPPORT_FRACTION = 0.5; |
There was a problem hiding this comment.
Put this in header file
|
|
||
| # C++ test waits 8s before checking; use 15s timeout so robots have time to slow. | ||
| # Threshold 1.4 m/s: expect robots to eventually slow below the 1.5 m/s STOP limit. | ||
| # TODO: add an eventually-validation that friendly robots stay at least 0.5 m away |
2668689 to
4862bf9
Compare
9ef26be to
1793807
Compare
williamckha
left a comment
There was a problem hiding this comment.
Great work! I think the new positioning of the robots is definitely an improvement, though there's probably more we could do to make the play "intelligent" (e.g. different positioning based on which team will regain possession after the Stop, what the enemy team is doing, etc.). We can work on that later, the bulk of this PR (converting to FSM) looks good.
Description
This PR converts StopPlay into an FSM and improves robot positioning. The update enables robots to spread out more strategically across the field rather than clustering around the ball, while remaining prepared to receive or intercept a pass. All positioning logic continues to comply with the rules associated with the Stop referee command.
Optimization of robot positioning
We want to follow a similar pattern to OffensePlay where we use possesion and ball location to decide wither to defensively stop or offensively stop.
I ended up deciding on this formation:
Blue: OLD, Yellow: new stop play
New player assignments:
NOTE:
The C++ tests only check that the robots slow down below 1.5 m/s and avoids the ball by at least 0.5m which follows the rulebook guidelines for StopPlay.
Testing Done
After converting stop play into an fsm, I tested by running
bazel test //software/ai/hl/stp/play:stop_play_test --cache_test_results=noAdditional python test file was added so we can use the visualizer.
./tbots.py test stop_play_test -tfor visualizer./tbots.py test stop_play_testto test python file without visualizerResolved Issues
#3290
Review Checklist
It is the reviewers responsibility to also make sure every item here has been covered
.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.TODO(or similar) statements should either be completed or associated with a github issue