private double power = 0.0;
public int ballCount = 0;
- private boolean wasSpindexerSlow = false;
private SpindexerState state = SpindexerState.STOPPED;
private SpindexerIOInputsAutoLogged inputs = new SpindexerIOInputsAutoLogged();
+ private double currentLimit = SpindexerConstants.currentLimit;
public boolean noIndexing = false;
limitConfig.StatorCurrentLimitEnable = true;
limitConfig.SupplyCurrentLowerLimit = newCurrentLimit;
limitConfig.SupplyCurrentLowerTime = 1.5;
- motor.getConfigurator().apply(limitConfig);
+ motorOne.getConfigurator().apply(limitConfig);
+ motorTwo.getConfigurator().apply(limitConfig);
}
+ public double getCurrentLimit() {
+ return currentLimit;
+ }
+
@Override
public void updateInputs() {
- inputs.spindexerVelocity = motor.getVelocity().getValueAsDouble(); //SpindexerConstants.gearRatio;
- inputs.spindexerCurrent = motor.getStatorCurrent().getValueAsDouble();
+ inputs.spindexerOneVelocity = motorOne.getVelocity().getValueAsDouble();
+ inputs.spindexerOneCurrent = motorOne.getStatorCurrent().getValueAsDouble();
+ inputs.spindexerTwoVelocity = motorTwo.getVelocity().getValueAsDouble();
+ inputs.spindexerTwoCurrent = motorTwo.getStatorCurrent().getValueAsDouble();
}
-
- private Double resetPos;
- private PIDController resetPID = new PIDController(4.0, 0.0, 0);
-
- private final double gearRatio = 27.0 / 1.0; //spindexer spins once for every 27 motor spins
-
-
-
}