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

Prepare drive subsystem for "brownboxing" #101

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pordonj
Copy link
Contributor

@pordonj pordonj commented Dec 3, 2024

The goal is to get the drive subsystem to a state where in can be pulled out of the 2024 codebase and dropped into the 2025 codebase.

The main thing keeping the 2024 drive subsystem from being encapsulated was dependency on the static Constants. However the way to encapsulate it was to pass in 12+ values FROM the constants file. I don't know if I am a fan of either

@quangdaon
@CuratorAmber
@Bholoubek
@JasonE09

and any other students

I would like your thoughts on this.

NOTES:

  • All dashboard stuff will be deleted from the class
  • having a dependency on YAGSL is fine and expected.
  • Still need to document the rest of the methods.
  • We should probably be using YAGSL SwerveController class to turn joystick values into ChassisSpeeds but I don't want to "change" how this works until we can experiment with it.

* @param pointingTolerance Tolerance for automatic pointing, in degrees.
* @param maxVisionPoseOverrideDistance Maximum vision pose difference allowed, in meters. (If the vision pose is too far off, ignore it)
*/
public DriveSubsystem(

Choose a reason for hiding this comment

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

Thoughts on using a builder here? I think that makes creating the subsystem more manageable than having 12 positional args, especially since we can make some optional or group them (e.g. .withPid(p, i, d)). Downside would be that required args wouldn't be checked at compile time. Another thought would be to use an object or several objects that group some params together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the builder and I think what we can do is make the constructor private and force consumer to use the builder and have some sort of check after construction but before the robot runs that it was "fully built"

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