From: maxwtan <100314265+MaxwellTTan20@users.noreply.github.com> Date: Sat, 14 Mar 2026 23:26:02 +0000 (-0700) Subject: Spindexer off when hood down X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=b8786ee1abda04cd3cbbc6d665c897702e2ef930;p=FRC2026.git Spindexer off when hood down --- diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 87b6ee0..977e7bc 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -137,10 +137,11 @@ public class RobotContainer { PathGroupLoader.loadPathGroups(); // Load the auto command try { - String leftSideAuto = "Right Week V1"; + String leftSideAuto = "Left Week V1"; // String leftSideAuto = "Right Week V1"; - // String leftSideAuto = "Right Week V1"; - // String rightSideAuto = "Right(2) - Under Trench"; + // String leftSideAuto = "Depot Outpost Left Week V1"; + // String rightSideAuto = "Shoot Only Left Week V1"; + // String testing = "Straight Test"; PathPlannerAuto.getPathGroupFromAutoFile(leftSideAuto); auto = new PathPlannerAuto(leftSideAuto); diff --git a/src/main/java/frc/robot/commands/gpm/RunSpindexer.java b/src/main/java/frc/robot/commands/gpm/RunSpindexer.java index 7d806d1..253bc85 100644 --- a/src/main/java/frc/robot/commands/gpm/RunSpindexer.java +++ b/src/main/java/frc/robot/commands/gpm/RunSpindexer.java @@ -3,6 +3,7 @@ package frc.robot.commands.gpm; import edu.wpi.first.math.filter.Debouncer; import edu.wpi.first.math.filter.Debouncer.DebounceType; import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.subsystems.hood.Hood; import frc.robot.subsystems.spindexer.Spindexer; import frc.robot.subsystems.spindexer.SpindexerConstants; import frc.robot.subsystems.turret.Turret; @@ -10,15 +11,18 @@ import frc.robot.subsystems.turret.Turret; public class RunSpindexer extends Command { private Spindexer spindexer; private Turret turret; + private Hood hood; private Debouncer jam_debouncer = new Debouncer(SpindexerConstants.JAM_DEBOUNCE_TIME, DebounceType.kRising); // if their is jam I would think this is 0 -> 1 private Debouncer reversing_debouncer = new Debouncer(SpindexerConstants.REVERSE_DEBOUNCE_TIME, DebounceType.kFalling); // if there is a release in time Idk what it would be (kfalling vs krising) private boolean reversing = false; - public RunSpindexer(Spindexer spindexer, Turret turret) { + public RunSpindexer(Spindexer spindexer, Turret turret, Hood hood) { this.spindexer = spindexer; this.turret = turret; - addRequirements(spindexer); + this.hood = hood; + + addRequirements(spindexer, hood); } // public RunSpindexer(Spindexer spindexer) { @@ -28,7 +32,7 @@ public class RunSpindexer extends Command { @Override public void execute() { - if (!turret.atSetpoint()) { + if (!turret.atSetpoint() || hood.getHoodForcedDown()) { spindexer.stopSpindexer(); reversing = false; return; // this is so the balls don't fly out when unaligned diff --git a/src/main/java/frc/robot/constants/FieldConstants.java b/src/main/java/frc/robot/constants/FieldConstants.java index dc62978..037aa83 100644 --- a/src/main/java/frc/robot/constants/FieldConstants.java +++ b/src/main/java/frc/robot/constants/FieldConstants.java @@ -26,6 +26,8 @@ public class FieldConstants { public static final double BLUE_BORDER = FIELD_LENGTH/2 - Units.inchesToMeters(167.0); public static final double LEFT_SIDE_TARGET = FIELD_WIDTH * 0.167; public static final double RIGHT_SIDE_TARGET = FIELD_WIDTH * 0.833; + // public static final double LEFT_SIDE_TARGET = FIELD_WIDTH * 0.225; + // public static final double RIGHT_SIDE_TARGET = FIELD_WIDTH * 0.775; /**The coordinate of the climb position */ public static final Pose2d BLUE_CLIMB_LOCATION = new Pose2d(1.5, FIELD_WIDTH/2 - 2.0, new Rotation2d()); // TODO: find this diff --git a/src/main/java/frc/robot/subsystems/hood/Hood.java b/src/main/java/frc/robot/subsystems/hood/Hood.java index 1959139..a50b239 100644 --- a/src/main/java/frc/robot/subsystems/hood/Hood.java +++ b/src/main/java/frc/robot/subsystems/hood/Hood.java @@ -94,6 +94,10 @@ public class Hood extends SubsystemBase implements HoodIO { forceHoodDown = taranNathan; } + public boolean getHoodForcedDown() { + return this.forceHoodDown; + } + @Override public void periodic() { updateInputs();