+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);
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);
newHoodMap.put(27.99, 80.0);
}
-}
\ No newline at end of file
+}
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;