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()
+ // );
+ // }
}
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;
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;
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() {
@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;
candle.clearAllAnimations();
candle.setControl(new SolidColor(8 , 8 + stripLength).withColor(new RGBWColor(0, 0, 0, 0)));
}
-
-
- private boolean underSecsToFlip(double secs) {
- // Optional<Double> timeToActive = HubActive.timeToActive();
- // Optional<Double> timeToInactive = HubActive.timeToInactive();
- Optional<Double> timeToActive = Optional.empty();
- Optional<Double> 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;
- }
- }
-
}