i hate NaN

This commit is contained in:
aarav18
2022-03-06 15:20:20 -07:00
parent 6c5ee4b342
commit 2ab6e0a8db
2 changed files with 16 additions and 13 deletions
@@ -66,7 +66,10 @@ public class AimToCenter extends CommandBase {
* @return True if in deadzone.
*/
public static boolean isDeadzone(double angle) {
return !((ShooterConstants.TURRET_REVERSE_LIMIT < angle) && (angle < ShooterConstants.TURRET_FORWARD_LIMIT));
if (angle == Double.NaN) {
return false;
}
return !((ShooterConstants.TURRET_REVERSE_LIMIT <= angle) && (angle <= ShooterConstants.TURRET_FORWARD_LIMIT));
}
// Called once the command ends or is interrupted.