Improved ball placement play from RoboCup 2024 - #3597
Apeiros-46B wants to merge 52 commits into
Conversation
… ball placement go back to aligning when ball is lost
…ld_testing_june_4
… field_testing_june_4
… a wall pickoff is no longer needed
…ld_testing_june_4
…_testing_june_4 # Conflicts: # src/software/ai/hl/stp/play/ball_placement/ball_placement_play_fsm.h
…into ball_placement
| // Subtract b from a, or return 0 if b is larger than a | ||
| static unsigned int subSat(unsigned int a, unsigned int b) |
There was a problem hiding this comment.
Should this be moved to another file?
* Exclude goalie from placing robot selection * Remember setup angle and check alignment in alignDone * Add ballLost check * Move friendly robots out of the way when setting up move tactics
* "fix" robot bumping ball when retreating * check velocity in align guards * remember placing robot ID to prevent oscillation * temporary friendly robot safe zone logic (need to fix later since rn it goes into goals)
* The fix is slightly suboptimal and relies on a hardcoded fix, will investigate better options soon
|
@Apeiros-46B What is the progress on this ticket? |
|
The test flakiness is fixed, there's just one last issue with the waiting line placement and robot reassignment. I have a fix but it's not perfect (but might be good enough I'm not sure), I will push the changes when I get home |
| # ball placement position. This prevents the issue where subsequent test | ||
| # runs don't properly get the ball placement point set properly and reuse | ||
| # the target point from the previous test case. | ||
| time.sleep(0.5) |
There was a problem hiding this comment.
If there's some a more reliable way to wait until the first command is acknowledged, that would be more ideal, but for now this does fix the test flakiness
| return {facing_angle, backoff_point}; | ||
| } | ||
|
|
||
| void BallPlacementPlayFSM::setupMoveTactics(const Update& event, unsigned int num_tactics) |
There was a problem hiding this comment.
I'm not sure if the current waiting line positioning is ideal
| * @param b the right-hand side | ||
| * @return a - b, or 0 if it would underflow | ||
| */ | ||
| static unsigned int subSat(unsigned int a, unsigned int b) |
There was a problem hiding this comment.
should this helper be moved somewhere else?
|
@Apeiros-46B could you resolve the merge conflicts for this PR whenever you have time? Sorry I couldn't get this PR reviewed earlier; hopefully this PR still works after the recent changes |
|
Yep, I'm very busy this weekend but I'll work on it next week. There are also some improvements that I can probably still make; specifically there was a change about where the non-placing robots should go during placement which fixed robots fighting over the ball, but I'm not entirely sure if the new behavior is still compliant with the SSL rules so I'll have to double check |
|
there's still some bugs with the current implementation and they're lowkey worse than I thought, I've started looking into how to fix them. Not ready for review yet, I'll request review again later after I push some fixes |
Description
Continuation of #3447
Fixes flaky ball placement tests; these were because there was some kind of race condition when the gamecontroller commands are sent from the test fixture to the C++ code where the
world_ptr.gameState()->.getBallPlacementPoint()sometimes was the expected placement point for the previous test case.Testing Done
Resolved Issues
Resolves #3561
Length Justification and Key Files to Review
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