This commit is contained in:
2026-01-29 14:19:01 -06:00
parent 68e4fdb14d
commit c1dda240d3

View File

@@ -39,8 +39,11 @@ public class Spindexer {
public double distanceFrontDriver = 0.0; public double distanceFrontDriver = 0.0;
public double distanceFrontPassenger = 0.0; public double distanceFrontPassenger = 0.0;
private double prevPos = 0.0; public double spindexerWiggle = 0.01;
public double spindexerOuttakeWiggle = 0.01;
private double prevPos = 0.0;
public double spindexerPosOffset = 0.00;
public Types.Motif desiredMotif = Types.Motif.NONE; public Types.Motif desiredMotif = Types.Motif.NONE;
// For Use // For Use
enum RotatedBallPositionNames { enum RotatedBallPositionNames {
@@ -112,7 +115,9 @@ public class Spindexer {
double[] outakePositions = double[] outakePositions =
{spindexer_outtakeBall1, spindexer_outtakeBall2, spindexer_outtakeBall3}; {spindexer_outtakeBall1+spindexerPosOffset,
spindexer_outtakeBall2+spindexerPosOffset,
spindexer_outtakeBall3+spindexerPosOffset};
double[] intakePositions = double[] intakePositions =
{spindexer_intakePos1, spindexer_intakePos2, spindexer_intakePos3}; {spindexer_intakePos1, spindexer_intakePos2, spindexer_intakePos3};
@@ -391,7 +396,8 @@ public class Spindexer {
currentIntakeState = Spindexer.IntakeState.FINDNEXT; currentIntakeState = Spindexer.IntakeState.FINDNEXT;
} }
// Maintain Position // Maintain Position
moveSpindexerToPos(intakePositions[commandedIntakePosition]); spindexerWiggle *= -1.0;
moveSpindexerToPos(intakePositions[commandedIntakePosition]+spindexerWiggle);
break; break;
case SHOOT_ALL_PREP: case SHOOT_ALL_PREP:
@@ -447,7 +453,7 @@ public class Spindexer {
break; break;
case SHOOTWAIT: case SHOOTWAIT:
double shootWaitMax = 3; double shootWaitMax = 4;
// Stopping when we get to the new position // Stopping when we get to the new position
if (prevIntakeState != currentIntakeState) { if (prevIntakeState != currentIntakeState) {
if (commandedIntakePosition==2) { if (commandedIntakePosition==2) {
@@ -466,7 +472,8 @@ public class Spindexer {
//detectBalls(true, false); //detectBalls(true, false);
} }
// Keep moving the spindexer // Keep moving the spindexer
//moveSpindexerToPos(outakePositions[commandedIntakePosition]+(shootWaitCount*0.02)); spindexerOuttakeWiggle *= -1.01;
moveSpindexerToPos(outakePositions[commandedIntakePosition]+spindexerOuttakeWiggle);
break; break;
default: default: