mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Added fix for wheels to prevent movement when absolute encoders are not configured.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user