From 68e4fdb14d3599ff1df244197b2c2962a39a402b Mon Sep 17 00:00:00 2001 From: DanTheMan-byte Date: Thu, 29 Jan 2026 13:58:27 -0600 Subject: [PATCH] stash --- .../ftc/teamcode/teleop/TeleopV3.java | 3 +++ .../ftc/teamcode/utils/Spindexer.java | 22 +++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teleop/TeleopV3.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teleop/TeleopV3.java index 53c9332..ee70e46 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teleop/TeleopV3.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teleop/TeleopV3.java @@ -184,6 +184,9 @@ public class TeleopV3 extends LinearOpMode { robot.transferServo.setPosition(transferServo_out); while (opModeIsActive()) { + //LIMELIGHT START + TELE.addData("Is limelight on?", robot.limelight.getStatus()); + // LIGHT COLORS spindexer.ballCounterLight(); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utils/Spindexer.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utils/Spindexer.java index 9b0018b..f24451f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utils/Spindexer.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utils/Spindexer.java @@ -161,7 +161,7 @@ public class Spindexer { distanceFrontPassenger = robot.color3.getDistance(DistanceUnit.MM); // Position 1 - if (distanceRearCenter < 43) { + if (distanceRearCenter < 50) { // Mark Ball Found newPos1Detection = true; @@ -175,17 +175,17 @@ public class Spindexer { double gP = green / (green + red + blue); // FIXIT - Add filtering to improve accuracy. - if (gP >= 0.4) { - ballPositions[commandedIntakePosition].ballColor = BallColor.PURPLE; // purple + if (gP >= 0.38) { + ballPositions[commandedIntakePosition].ballColor = BallColor.GREEN; // green } else { - ballPositions[commandedIntakePosition].ballColor = BallColor.GREEN; // purple + ballPositions[commandedIntakePosition].ballColor = BallColor.PURPLE; // purple } } } // Position 2 // Find which ball position this is in the spindexer spindexerBallPos = RotatedBallPositions[commandedIntakePosition][RotatedBallPositionNames.FRONTDRIVER.ordinal()]; - if (distanceFrontDriver < 60) { + if (distanceFrontDriver < 50) { // reset FoundEmpty because looking for 3 in a row before reset ballPositions[spindexerBallPos].foundEmpty = 0; if (detectFrontColor) { @@ -196,9 +196,9 @@ public class Spindexer { double gP = green / (green + red + blue); if (gP >= 0.4) { - ballPositions[spindexerBallPos].ballColor = BallColor.PURPLE; // purple + ballPositions[spindexerBallPos].ballColor = BallColor.GREEN; // green } else { - ballPositions[spindexerBallPos].ballColor = BallColor.GREEN; // purple + ballPositions[spindexerBallPos].ballColor = BallColor.PURPLE; // purple } } } else { @@ -213,7 +213,7 @@ public class Spindexer { // Position 3 spindexerBallPos = RotatedBallPositions[commandedIntakePosition][RotatedBallPositionNames.FRONTPASSENGER.ordinal()]; - if (distanceFrontPassenger < 33) { + if (distanceFrontPassenger < 25) { // reset FoundEmpty because looking for 3 in a row before reset ballPositions[spindexerBallPos].foundEmpty = 0; @@ -224,10 +224,10 @@ public class Spindexer { double gP = green / (green + red + blue); - if (gP >= 0.4) { - ballPositions[spindexerBallPos].ballColor = BallColor.PURPLE; // purple + if (gP >= 0.42) { + ballPositions[spindexerBallPos].ballColor = BallColor.GREEN; // green } else { - ballPositions[spindexerBallPos].ballColor = BallColor.GREEN; // purple + ballPositions[spindexerBallPos].ballColor = BallColor.PURPLE; // purple } } } else {