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

Swerve actually works this time #2

Merged
merged 7 commits into from
Jan 16, 2024
Merged

Swerve actually works this time #2

merged 7 commits into from
Jan 16, 2024

Conversation

mimizh2418
Copy link
Member

(probably)

double rotPercent = rotLimiter.calculate(-controller.getRightX());

// Apply deadband
double linearMagnitude = MathUtil.applyDeadband(Math.hypot(xPercent, yPercent), 0.1);
Copy link
Member

Choose a reason for hiding this comment

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

might want to lower deadzone based on our controllers

Comment on lines +82 to 84
this.cancoder.getConfigurator().apply(canCoderConfig);

this.cancoderOffset = Rotation2d.fromDegrees(corner.offset);
Copy link
Member

Choose a reason for hiding this comment

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

We might also want to offset the offsets by the corner rotations in the cancoder config directly instead of handling it elsewhere in the drive code. Would make self-tests in Tuner X a little nicer, and consolidate the offset logic, but it's not problematic as it is.

@rutmanz rutmanz merged commit 7d29459 into main Jan 16, 2024
2 checks passed
@rutmanz
Copy link
Member

rutmanz commented Jan 16, 2024

Should close CLICKUP-86a1tc3y0

@mimizh2418 mimizh2418 deleted the zhangal/swerve branch January 16, 2024 23:17
@rutmanz rutmanz linked an issue Jan 18, 2024 that may be closed by this pull request
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.

Drivetrain
2 participants