UBC-Thunderbots / Software

Robot Soccer Playing AI
http://www.ubcthunderbots.ca
GNU Lesser General Public License v3.0
53 stars 110 forks source link

Align with ball before attempting to dribble #3234

Closed nimazareian closed 2 months ago

nimazareian commented 3 months ago

Description

Currently, DribbleFSM attempts to drive into the ball to get possession, which sometimes results in the robot bumping the ball away if it's not fully aligned with it. For example:

https://github.com/UBC-Thunderbots/Software/assets/28585597/6ff94dd8-7057-416d-aa41-a0f5f8e979a2

This PR updates the logic by setting the destination slightly away from the ball so the robot does not bump into the ball, until the robot is aligned. Alignment is determined by drawing a long rectangle out of the robot in the direction it's facing, with the width of the dribbler (shown in purple). Here's the updated behaviour of the same scenario:

https://github.com/UBC-Thunderbots/Software/assets/28585597/5458dc6a-6dfe-41bf-8926-f4b06ae02146

Some of the robot constants were also updated to match Mech's latest CAD design.

Testing Done

Added a new simulated test (shown in the video above)

Resolved Issues

Resolves #3113

Length Justification and Key Files to Review

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

nimazareian commented 3 months ago

@itsarune Since we dont already have a pytest setup for dribble tactic, I was thinking that porting the tests would be more suited for a separate ticket/PR. And frankly, I'm not sure if I have the bandwidth for it right now either.