} else {
turret.setFieldRelativeTarget(Rotation2d.fromDegrees(turretSetpoint), turretVelocity - drivetrain.getAngularRate(2));
- boolean shuttling = target.getZ() != FieldConstants.getHubTranslation().getZ(); // if we're aiming upward we are aiming at hub, thus not shuttling
+ boolean shuttling = target != FieldConstants.getHubTranslation().toTranslation2d(); // if we're aiming at the hub, we're not shuttling
// shuttling will move the hood so its angles very close to max (less arch)
if (shuttling) {
public int ballCount = 0;
private boolean wasSpindexerSlow = false;
private SpindexerState state = SpindexerState.STOPPED;
+ private boolean reversing = false;
private SpindexerIOInputsAutoLogged inputs = new SpindexerIOInputsAutoLogged();
public Spindexer() {
updateInputs();
if (state == SpindexerState.MAX) {
motor.set(SpindexerConstants.spindexerMaxPower);
+ reversing = false;
} else if (state == SpindexerState.REVERSE) {
motor.set(SpindexerConstants.spindexerReversePower);
+ reversing = true;
} else if (state == SpindexerState.STOPPED) {
motor.set(0.0);
+ reversing = false;
} else {
motor.set(power);
+ reversing = false;
}
// scale threshold based on power