]> git.taranathan.com Git - FRC2026.git/commitdiff
fix shuttle
authoriefomit <timofei.stem@gmail.com>
Sat, 28 Mar 2026 16:39:43 +0000 (09:39 -0700)
committeriefomit <timofei.stem@gmail.com>
Sat, 28 Mar 2026 16:39:43 +0000 (09:39 -0700)
src/main/java/frc/robot/constants/ShuttleInterpolation.java
src/main/java/frc/robot/subsystems/turret/Turret.java

index 1eb358bfc13c650d88773b715a97fec48084e4bd..cf270adeee3a0fc0105278295c732ba765c7b282 100644 (file)
@@ -1,18 +1,22 @@
+package frc.robot.constants;
+
+import edu.wpi.first.math.interpolation.InterpolatingDoubleTreeMap;
 
-// i'm going to get so many lines of code from this :) - Wesley
 public class ShuttleInterpolation {
-    public static final IntpolationDoubleTreeMap hoodAngleMap = new InterpolationDoubleTreeMap();
-    public static final IntpolationDoubleTreeMap shooterVelocityMap = new InterpolationDoubleTreeMap();
+    public static final InterpolatingDoubleTreeMap newHoodMap = new InterpolatingDoubleTreeMap();
+    public static final InterpolatingDoubleTreeMap shooterVelocityMap = new InterpolatingDoubleTreeMap();
     /*
-    guide to tuning:
-    modify the left values in the parenthesis to change the distance of the shot.
-    setup the robot at that distance and shoot. Then modifty the right value to be more or less until it hits target perfectly.
-    Repeat
-    OR
-    Run robot, estimate distance, and tweak values when nobodies looking until it works.
-    */
+     * guide to tuning:
+     * modify the left values in the parenthesis to change the distance of the shot.
+     * setup the robot at that distance and shoot. Then modifty the right value to
+     * be more or less until it hits target perfectly.
+     * Repeat
+     * OR
+     * Run robot, estimate distance, and tweak values when nobodies looking until it
+     * works.
+     */
     static {
-        // we can be less aggressive: y = 0.65 * (1.34959x + 9.79618) 
+        // we can be less aggressive: y = 0.65 * (1.34959x + 9.79618)
         // will likely be this that requires tuning.
         shooterVelocityMap.put(0.0, 6.2075);
         shooterVelocityMap.put(1.00, 7.475);
@@ -24,7 +28,7 @@ public class ShuttleInterpolation {
         shooterVelocityMap.put(5.79, 11.7);
         shooterVelocityMap.put(25.0, 28.236);
 
-        // always shoot at low angle to ground. 
+        // always shoot at low angle to ground.
         newHoodMap.put(0.0, 80.0);
         newHoodMap.put(1.00, 80.0);
         newHoodMap.put(1.49, 80.0);
@@ -36,4 +40,4 @@ public class ShuttleInterpolation {
         newHoodMap.put(27.99, 80.0);
     }
 
-}
\ No newline at end of file
+}
index 69247a114cdf22cc48dd7259462e3b9fbd789e86..c2e770c229ce3a43941b6540b8eeb3e1f8eb7e1f 100644 (file)
@@ -5,14 +5,12 @@ import org.littletonrobotics.junction.Logger;
 import com.ctre.phoenix6.configs.CurrentLimitsConfigs;
 import com.ctre.phoenix6.configs.TalonFXConfiguration;
 import com.ctre.phoenix6.controls.MotionMagicVoltage;
-import com.ctre.phoenix6.hardware.CANcoder;
 import com.ctre.phoenix6.hardware.TalonFX;
 import com.ctre.phoenix6.signals.InvertedValue;
 import com.ctre.phoenix6.signals.NeutralModeValue;
 import com.ctre.phoenix6.sim.TalonFXSimState;
 
 import edu.wpi.first.math.MathUtil;
-import edu.wpi.first.math.Pair;
 import edu.wpi.first.math.filter.Debouncer;
 import edu.wpi.first.math.filter.Debouncer.DebounceType;
 import edu.wpi.first.math.filter.LinearFilter;