-
Notifications
You must be signed in to change notification settings - Fork 0
Bump Autoalign #37
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
base: main
Are you sure you want to change the base?
Bump Autoalign #37
Conversation
spellingcat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great overall. lmk when you're available to come to the field and you can test it pretty soon
| ((Math.abs(getPose().getX() - 4.62) < 2) || (Math.abs(getPose().getX() - 11.91) < 2)) | ||
| && | ||
| ((getPose().getY() > 5.04 && getPose().getY() < 6.07) || (getPose().getY() > 2 && getPose().getY() < 3.01))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd recommend throwing these numbers for the coordinates (4.62, 11.91 etc) into FieldUtils.java as constants (so similar to the BLUE_HUB_POS that's already there) and then referencing them by name here to minimize the amount of "magic numbers" floating around in our code
| modifyJoystick(driver.getLeftX()) | ||
| * SwerveSubsystem.SWERVE_CONSTANTS.getMaxLinearSpeed())); | ||
|
|
||
| while(swerve.isCloseToBump()){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the right logic, although the while loop doesn't explicitly create a trigger object around this boolean value
| while(swerve.isCloseToBump()){ | |
| new Trigger(swerve::isCloseToBump).whileTrue(swerve.bumpAlign etc...) |
No description provided.