added transfer movement to class

This commit is contained in:
2026-04-26 16:55:15 -05:00
parent 2a012ea3ae
commit fb0df810e8

View File

@@ -382,6 +382,7 @@ public class Spindexer {
commandedIntakePosition = 0; commandedIntakePosition = 0;
servos.setSpinPos(intakePositions[0]); servos.setSpinPos(intakePositions[0]);
currentIntakeState = Spindexer.IntakeState.UNKNOWN_MOVE; currentIntakeState = Spindexer.IntakeState.UNKNOWN_MOVE;
servos.setTransferPos(transferServo_out);
break; break;
case UNKNOWN_MOVE: case UNKNOWN_MOVE:
// Stopping when we get to the new position // Stopping when we get to the new position
@@ -393,6 +394,7 @@ public class Spindexer {
// Keep moving the spindexer // Keep moving the spindexer
servos.setSpinPos(intakePositions[commandedIntakePosition]); servos.setSpinPos(intakePositions[commandedIntakePosition]);
} }
servos.setTransferPos(transferServo_out);
break; break;
case UNKNOWN_DETECT: case UNKNOWN_DETECT:
if (unknownColorDetect >5) { if (unknownColorDetect >5) {
@@ -401,6 +403,7 @@ public class Spindexer {
//detectBalls(true, true); //detectBalls(true, true);
unknownColorDetect++; unknownColorDetect++;
} }
servos.setTransferPos(transferServo_out);
break; break;
case INTAKE: case INTAKE:
// Ready for intake and Detecting a New Ball // Ready for intake and Detecting a New Ball
@@ -412,6 +415,7 @@ public class Spindexer {
spindexerWiggle *= -1.0; spindexerWiggle *= -1.0;
servos.setSpinPos(intakePositions[commandedIntakePosition]+spindexerWiggle); servos.setSpinPos(intakePositions[commandedIntakePosition]+spindexerWiggle);
} }
servos.setTransferPos(transferServo_out);
break; break;
case FINDNEXT: case FINDNEXT:
// Find Next Open Position and start movement // Find Next Open Position and start movement
@@ -443,8 +447,8 @@ public class Spindexer {
currentIntakeState = Spindexer.IntakeState.FULL; currentIntakeState = Spindexer.IntakeState.FULL;
} }
servos.setSpinPos(intakePositions[commandedIntakePosition]); servos.setSpinPos(intakePositions[commandedIntakePosition]);
servos.setTransferPos(transferServo_out);
break; break;
case MOVING: case MOVING:
// Stopping when we get to the new position // Stopping when we get to the new position
if (servos.spinEqual(intakePositions[commandedIntakePosition])) { if (servos.spinEqual(intakePositions[commandedIntakePosition])) {
@@ -460,6 +464,7 @@ public class Spindexer {
// Keep moving the spindexer // Keep moving the spindexer
servos.setSpinPos(intakePositions[commandedIntakePosition]); servos.setSpinPos(intakePositions[commandedIntakePosition]);
} }
servos.setTransferPos(transferServo_out);
break; break;
case FULL: case FULL:
@@ -472,6 +477,7 @@ public class Spindexer {
// Maintain Position // Maintain Position
spindexerWiggle *= -1.0; spindexerWiggle *= -1.0;
servos.setSpinPos(intakePositions[commandedIntakePosition]+spindexerWiggle); servos.setSpinPos(intakePositions[commandedIntakePosition]+spindexerWiggle);
servos.setTransferPos(transferServo_out);
break; break;
case SHOOT_ALL_PREP: case SHOOT_ALL_PREP: