This commit is contained in:
2026-01-29 13:58:27 -06:00
parent 66c5de1b26
commit 68e4fdb14d
2 changed files with 14 additions and 11 deletions

View File

@@ -184,6 +184,9 @@ public class TeleopV3 extends LinearOpMode {
robot.transferServo.setPosition(transferServo_out); robot.transferServo.setPosition(transferServo_out);
while (opModeIsActive()) { while (opModeIsActive()) {
//LIMELIGHT START
TELE.addData("Is limelight on?", robot.limelight.getStatus());
// LIGHT COLORS // LIGHT COLORS
spindexer.ballCounterLight(); spindexer.ballCounterLight();

View File

@@ -161,7 +161,7 @@ public class Spindexer {
distanceFrontPassenger = robot.color3.getDistance(DistanceUnit.MM); distanceFrontPassenger = robot.color3.getDistance(DistanceUnit.MM);
// Position 1 // Position 1
if (distanceRearCenter < 43) { if (distanceRearCenter < 50) {
// Mark Ball Found // Mark Ball Found
newPos1Detection = true; newPos1Detection = true;
@@ -175,17 +175,17 @@ public class Spindexer {
double gP = green / (green + red + blue); double gP = green / (green + red + blue);
// FIXIT - Add filtering to improve accuracy. // FIXIT - Add filtering to improve accuracy.
if (gP >= 0.4) { if (gP >= 0.38) {
ballPositions[commandedIntakePosition].ballColor = BallColor.PURPLE; // purple ballPositions[commandedIntakePosition].ballColor = BallColor.GREEN; // green
} else { } else {
ballPositions[commandedIntakePosition].ballColor = BallColor.GREEN; // purple ballPositions[commandedIntakePosition].ballColor = BallColor.PURPLE; // purple
} }
} }
} }
// Position 2 // Position 2
// Find which ball position this is in the spindexer // Find which ball position this is in the spindexer
spindexerBallPos = RotatedBallPositions[commandedIntakePosition][RotatedBallPositionNames.FRONTDRIVER.ordinal()]; spindexerBallPos = RotatedBallPositions[commandedIntakePosition][RotatedBallPositionNames.FRONTDRIVER.ordinal()];
if (distanceFrontDriver < 60) { if (distanceFrontDriver < 50) {
// reset FoundEmpty because looking for 3 in a row before reset // reset FoundEmpty because looking for 3 in a row before reset
ballPositions[spindexerBallPos].foundEmpty = 0; ballPositions[spindexerBallPos].foundEmpty = 0;
if (detectFrontColor) { if (detectFrontColor) {
@@ -196,9 +196,9 @@ public class Spindexer {
double gP = green / (green + red + blue); double gP = green / (green + red + blue);
if (gP >= 0.4) { if (gP >= 0.4) {
ballPositions[spindexerBallPos].ballColor = BallColor.PURPLE; // purple ballPositions[spindexerBallPos].ballColor = BallColor.GREEN; // green
} else { } else {
ballPositions[spindexerBallPos].ballColor = BallColor.GREEN; // purple ballPositions[spindexerBallPos].ballColor = BallColor.PURPLE; // purple
} }
} }
} else { } else {
@@ -213,7 +213,7 @@ public class Spindexer {
// Position 3 // Position 3
spindexerBallPos = RotatedBallPositions[commandedIntakePosition][RotatedBallPositionNames.FRONTPASSENGER.ordinal()]; spindexerBallPos = RotatedBallPositions[commandedIntakePosition][RotatedBallPositionNames.FRONTPASSENGER.ordinal()];
if (distanceFrontPassenger < 33) { if (distanceFrontPassenger < 25) {
// reset FoundEmpty because looking for 3 in a row before reset // reset FoundEmpty because looking for 3 in a row before reset
ballPositions[spindexerBallPos].foundEmpty = 0; ballPositions[spindexerBallPos].foundEmpty = 0;
@@ -224,10 +224,10 @@ public class Spindexer {
double gP = green / (green + red + blue); double gP = green / (green + red + blue);
if (gP >= 0.4) { if (gP >= 0.42) {
ballPositions[spindexerBallPos].ballColor = BallColor.PURPLE; // purple ballPositions[spindexerBallPos].ballColor = BallColor.GREEN; // green
} else { } else {
ballPositions[spindexerBallPos].ballColor = BallColor.GREEN; // purple ballPositions[spindexerBallPos].ballColor = BallColor.PURPLE; // purple
} }
} }
} else { } else {