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

[Drive] Add 254's Swerve Setpoint generator #4

Open
GreenTomato5 opened this issue Dec 12, 2024 · 2 comments
Open

[Drive] Add 254's Swerve Setpoint generator #4

GreenTomato5 opened this issue Dec 12, 2024 · 2 comments
Assignees
Labels
difficult enhancement New feature or request

Comments

@GreenTomato5
Copy link
Collaborator

Take PP implementation or just take it from 254's 2024 code & test in sim (the second is probably a better idea).

@GreenTomato5 GreenTomato5 added the enhancement New feature or request label Dec 12, 2024
@GreenTomato5
Copy link
Collaborator Author

Whoever does this should read the docs from path planner then read 254 code and add the 254 code. 254 Also uses ctre swerve with basically the same IO layer structure (outside of that its mad different tho) so it should be easy to take. Here's their code : https://github.com/Team254/FRC-2024-Public

@GreenTomato5
Copy link
Collaborator Author

Here's how you set the control request (I started on this earlier today 💀 ). U just have to find a way to cache past module state and delta t that's accurate. (254 knows how)
private final SwerveSetpointGenerator setpointGenerator = new SwerveSetpointGenerator(ROBOT_CONFIG, ANGULAR_VELOCITY_LIMIT);

public void driveFieldRelSetpointGen(ChassisSpeeds targetSpeeds, SwerveSetpoint moduleStates) {
    driveIO.getDrive().setControl(new SwerveRequest.ApplyRobotSpeeds().withSpeeds(setpointGenerator.generateSetpoint(moduleStates, targetSpeeds, 1).robotRelativeSpeeds()));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficult enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants