Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align with ball before attempting to dribble #3234

Merged

Conversation

nimazareian
Copy link
Contributor

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:

dribble_ball_behind_robot_before.mp4

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:

dribble_ball_behind_robot_after.mp4

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

  • 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

Copy link
Contributor

@williamckha williamckha left a comment

Choose a reason for hiding this comment

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

Nice, I've noticed this issue a lot so hopefully this helps

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

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

nice work! What do you think about writing a pytest instead of the simulated c++ test?

@nimazareian
Copy link
Contributor Author

@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.

@williamckha williamckha mentioned this pull request Jun 27, 2024
4 tasks
nimazareian added a commit to nimazareian/Software that referenced this pull request Jul 7, 2024
Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

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

LGTM! 🇳🇱

@nimazareian nimazareian merged commit c59694c into UBC-Thunderbots:master Jul 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Gameplay] Dribble FSM should align with ball before starting to dribble
3 participants