]> git.taranathan.com Git - FRC2026.git/commitdiff
Spindexer off when hood down
authormaxwtan <100314265+MaxwellTTan20@users.noreply.github.com>
Sat, 14 Mar 2026 23:26:02 +0000 (16:26 -0700)
committermaxwtan <100314265+MaxwellTTan20@users.noreply.github.com>
Sat, 14 Mar 2026 23:26:02 +0000 (16:26 -0700)
src/main/java/frc/robot/RobotContainer.java
src/main/java/frc/robot/commands/gpm/RunSpindexer.java
src/main/java/frc/robot/constants/FieldConstants.java
src/main/java/frc/robot/subsystems/hood/Hood.java

index 87b6ee0ee39aaad26141898f8f2d797b92f5eb16..977e7bc33db1010cc828e1e44fa777dc65734687 100644 (file)
@@ -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);
index 7d806d1b5a0d696844db804ff476c92af770bc56..253bc855c9ea5028e715575c9b2a289185e5501b 100644 (file)
@@ -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
index dc629785f66bc034a017983101d04865540e02e2..037aa83858c6a2baf9317e0c28a8341c31a10d92 100644 (file)
@@ -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
index 19591391cd0804fb1618d25a1217ac011889cb1c..a50b239af3384340bdeb48232f8777cdd3cd6f96 100644 (file)
@@ -94,6 +94,10 @@ public class Hood extends SubsystemBase implements HoodIO {
                forceHoodDown = taranNathan;
        }
 
+       public boolean getHoodForcedDown() {
+               return this.forceHoodDown;
+       }
+
     @Override
     public void periodic() {
                updateInputs();