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

Remove SwerveController in favor of command in user side. #206

Open
thenetworkgrinch opened this issue May 3, 2024 · 1 comment
Open

Comments

@thenetworkgrinch
Copy link
Contributor

SwerveController adds unnecessary complexity to YAGSL and is no longer required. It should be replaced with a function which controls the robot heading via a ProfiledPIDController.

@thenetworkgrinch
Copy link
Contributor Author

thenetworkgrinch commented Nov 1, 2024

I have finally figured out how i want to do this!

I will remove SwerveController in favor of another utility SwerveControl which will be able to generate translatiom2d and angular velocity to be passed to SwerveDrive.

The ideal usecase would be as follows.

ControllerWrapper driver = new ControllerWrapper(xboxController);
SwerveControl ctr = new SwerveControl();

...
ctr
.withAngularVelocity(driver::getAngularVelocity) // For angular velocity control.
.withHeading(driver::getHeading) // For heading control
.withTranslation2d(driver::getTranslation2d)
.withHeadingPID(new ProfiledPIDController())
.withHeadingOverride(trigger, ()->{return angle;})

swerveDrive.drive(ctr::getTranslation2d, ctr::getAngularVelocity)

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

No branches or pull requests

1 participant