Skip to content

Stopplay intelligent positioning fsm#3630

Draft
annieisawesome2 wants to merge 14 commits intoUBC-Thunderbots:masterfrom
annieisawesome2:stopplay-intelligent-positioning-fsm
Draft

Stopplay intelligent positioning fsm#3630
annieisawesome2 wants to merge 14 commits intoUBC-Thunderbots:masterfrom
annieisawesome2:stopplay-intelligent-positioning-fsm

Conversation

@annieisawesome2
Copy link
Contributor

Description

** WORKING ON OPTIMIZATION STILL

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.

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=no

Resolved Issues

#3290

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

robot_positioning_unit_vector * 4 * ROBOT_MAX_RADIUS_METERS;
Point ball_defense_point_right =
ball_defense_point_center +
robot_positioning_unit_vector * 4 * ROBOT_MAX_RADIUS_METERS;
Copy link
Contributor

Choose a reason for hiding this comment

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

Some ideas on how to improve stop play:

  1. Only 2 robots near the ball. For example. keep defense point right and defense point center. Defense point left will be reflected off the center axis on the other side of field to receive the ball and 'stretch the field'

// +--------------------+--------------------+
// | | |
// | 4 x | |
// | 0 2 | |
// +--+ 1 | +--+
// | | | | |
// |G | +-+-+ | |
// | | | | | |
// | | +-+-+ | |
// | | | | |
// +--+ | +--+
// | | |
// | 3 | |
// | | |
// +----------- ---------+--------------------+

  1. Robots spread across the y axis. but the two robots closer (4,2) to the ball will move closer to the ball)

// +--------------------+--------------------+
// | | |
// | 4 x | |
// | 0 | |
// +--+ 2 | +--+
// | | | | |
// |G | +-+-+ | |
// | | | | | |
// | | +-+-+ | |
// | | 1 | | |
// +--+ | +--+
// | | |
// | 3 | |
// | | |
// +----------- ---------+--------------------+

Just some ideas that came up randomly. There could be better ways to do this.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok formatting is messed up but u can still see the relative robot positions by the numbers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

THANK YOU!!! I will give this a try

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New python test file added for visualizing. I will probably implement something similar to your first idea after I get the test working. Do you think we should have a different setup depending on how far the ball is from friendly net? If it is past the middle, we can spread out more to play offensively vs if it is near our net, we should cluster to play more defensively?

Copy link
Contributor

@StarrryNight StarrryNight left a comment

Choose a reason for hiding this comment

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

lgtm. left a nit and a comment on how you can improve stop play

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.

2 participants