From: iefomit Date: Sat, 28 Mar 2026 16:39:43 +0000 (-0700) Subject: fix shuttle X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=370fca084ad4f3b6dc7a889df796263fd1e02dda;p=FRC2026.git fix shuttle --- diff --git a/src/main/java/frc/robot/constants/ShuttleInterpolation.java b/src/main/java/frc/robot/constants/ShuttleInterpolation.java index 1eb358b..cf270ad 100644 --- a/src/main/java/frc/robot/constants/ShuttleInterpolation.java +++ b/src/main/java/frc/robot/constants/ShuttleInterpolation.java @@ -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 +} diff --git a/src/main/java/frc/robot/subsystems/turret/Turret.java b/src/main/java/frc/robot/subsystems/turret/Turret.java index 69247a1..c2e770c 100644 --- a/src/main/java/frc/robot/subsystems/turret/Turret.java +++ b/src/main/java/frc/robot/subsystems/turret/Turret.java @@ -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;