From: Taran Nathan Date: Wed, 13 May 2026 21:38:11 +0000 (-0700) Subject: do some more thorough cleaning X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=a685c03a02971ebc8b164de37901c409428cf156;p=FRC2027.git do some more thorough cleaning --- diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index a646227..60cd714 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -242,12 +242,6 @@ public class RobotContainer { // String leftDynamicShallowDoubleSwipe = "LeftDynamicShallowDoubleSwipe"; // String rightDynamicShallowDoubleSwipe = "RightDynamicShallowDoubleSwipe"; - // add commands - addAuto(leftDynamicLiberalDoubleSwipe, dynamicAutoBuilder.getDynamicDoubleLiberalSwipe(true)); - addAuto(rightDynamicLiberalDoubleSwipe, dynamicAutoBuilder.getDynamicDoubleLiberalSwipe(false)); - addAuto(leftDynamicConservativeDoubleSwipe, dynamicAutoBuilder.getDynamicDoubleConservativeSwipe(true)); - addAuto(rightDynamicConservativeDoubleSwipe, dynamicAutoBuilder.getDynamicDoubleConservativeSwipe(false)); - ChoreoPathCommandBuilder choreo = new ChoreoPathCommandBuilder(); // addAuto("testChoreo", ChoreoPathCommandBuilder.basicTrajectoryAuto("test.traj", true, autoFactory)); diff --git a/src/main/java/frc/robot/commands/auto_comm/DynamicAutoBuilder.java b/src/main/java/frc/robot/commands/auto_comm/DynamicAutoBuilder.java index 57acb50..47516ab 100644 --- a/src/main/java/frc/robot/commands/auto_comm/DynamicAutoBuilder.java +++ b/src/main/java/frc/robot/commands/auto_comm/DynamicAutoBuilder.java @@ -7,98 +7,19 @@ import com.pathplanner.lib.commands.PathPlannerAuto; public class DynamicAutoBuilder { - - public DynamicAutoBuilder() { - } - - /* - * Autos have no named commands within them. They must be added here - * Still need to make one method to call that four command block in each - * sequential - */ - - public Command getDynamicDoubleLiberalSwipe(boolean left) { - return new SequentialCommandGroup( - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeOne" : "RightSwipeOne"), - startShootingCommand(), - runSpindexerWithAbort(), - - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeTwo" : "RightSwipeTwo"), - startShootingCommand(), - runSpindexerWithAbort(), - - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeTwo" : "RightSwipeTwo"), - startShootingCommand(), - runSpindexerWithAbort(), - - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeTwo" : "RightSwipeTwo"), - startShootingCommand(), - runSpindexerWithAbort()); - } - - public Command getDynamicDoubleConservativeSwipe(boolean left) { - return new SequentialCommandGroup( - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeConservative" : "RightSwipeConservative"), - startShootingCommand(), - runSpindexerWithAbort(), - - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeTwo" : "RightSwipeTwo"), - startShootingCommand(), - runSpindexerWithAbort(), - - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeTwo" : "RightSwipeTwo"), - startShootingCommand(), - runSpindexerWithAbort(), - - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeTwo" : "RightSwipeTwo"), - startShootingCommand(), - runSpindexerWithAbort()); - } - - public Command getDynamicDoubleShallowSwipe(boolean left) { - return new SequentialCommandGroup( - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeThree" : "RightSwipeThree"), - startShootingCommand(), - runSpindexerWithAbort(), - - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeTwo" : "RightSwipeTwo"), - startShootingCommand(), - runSpindexerWithAbort(), - - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeTwo" : "RightSwipeTwo"), - startShootingCommand(), - runSpindexerWithAbort(), - - departCommand(), - new PathPlannerAuto(left ? "LeftSwipeTwo" : "RightSwipeTwo"), - startShootingCommand(), - runSpindexerWithAbort()); - } - - private Command departCommand() { - return new InstantCommand(() -> { - }); - } - - private Command runSpindexerWithAbort() { - // has an isFinnished so works - // return new RunSpindexerWithStop(spindexer, turret, hood, intake); - return new DoNothing(); - } - - private Command startShootingCommand() { - // return new InstantCommand(() -> hood.forceHoodDown(false)); - return new DoNothing(); - } + public DynamicAutoBuilder() { + } + + /* + * Autos have no named commands within them. They must be added here + * Still need to make one method to call that four command block in each + * sequential + */ + + // template: + // public Command templateAuto() { + // return new SequentialCommandGroup( + // new DoNothing() + // ); + // } } diff --git a/src/main/java/frc/robot/constants/FieldConstants.java b/src/main/java/frc/robot/constants/FieldConstants.java index a500a8c..0f89a01 100644 --- a/src/main/java/frc/robot/constants/FieldConstants.java +++ b/src/main/java/frc/robot/constants/FieldConstants.java @@ -21,14 +21,4 @@ public class FieldConstants { /** Height of the field [meters] */ public static final double FIELD_WIDTH = field.getFieldWidth(); - - /** - * - * @return Whether Y coordinate is in the upper half (left side on blue - * alliance) - */ - public static boolean isOnLeftSideOfField(Translation2d drivepose) { - return drivepose.getY() > FIELD_WIDTH / 2; - } - } diff --git a/src/main/java/frc/robot/subsystems/LED/LED.java b/src/main/java/frc/robot/subsystems/LED/LED.java index d502d49..ab4fbeb 100644 --- a/src/main/java/frc/robot/subsystems/LED/LED.java +++ b/src/main/java/frc/robot/subsystems/LED/LED.java @@ -1,7 +1,5 @@ package frc.robot.subsystems.LED; -import java.util.Optional; - import com.ctre.phoenix6.configs.CANdleConfigurator; import com.ctre.phoenix6.configs.CANdleFeaturesConfigs; import com.ctre.phoenix6.configs.LEDConfigs; @@ -22,7 +20,6 @@ import com.ctre.phoenix6.signals.VBatOutputModeValue; import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.DriverStation.Alliance; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj.util.Color; import edu.wpi.first.wpilibj2.command.InstantCommand; import edu.wpi.first.wpilibj2.command.SubsystemBase; @@ -62,17 +59,6 @@ public class LED extends SubsystemBase { lightsOff(); // System.out.println("CANdle features: " + featureConf + ", LED config: " + ledConf); - - SmartDashboard.putData("LED Disable", new InstantCommand(() -> {forceOff = true; lightsOff();}).ignoringDisable(true)); - SmartDashboard.putData("LED Enable", new InstantCommand(() -> forceOff = false).ignoringDisable(true)); - SmartDashboard.putData("LED Strobe", new InstantCommand(() -> setStrobe()).ignoringDisable(true)); - SmartDashboard.putData("LED Static", new InstantCommand(() -> setStatic()).ignoringDisable(true)); - SmartDashboard.putData("LED Fire", new InstantCommand(() -> setFire()).ignoringDisable(true)); - SmartDashboard.putData("LED Rainbow", new InstantCommand(() -> setRainbow()).ignoringDisable(true)); - SmartDashboard.putData("LED Fade", new InstantCommand(() -> setRgbFadeAnimation()).ignoringDisable(true)); - SmartDashboard.putData("LED Twinkle", new InstantCommand(() -> setTwinkle()).ignoringDisable(true)); - SmartDashboard.putData("LED Color Flow", new InstantCommand(() -> setColorFlow()).ignoringDisable(true)); - SmartDashboard.putData("LED Color Team Reset", new InstantCommand(() -> setColor()).ignoringDisable(true)); } public void setColor() { @@ -96,8 +82,8 @@ public class LED extends SubsystemBase { @Override public void periodic() { State targetState = State.ON; - if (underSecsToFlip(5)) targetState = State.SLOW; - if (underSecsToFlip(1)) targetState = State.FAST; + // if (underSecsToFlip(5)) targetState = State.SLOW; + // if (underSecsToFlip(1)) targetState = State.FAST; if (DriverStation.isAutonomous()) targetState = State.AUTO; if (DriverStation.getMatchTime() < 30) targetState = State.ENDGAME; if (forceOff) targetState = State.OFF; @@ -159,24 +145,4 @@ public class LED extends SubsystemBase { candle.clearAllAnimations(); candle.setControl(new SolidColor(8 , 8 + stripLength).withColor(new RGBWColor(0, 0, 0, 0))); } - - - private boolean underSecsToFlip(double secs) { - // Optional timeToActive = HubActive.timeToActive(); - // Optional timeToInactive = HubActive.timeToInactive(); - Optional timeToActive = Optional.empty(); - Optional timeToInactive = Optional.empty(); - - if (timeToActive.isEmpty() && timeToInactive.isEmpty()) { - return false; - } else if (timeToActive.isPresent() && timeToActive.get() != 0) { - return (timeToActive.get() <= secs); - - } else if (timeToInactive.isPresent() && timeToInactive.get() != 0) { - return (timeToInactive.get() <= secs); - } else { - return false; - } - } - }