Skip to content

Commit

Permalink
Fixed inconsistency.
Browse files Browse the repository at this point in the history
Signed-off-by: thenetworkgrinch <[email protected]>
  • Loading branch information
thenetworkgrinch committed Apr 12, 2023
1 parent e5ac514 commit 7e647ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/swervelib/math/SwerveModuleState2.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public static SwerveModuleState2 optimize(SwerveModuleState2 desiredState, Rotat
{
optimized.omegaRadPerSecond = 0;
}
if (desiredState.angle.equals(optimized.angle.rotateBy(Rotation2d.fromDegrees(180))))
{
desiredState.omegaRadPerSecond = 0;
return desiredState;
}
return optimized;
/*
// NEVER optimize if it's the same angle, it just doesn't make sense...
Expand Down

0 comments on commit 7e647ad

Please sign in to comment.