From: WesleyWong-972 Date: Mon, 20 Apr 2026 23:34:24 +0000 (-0700) Subject: Revert "shuttling tuned (seperate non dynamic TOF for shuttling)" X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=3e00596f905deb98c44fe417fd1f657de9891286;p=FRC2026.git Revert "shuttling tuned (seperate non dynamic TOF for shuttling)" This reverts commit 89dcb54891055b6ced51a7677de6a1980f74cba4. --- diff --git a/src/main/java/frc/robot/commands/gpm/Superstructure.java b/src/main/java/frc/robot/commands/gpm/Superstructure.java index d767fe8..27fb45b 100644 --- a/src/main/java/frc/robot/commands/gpm/Superstructure.java +++ b/src/main/java/frc/robot/commands/gpm/Superstructure.java @@ -66,7 +66,6 @@ public class Superstructure extends Command { private double turretOffset = 0.0; private double distanceFromTarget = 0.0; - private double shuttlingTOFMultiplier = 0.8; // private double TOFAdjustment = 0.85; // private double TOFAdjustment = 1.1; @@ -112,12 +111,11 @@ public class Superstructure extends Command { * So we make a bunch of guesses until it converges * Early exit when change < 1mm to avoid unnecessary iterations */ - boolean shuttling = target.equals(FieldConstants.getHubTranslation().toTranslation2d()); for (int i = 0; i < 20; i++) { Translation3d lookahead3d = new Translation3d(lookaheadPose.getX(), lookaheadPose.getY(), TurretConstants.DISTANCE_FROM_ROBOT_CENTER.getZ()); Translation3d target3d = new Translation3d(target.getX(), target.getY(), - shuttling ? + target.equals(FieldConstants.getHubTranslation().toTranslation2d()) ? FieldConstants.getHubTranslation().getZ() : 0.0); // Height of 0 if it's not the hub goalState = ShooterPhysics.getShotParams( @@ -125,13 +123,7 @@ public class Superstructure extends Command { target3d.minus(lookahead3d), 2.0); - if (!shuttling) { - timeOfFlight = goalState.timeOfFlight() * TOFAdjustment.get(); - } else { - double distance = target.getDistance(lookaheadPose.getTranslation()); - timeOfFlight = distance * shuttlingTOFMultiplier; - } - + timeOfFlight = goalState.timeOfFlight() * TOFAdjustment.get(); double offsetX = turretVelocityX * timeOfFlight; double offsetY = turretVelocityY * timeOfFlight; Pose2d newLookaheadPose = @@ -259,9 +251,6 @@ public class Superstructure extends Command { turretOffset = SmartDashboard.getNumber("OPERATOR: Turret Offset", turretOffset); SmartDashboard.putNumber("OPERATOR: Turret Offset", turretOffset); - shuttlingTOFMultiplier = SmartDashboard.getNumber("Shuttling TOF Multiplier", shuttlingTOFMultiplier); - SmartDashboard.putNumber("Shuttling TOF Multiplier", shuttlingTOFMultiplier); - if (phaseManager.isIdle()) { underLadder(); } else { diff --git a/src/main/java/frc/robot/constants/ShuttleInterpolation.java b/src/main/java/frc/robot/constants/ShuttleInterpolation.java index 873db71..3d8074e 100644 --- a/src/main/java/frc/robot/constants/ShuttleInterpolation.java +++ b/src/main/java/frc/robot/constants/ShuttleInterpolation.java @@ -19,12 +19,13 @@ public class ShuttleInterpolation { // we can be less aggressive: y = 0.65 * (1.34959x + 9.79618) // will likely be this that requires tuning. shooterVelocityMap.put(0.0, 9.0); - shooterVelocityMap.put(4.0, 12.0 * 1.3); // tuned - shooterVelocityMap.put(8.0, 22.0 * 1.075); // tuned - shooterVelocityMap.put(16.0, 44.0); // untuned + shooterVelocityMap.put(4.0, 12.8); + shooterVelocityMap.put(7.6, 19.0); + shooterVelocityMap.put(11.4, 28.1); // was 25.2 before + shooterVelocityMap.put(16.54, 44.8); // untested // always shoot at low angle to ground. - newHoodMap.put(0.0, 55.0); - newHoodMap.put(27.99, 55.0); + newHoodMap.put(0.0, 60.0); + newHoodMap.put(27.99, 60.0); } }