]> git.taranathan.com Git - FRC2026.git/commitdiff
Revert "shuttling tuned (seperate non dynamic TOF for shuttling)"
authorWesleyWong-972 <wesleycwong@gmail.com>
Mon, 20 Apr 2026 23:34:24 +0000 (16:34 -0700)
committerWesleyWong-972 <wesleycwong@gmail.com>
Mon, 20 Apr 2026 23:34:24 +0000 (16:34 -0700)
This reverts commit 89dcb54891055b6ced51a7677de6a1980f74cba4.

src/main/java/frc/robot/commands/gpm/Superstructure.java
src/main/java/frc/robot/constants/ShuttleInterpolation.java

index d767fe857db237fbb7aa06ef651daa08ec65fc9e..27fb45b4573f6ea9884e6613e127e84564a51485 100644 (file)
@@ -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 {
index 873db717f44aa2fd919684ad17ee3abbba9dec3c..3d8074e1d31c8afec2d1361b326d941419cdf9ae 100644 (file)
@@ -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);
     }
 }