Added fix for wheels to prevent movement when absolute encoders are not configured.

This commit is contained in:
thenetworkgrinch
2024-01-23 08:26:01 -06:00
parent f57f693955
commit 464274918c

View File

@@ -208,7 +208,7 @@ public class SwerveModule
/* If the error is close to 0.25 rotations, then we're 90 degrees, so movement doesn't help us at all */
double cosineScalar = Math.cos(Units.degreesToRadians(steerMotorError));
/* Make sure we don't invert our drive, even though we shouldn't ever target over 90 degrees anyway */
if (cosineScalar < 0.0)
if (cosineScalar < 0.0 || desiredState.speedMetersPerSecond == 0)
{
cosineScalar = 0.0;
}