From 26f5143840a4fc94482cd0eff98d25529a673da8 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Sun, 25 Jan 2026 15:51:47 -0800 Subject: [PATCH 1/9] pitcheck intake for alpha --- src/main/java/frc/robot/Robot.java | 19 ++++++++++++++----- .../subsystems/intake/FintakeSubsystem.java | 5 +++++ .../frc/robot/subsystems/intake/Intake.java | 2 ++ .../subsystems/intake/LintakeSubsystem.java | 6 ++++++ .../subsystems/shooter/TurretSubsystem.java | 1 - 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 54cd82c3..0c55a261 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -183,6 +183,10 @@ public void placeGamePiecesOnField() {} SimulatedArena.overrideInstance(new EvergreenArena()); } + Indexer indexer = null; + Intake intake = null; + Shooter shooter = null; + // this is here because it doesn't like that the power distribution logger is never closed @SuppressWarnings("resource") public Robot() { @@ -259,11 +263,11 @@ public Robot() { case COMP: indexer = new SpindexerSubsystem(); intake = new LintakeSubsystem(); - shooter = - new TurretSubsystem( - ROBOT_MODE == RobotMode.REAL - ? new FlywheelIO(FlywheelIO.getFlywheelConfiguration(), canivore) - : new FlywheelIOSim(FlywheelIO.getFlywheelConfiguration(),canivore)); + shooter = + new TurretSubsystem( + ROBOT_MODE == RobotMode.REAL + ? new FlywheelIO(FlywheelIO.getFlywheelConfiguration(), canivore) + : new FlywheelIOSim(FlywheelIO.getFlywheelConfiguration(), canivore)); climber = new ClimberSubsystem(); // TODO climber break; @@ -466,6 +470,11 @@ private void addAutos() { // autoChooser.addOption("Index Roller Sysid", indexer.runRollerSysId()); // autoChooser.addOption("Intake Roller Sysid", intake.runRollerSysid()); // autoChooser.addOption("Flywheel Sysid", shooter.runFlywheelSysid()); + autoChooser.addOption("Pitcheck/Intake ", Commands.sequence( + intake.intake().withTimeout(1), + intake.rest().withTimeout(1), + intake.outtake().withTimeout(1)) + ); haveAutosGenerated = true; System.out.println("Done generating autos"); } diff --git a/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java b/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java index b4dcfd10..f1e7791e 100644 --- a/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java @@ -81,4 +81,9 @@ public static TalonFXConfiguration getIntakeConfig() { return config; } + + @Override + public Command extend() { + return Commands.none(); + } } diff --git a/src/main/java/frc/robot/subsystems/intake/Intake.java b/src/main/java/frc/robot/subsystems/intake/Intake.java index 9a6196f2..13b4128f 100644 --- a/src/main/java/frc/robot/subsystems/intake/Intake.java +++ b/src/main/java/frc/robot/subsystems/intake/Intake.java @@ -16,4 +16,6 @@ public interface Intake { /** Not running (set to 0) */ public Command rest(); + + public Command extend(); } diff --git a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java index a400db14..88752915 100644 --- a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java @@ -34,4 +34,10 @@ public Command rest() { // TODO Auto-generated method stub throw new UnsupportedOperationException("Unimplemented method 'rest'"); } + + @Override + public Command extend() { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'extend'"); + } } diff --git a/src/main/java/frc/robot/subsystems/shooter/TurretSubsystem.java b/src/main/java/frc/robot/subsystems/shooter/TurretSubsystem.java index f0b3051f..a1597623 100644 --- a/src/main/java/frc/robot/subsystems/shooter/TurretSubsystem.java +++ b/src/main/java/frc/robot/subsystems/shooter/TurretSubsystem.java @@ -36,7 +36,6 @@ public class TurretSubsystem extends SubsystemBase implements Shooter { public TurretSubsystem(FlywheelIO flywheelIO) { this.flywheelIO = flywheelIO; - } private LoggedTunableNumber testDegrees = new LoggedTunableNumber("Shooter/Test Degrees", 10.0); From 54d968bae9fd11d63595802671aed79df71626f3 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Thu, 5 Feb 2026 18:54:33 -0800 Subject: [PATCH 2/9] ok idk man --- .../frc/robot/utils/pitcheck/Pitcheck.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main/java/frc/robot/utils/pitcheck/Pitcheck.java diff --git a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java new file mode 100644 index 00000000..73e4dbc2 --- /dev/null +++ b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java @@ -0,0 +1,29 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.utils.pitcheck; + +import java.util.function.BooleanSupplier; + +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Subsystem; + +import frc.robot.subsystems.intake.LintakeSubsystem; + +/** Add your docs here. */ +public class Pitcheck { + + LintakeSubsystem intake = new LintakeSubsystem(); + + public void pitcheck(Subsystem subsystem,Command command,BooleanSupplier endState){ + SmartDashboard.putData("intake", pitCheck(intake,intake.intake(),endState)); + + } + private Command pitCheck(Subsystem subsystem, Command command, BooleanSupplier endstate){ + + return command; + + } +} \ No newline at end of file From f1d1af99b2bc66ad5a8e1c2372ee55cc6fd15d80 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Sat, 7 Feb 2026 22:07:24 -0800 Subject: [PATCH 3/9] work in progess --- src/main/java/frc/robot/Robot.java | 17 ++++++------ .../subsystems/intake/FintakeSubsystem.java | 4 +++ .../frc/robot/subsystems/intake/Intake.java | 2 +- .../subsystems/intake/LintakeSubsystem.java | 5 ++++ .../frc/robot/utils/pitcheck/Pitcheck.java | 27 +++++++++---------- 5 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 0c55a261..3383376e 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -183,9 +183,9 @@ public void placeGamePiecesOnField() {} SimulatedArena.overrideInstance(new EvergreenArena()); } - Indexer indexer = null; - Intake intake = null; - Shooter shooter = null; + Indexer indexer = null; + Intake intake = null; + Shooter shooter = null; // this is here because it doesn't like that the power distribution logger is never closed @SuppressWarnings("resource") @@ -470,11 +470,12 @@ private void addAutos() { // autoChooser.addOption("Index Roller Sysid", indexer.runRollerSysId()); // autoChooser.addOption("Intake Roller Sysid", intake.runRollerSysid()); // autoChooser.addOption("Flywheel Sysid", shooter.runFlywheelSysid()); - autoChooser.addOption("Pitcheck/Intake ", Commands.sequence( - intake.intake().withTimeout(1), - intake.rest().withTimeout(1), - intake.outtake().withTimeout(1)) - ); + autoChooser.addOption( + "Pitcheck/Intake ", + Commands.sequence( + intake.intake().withTimeout(1), + intake.rest().withTimeout(1), + intake.outtake().withTimeout(1))); haveAutosGenerated = true; System.out.println("Done generating autos"); } diff --git a/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java b/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java index f1e7791e..e0693a6b 100644 --- a/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java @@ -40,6 +40,10 @@ public void periodic() { Logger.processInputs("Intake", inputs); } + public double getRollerVoltage() { + return inputs.appliedVoltage; + } + @Override public Command intake() { return this.run(() -> io.setRollerVoltage(10)); diff --git a/src/main/java/frc/robot/subsystems/intake/Intake.java b/src/main/java/frc/robot/subsystems/intake/Intake.java index 13b4128f..1aa57a27 100644 --- a/src/main/java/frc/robot/subsystems/intake/Intake.java +++ b/src/main/java/frc/robot/subsystems/intake/Intake.java @@ -17,5 +17,5 @@ public interface Intake { /** Not running (set to 0) */ public Command rest(); - public Command extend(); + public Command extend(); } diff --git a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java index 88752915..52ccb3ee 100644 --- a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java @@ -40,4 +40,9 @@ public Command extend() { // TODO Auto-generated method stub throw new UnsupportedOperationException("Unimplemented method 'extend'"); } + + public static double getRollerVoltage() { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'getRollerVoltage'"); + } } diff --git a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java index 73e4dbc2..d5057cc5 100644 --- a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java +++ b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java @@ -4,26 +4,25 @@ package frc.robot.utils.pitcheck; -import java.util.function.BooleanSupplier; - import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Subsystem; - import frc.robot.subsystems.intake.LintakeSubsystem; +import java.util.function.BooleanSupplier; /** Add your docs here. */ public class Pitcheck { - LintakeSubsystem intake = new LintakeSubsystem(); - - public void pitcheck(Subsystem subsystem,Command command,BooleanSupplier endState){ - SmartDashboard.putData("intake", pitCheck(intake,intake.intake(),endState)); + LintakeSubsystem intake = new LintakeSubsystem(); + BooleanSupplier intakeRunning = + () -> LintakeSubsystem.getRollerVoltage() > 9.0 && LintakeSubsystem.getRollerVoltage() < 11.0; + + public void pitcheck(Subsystem subsystem, Command command, BooleanSupplier endState) { + SmartDashboard.putData("intake", pitCheck(intake, intake.intake(), intakeRunning)); + } + + private Command pitCheck(Subsystem subsystem, Command command, BooleanSupplier endstate) { - } - private Command pitCheck(Subsystem subsystem, Command command, BooleanSupplier endstate){ - - return command; - - } -} \ No newline at end of file + return command.until(endstate); + } +} From 6ef8ab795c56800fb9c686e90750e804d6f640b1 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Fri, 13 Feb 2026 16:01:33 -0800 Subject: [PATCH 4/9] intake is goofed --- .../indexer/SpindexerSubsystem.java | 5 +++++ .../subsystems/intake/LintakeSubsystem.java | 2 +- .../frc/robot/utils/pitcheck/Pitcheck.java | 20 ++++++++++++++++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/indexer/SpindexerSubsystem.java b/src/main/java/frc/robot/subsystems/indexer/SpindexerSubsystem.java index 43469257..293d67fc 100644 --- a/src/main/java/frc/robot/subsystems/indexer/SpindexerSubsystem.java +++ b/src/main/java/frc/robot/subsystems/indexer/SpindexerSubsystem.java @@ -9,6 +9,8 @@ /** Spindexer = SPINning Indexer. !! COMP !! */ public class SpindexerSubsystem extends SubsystemBase implements Indexer { + + /** Creates a new SpindexerSubsystem. */ public SpindexerSubsystem() {} @@ -58,4 +60,7 @@ public Command rest() { // TODO Auto-generated method stub throw new UnsupportedOperationException("Unimplemented method 'rest'"); } + public double getSpindexerVoltage() { + return inputs.appliedVoltage; + } } diff --git a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java index 52ccb3ee..07bac2b1 100644 --- a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java @@ -41,7 +41,7 @@ public Command extend() { throw new UnsupportedOperationException("Unimplemented method 'extend'"); } - public static double getRollerVoltage() { + public double getRollerVoltage() { // TODO Auto-generated method stub throw new UnsupportedOperationException("Unimplemented method 'getRollerVoltage'"); } diff --git a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java index d5057cc5..48f5ff9f 100644 --- a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java +++ b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java @@ -6,19 +6,33 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.Subsystem; import frc.robot.subsystems.intake.LintakeSubsystem; +import frc.robot.subsystems.indexer.SpindexerSubsystem; import java.util.function.BooleanSupplier; /** Add your docs here. */ public class Pitcheck { LintakeSubsystem intake = new LintakeSubsystem(); - BooleanSupplier intakeRunning = - () -> LintakeSubsystem.getRollerVoltage() > 9.0 && LintakeSubsystem.getRollerVoltage() < 11.0; + SpindexerSubsystem spindexer = new SpindexerSubsystem(); + BooleanSupplier intakeRunningForward = + () -> intake.getRollerVoltage() > 9.0 && intake.getRollerVoltage() < 11.0; + BooleanSupplier intakeRunningBackward = + ()->intake.getRollerVoltage()<-9.0 && intake.getRollerVoltage()>-11.0; + BooleanSupplier intakeRest = + ()-> intake.getRollerVoltage()==0; + + public void pitcheck(Subsystem subsystem, Command command, BooleanSupplier endState) { - SmartDashboard.putData("intake", pitCheck(intake, intake.intake(), intakeRunning)); + SmartDashboard.putData("intakeRoller", new SequentialCommandGroup( + pitCheck(intake, intake.intake(), intakeRunningForward), + pitCheck(intake, intake.outtake(), intakeRunningBackward), + pitCheck(intake, intake.rest(), intakeRest))); + SmartDashboard.putData("spindexer", new SequentialCommandGroup( + pitCheck(spindexer, spindexer.kick(),spindexerKick))); } private Command pitCheck(Subsystem subsystem, Command command, BooleanSupplier endstate) { From 1ccbe9dc4e56b3f6d101b477c74782e891369c15 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Fri, 13 Feb 2026 16:14:29 -0800 Subject: [PATCH 5/9] updated branch --- .../frc/robot/utils/pitcheck/Pitcheck.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java index 48f5ff9f..cbcdeed2 100644 --- a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java +++ b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java @@ -8,8 +8,8 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.Subsystem; -import frc.robot.subsystems.intake.LintakeSubsystem; import frc.robot.subsystems.indexer.SpindexerSubsystem; +import frc.robot.subsystems.intake.LintakeSubsystem; import java.util.function.BooleanSupplier; /** Add your docs here. */ @@ -19,20 +19,20 @@ public class Pitcheck { SpindexerSubsystem spindexer = new SpindexerSubsystem(); BooleanSupplier intakeRunningForward = () -> intake.getRollerVoltage() > 9.0 && intake.getRollerVoltage() < 11.0; - BooleanSupplier intakeRunningBackward = - ()->intake.getRollerVoltage()<-9.0 && intake.getRollerVoltage()>-11.0; - BooleanSupplier intakeRest = - ()-> intake.getRollerVoltage()==0; - - + BooleanSupplier intakeRunningBackward = + () -> intake.getRollerVoltage() < -9.0 && intake.getRollerVoltage() > -11.0; + BooleanSupplier intakeRest = () -> intake.getRollerVoltage() == 0; public void pitcheck(Subsystem subsystem, Command command, BooleanSupplier endState) { - SmartDashboard.putData("intakeRoller", new SequentialCommandGroup( - pitCheck(intake, intake.intake(), intakeRunningForward), - pitCheck(intake, intake.outtake(), intakeRunningBackward), - pitCheck(intake, intake.rest(), intakeRest))); - SmartDashboard.putData("spindexer", new SequentialCommandGroup( - pitCheck(spindexer, spindexer.kick(),spindexerKick))); + SmartDashboard.putData( + "intakeRoller", + new SequentialCommandGroup( + pitCheck(intake, intake.intake(), intakeRunningForward), + pitCheck(intake, intake.outtake(), intakeRunningBackward), + pitCheck(intake, intake.rest(), intakeRest))); + SmartDashboard.putData( + "spindexer", + new SequentialCommandGroup(pitCheck(spindexer, spindexer.kick(), spindexerKick))); } private Command pitCheck(Subsystem subsystem, Command command, BooleanSupplier endstate) { From 53b64e71c8c2449e8f34a6abb3af35fa0b6c02d5 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Mon, 16 Feb 2026 11:07:35 -0800 Subject: [PATCH 6/9] true false added --- src/main/java/frc/robot/Robot.java | 6 ++- .../subsystems/intake/LintakeSubsystem.java | 1 - .../frc/robot/utils/pitcheck/Pitcheck.java | 47 +++++++++++++------ 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 80be8062..9ae4a3a6 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -378,7 +378,11 @@ public Robot() { // now that we've assigned the correct subsystems based on robot edition, we can pass them into // the superstructure superstructure = new Superstructure(swerve, indexer, intake, shooter, driver, operator); - autoAimReq = + + if (intake instanceof LintakeSubsystem lintake) { + new frc.robot.utils.pitcheck.Pitcheck(lintake).pitcheck(); +} + autoAimReq = driver .leftBumper() .or( diff --git a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java index c1e7fcde..479b353c 100644 --- a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java @@ -160,7 +160,6 @@ public boolean beambreak() { return canRangeIOInputs.isDetected; } - @Override public Command extend() { // TODO Auto-generated method stub throw new UnsupportedOperationException("Unimplemented method 'extend'"); diff --git a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java index cbcdeed2..00a45785 100644 --- a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java +++ b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java @@ -6,37 +6,54 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; -import edu.wpi.first.wpilibj2.command.Subsystem; -import frc.robot.subsystems.indexer.SpindexerSubsystem; import frc.robot.subsystems.intake.LintakeSubsystem; import java.util.function.BooleanSupplier; /** Add your docs here. */ public class Pitcheck { - LintakeSubsystem intake = new LintakeSubsystem(); - SpindexerSubsystem spindexer = new SpindexerSubsystem(); + LintakeSubsystem intake = new LintakeSubsystem(null, null, null); + // SpindexerSubsystem spindexer = new SpindexerSubsystem(); BooleanSupplier intakeRunningForward = () -> intake.getRollerVoltage() > 9.0 && intake.getRollerVoltage() < 11.0; BooleanSupplier intakeRunningBackward = () -> intake.getRollerVoltage() < -9.0 && intake.getRollerVoltage() > -11.0; - BooleanSupplier intakeRest = () -> intake.getRollerVoltage() == 0; + BooleanSupplier intakeRest = + () -> (intake.getRollerVoltage()) == 0.0; - public void pitcheck(Subsystem subsystem, Command command, BooleanSupplier endState) { + public Pitcheck(LintakeSubsystem lintake) { + //TODO Auto-generated constructor stub +} + +public void pitcheck() { SmartDashboard.putData( "intakeRoller", - new SequentialCommandGroup( - pitCheck(intake, intake.intake(), intakeRunningForward), - pitCheck(intake, intake.outtake(), intakeRunningBackward), - pitCheck(intake, intake.rest(), intakeRest))); - SmartDashboard.putData( - "spindexer", - new SequentialCommandGroup(pitCheck(spindexer, spindexer.kick(), spindexerKick))); + Commands.sequence( + pitCheck(intake.intake(), intakeRunningForward), + pitCheck(intake.outtake(), intakeRunningBackward), + pitCheck(intake.rest(), intakeRest))); + // SmartDashboard.putData( + // "spindexer", + // new SequentialCommandGroup(pitCheck(spindexer, spindexer.kick(), spindexerKick))); } - private Command pitCheck(Subsystem subsystem, Command command, BooleanSupplier endstate) { + private Command pitCheck(Command command, BooleanSupplier endstate) { + final boolean[] success = {false}; - return command.until(endstate); + return Commands.sequence( + Commands.runOnce(() -> success[0] = false), + command + .until( + () -> { + if (endstate.getAsBoolean()) { + success[0] = true; + return true; + } + return false; + }) + .withTimeout(2.0), + Commands.runOnce(() -> System.out.println("Pitcheck success: " + success[0]))); } } From 29bd07fc401677069970f829d1e0bdd046238288 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Mon, 16 Feb 2026 11:55:09 -0800 Subject: [PATCH 7/9] eeee --- src/main/java/frc/robot/Robot.java | 5 +---- .../robot/subsystems/intake/LintakeSubsystem.java | 3 +-- src/main/java/frc/robot/utils/pitcheck/Pitcheck.java | 12 +++--------- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 9ae4a3a6..9243a093 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -379,10 +379,7 @@ public Robot() { // the superstructure superstructure = new Superstructure(swerve, indexer, intake, shooter, driver, operator); - if (intake instanceof LintakeSubsystem lintake) { - new frc.robot.utils.pitcheck.Pitcheck(lintake).pitcheck(); -} - autoAimReq = + autoAimReq = driver .leftBumper() .or( diff --git a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java index 479b353c..260076f2 100644 --- a/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/LintakeSubsystem.java @@ -166,7 +166,6 @@ public Command extend() { } public double getRollerVoltage() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getRollerVoltage'"); + return rollerIOInputs.appliedVoltage; } } diff --git a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java index 00a45785..6faf0f27 100644 --- a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java +++ b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java @@ -7,7 +7,6 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import frc.robot.subsystems.intake.LintakeSubsystem; import java.util.function.BooleanSupplier; @@ -20,14 +19,9 @@ public class Pitcheck { () -> intake.getRollerVoltage() > 9.0 && intake.getRollerVoltage() < 11.0; BooleanSupplier intakeRunningBackward = () -> intake.getRollerVoltage() < -9.0 && intake.getRollerVoltage() > -11.0; - BooleanSupplier intakeRest = - () -> (intake.getRollerVoltage()) == 0.0; + BooleanSupplier intakeRest = () -> (intake.getRollerVoltage()) == 0.0; - public Pitcheck(LintakeSubsystem lintake) { - //TODO Auto-generated constructor stub -} - -public void pitcheck() { + public void pitcheck() { SmartDashboard.putData( "intakeRoller", Commands.sequence( @@ -54,6 +48,6 @@ private Command pitCheck(Command command, BooleanSupplier endstate) { return false; }) .withTimeout(2.0), - Commands.runOnce(() -> System.out.println("Pitcheck success: " + success[0]))); + Commands.runOnce(() -> System.out.println("Pitcheck success: " + endstate.getAsBoolean()))); } } From 5b5660a81e08fa8f689cf45fbecb98882c45a893 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Mon, 16 Feb 2026 16:22:33 -0800 Subject: [PATCH 8/9] more quality of life changes --- .../indexer/SpindexerSubsystem.java | 4 ++ .../frc/robot/utils/pitcheck/Pitcheck.java | 45 +++++++++---------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/indexer/SpindexerSubsystem.java b/src/main/java/frc/robot/subsystems/indexer/SpindexerSubsystem.java index 9ab3e2e4..90a2b260 100644 --- a/src/main/java/frc/robot/subsystems/indexer/SpindexerSubsystem.java +++ b/src/main/java/frc/robot/subsystems/indexer/SpindexerSubsystem.java @@ -153,4 +153,8 @@ public Command runRollerSysId() { indexRollerSysid.dynamic(Direction.kForward), indexRollerSysid.dynamic(Direction.kReverse)); } + + public double getRollerVoltage() { + return rollerInputs.appliedVoltage; + } } diff --git a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java index 6faf0f27..996a29c0 100644 --- a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java +++ b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java @@ -4,9 +4,11 @@ package frc.robot.utils.pitcheck; +import edu.wpi.first.math.MathUtil; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.subsystems.indexer.SpindexerSubsystem; import frc.robot.subsystems.intake.LintakeSubsystem; import java.util.function.BooleanSupplier; @@ -14,12 +16,13 @@ public class Pitcheck { LintakeSubsystem intake = new LintakeSubsystem(null, null, null); - // SpindexerSubsystem spindexer = new SpindexerSubsystem(); - BooleanSupplier intakeRunningForward = - () -> intake.getRollerVoltage() > 9.0 && intake.getRollerVoltage() < 11.0; + SpindexerSubsystem spindexer = new SpindexerSubsystem(null, null, null); + BooleanSupplier intakeRunningForward = () -> MathUtil.isNear(7.0, intake.getRollerVoltage(), 1.0); BooleanSupplier intakeRunningBackward = - () -> intake.getRollerVoltage() < -9.0 && intake.getRollerVoltage() > -11.0; - BooleanSupplier intakeRest = () -> (intake.getRollerVoltage()) == 0.0; + () -> MathUtil.isNear(-11.0, intake.getRollerVoltage(), 1.0); + BooleanSupplier intakeRest = () -> MathUtil.isNear(0.0, intake.getRollerVoltage(), 0.5); + BooleanSupplier spindexerRunningForward = + () -> MathUtil.isNear(7.0, spindexer.getRollerVoltage(), 1.0); public void pitcheck() { SmartDashboard.putData( @@ -28,26 +31,22 @@ public void pitcheck() { pitCheck(intake.intake(), intakeRunningForward), pitCheck(intake.outtake(), intakeRunningBackward), pitCheck(intake.rest(), intakeRest))); - // SmartDashboard.putData( - // "spindexer", - // new SequentialCommandGroup(pitCheck(spindexer, spindexer.kick(), spindexerKick))); + SmartDashboard.putData( + "spindexer", Commands.sequence(pitCheck(spindexer.kick(), spindexerRunningForward))); } private Command pitCheck(Command command, BooleanSupplier endstate) { - final boolean[] success = {false}; - - return Commands.sequence( - Commands.runOnce(() -> success[0] = false), - command - .until( - () -> { - if (endstate.getAsBoolean()) { - success[0] = true; - return true; - } - return false; - }) - .withTimeout(2.0), - Commands.runOnce(() -> System.out.println("Pitcheck success: " + endstate.getAsBoolean()))); + + return command + .until( + () -> { + if (endstate.getAsBoolean()) { + + return true; + } + return false; + }) + .withTimeout(2.0) + .andThen(() -> System.out.println("Pitcheck success: " + endstate.getAsBoolean())); } } From a510d16136f43a3c4560951eebad4ea5f59560a7 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Mon, 16 Feb 2026 17:25:46 -0800 Subject: [PATCH 9/9] hopefully works --- src/main/java/frc/robot/Robot.java | 16 +++++++ .../frc/robot/subsystems/indexer/Indexer.java | 2 + .../subsystems/indexer/LindexerSubsystem.java | 4 ++ .../subsystems/intake/FintakeSubsystem.java | 10 ++-- .../frc/robot/subsystems/intake/Intake.java | 2 + .../frc/robot/utils/pitcheck/Pitcheck.java | 48 +++++++++---------- 6 files changed, 53 insertions(+), 29 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 9243a093..636e1361 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -59,6 +59,7 @@ import frc.robot.subsystems.swerve.SwerveSubsystem; import frc.robot.subsystems.swerve.odometry.PhoenixOdometryThread; import frc.robot.utils.CommandXboxControllerSubsystem; +import frc.robot.utils.pitcheck.Pitcheck; import java.util.Optional; import java.util.Set; import org.ironmaple.simulation.SimulatedArena; @@ -509,6 +510,21 @@ public Robot() { .ignoringDisable(true)); SmartDashboard.putData("Add autos", Commands.runOnce(this::addAutos).ignoringDisable(true)); + SmartDashboard.putData( + "intakeRoller", + Commands.sequence( + Pitcheck.pitCheck( + intake.intake(), () -> MathUtil.isNear(7.0, this.intake.getRollerVoltage(), 1.0)), + Pitcheck.pitCheck( + intake.outtake(), + () -> MathUtil.isNear(-11.0, this.intake.getRollerVoltage(), 1.0)), + Pitcheck.pitCheck( + intake.rest(), () -> MathUtil.isNear(0.0, this.intake.getRollerVoltage(), 0.5)))); + SmartDashboard.putData( + "spindexer", + Commands.sequence( + Pitcheck.pitCheck( + indexer.kick(), () -> MathUtil.isNear(7.0, this.indexer.getRollerVoltage(), 1.0)))); // SmartDashboard.putData("Zero hood", shooter.zeroHood().ignoringDisable(true)); // SmartDashboard.putData("Test Shot", shooter.testShoot()); diff --git a/src/main/java/frc/robot/subsystems/indexer/Indexer.java b/src/main/java/frc/robot/subsystems/indexer/Indexer.java index b27c08fa..2a304b7e 100644 --- a/src/main/java/frc/robot/subsystems/indexer/Indexer.java +++ b/src/main/java/frc/robot/subsystems/indexer/Indexer.java @@ -20,4 +20,6 @@ public interface Indexer { /** Not running (set to 0) */ public Command rest(); + + public double getRollerVoltage(); } diff --git a/src/main/java/frc/robot/subsystems/indexer/LindexerSubsystem.java b/src/main/java/frc/robot/subsystems/indexer/LindexerSubsystem.java index c17d8d62..049bce24 100644 --- a/src/main/java/frc/robot/subsystems/indexer/LindexerSubsystem.java +++ b/src/main/java/frc/robot/subsystems/indexer/LindexerSubsystem.java @@ -156,4 +156,8 @@ public Command runRollerSysId() { indexRollerSysid.dynamic(Direction.kForward), indexRollerSysid.dynamic(Direction.kReverse)); } + + public double getRollerVoltage() { + return rollerInputs.appliedVoltage; + } } diff --git a/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java b/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java index 3d3256c3..566c6104 100644 --- a/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/FintakeSubsystem.java @@ -22,7 +22,7 @@ public class FintakeSubsystem extends SubsystemBase implements Intake { public static final double GEAR_RATIO = 2.0; private RollerIO io; - private RollerIOInputsAutoLogged inputs = new RollerIOInputsAutoLogged(); + private RollerIOInputsAutoLogged rollerIOInputs = new RollerIOInputsAutoLogged(); CANrangeIOInputsAutoLogged canrangeInputs = new CANrangeIOInputsAutoLogged(); @@ -45,8 +45,8 @@ public FintakeSubsystem(RollerIO io, CANBus canbus) { @Override public void periodic() { - io.updateInputs(inputs); - Logger.processInputs("Intake", inputs); + io.updateInputs(rollerIOInputs); + Logger.processInputs("Intake", rollerIOInputs); canrangeIO.updateInputs(canrangeInputs); Logger.processInputs("Indexer/First Beambreak", canrangeInputs); @@ -98,4 +98,8 @@ public static TalonFXConfiguration getIntakeConfig() { public boolean beambreak() { return canrangeInputs.isDetected; } + + public double getRollerVoltage() { + return rollerIOInputs.appliedVoltage; + } } diff --git a/src/main/java/frc/robot/subsystems/intake/Intake.java b/src/main/java/frc/robot/subsystems/intake/Intake.java index e193211b..2f91a7fb 100644 --- a/src/main/java/frc/robot/subsystems/intake/Intake.java +++ b/src/main/java/frc/robot/subsystems/intake/Intake.java @@ -19,4 +19,6 @@ public interface Intake { /** for controller rumble */ public boolean beambreak(); + + public double getRollerVoltage(); } diff --git a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java index 996a29c0..9f34c1a6 100644 --- a/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java +++ b/src/main/java/frc/robot/utils/pitcheck/Pitcheck.java @@ -4,38 +4,34 @@ package frc.robot.utils.pitcheck; -import edu.wpi.first.math.MathUtil; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import frc.robot.subsystems.indexer.SpindexerSubsystem; -import frc.robot.subsystems.intake.LintakeSubsystem; import java.util.function.BooleanSupplier; /** Add your docs here. */ public class Pitcheck { - LintakeSubsystem intake = new LintakeSubsystem(null, null, null); - SpindexerSubsystem spindexer = new SpindexerSubsystem(null, null, null); - BooleanSupplier intakeRunningForward = () -> MathUtil.isNear(7.0, intake.getRollerVoltage(), 1.0); - BooleanSupplier intakeRunningBackward = - () -> MathUtil.isNear(-11.0, intake.getRollerVoltage(), 1.0); - BooleanSupplier intakeRest = () -> MathUtil.isNear(0.0, intake.getRollerVoltage(), 0.5); - BooleanSupplier spindexerRunningForward = - () -> MathUtil.isNear(7.0, spindexer.getRollerVoltage(), 1.0); - - public void pitcheck() { - SmartDashboard.putData( - "intakeRoller", - Commands.sequence( - pitCheck(intake.intake(), intakeRunningForward), - pitCheck(intake.outtake(), intakeRunningBackward), - pitCheck(intake.rest(), intakeRest))); - SmartDashboard.putData( - "spindexer", Commands.sequence(pitCheck(spindexer.kick(), spindexerRunningForward))); - } - - private Command pitCheck(Command command, BooleanSupplier endstate) { + // LintakeSubsystem intake = new LintakeSubsystem(null, null, null); + // SpindexerSubsystem spindexer = new SpindexerSubsystem(null, null, null); + // BooleanSupplier intakeRunningForward = () -> MathUtil.isNear(7.0, intake.getRollerVoltage(), + // 1.0); + // BooleanSupplier intakeRunningBackward = + // () -> MathUtil.isNear(-11.0, intake.getRollerVoltage(), 1.0); + // BooleanSupplier intakeRest = () -> MathUtil.isNear(0.0, intake.getRollerVoltage(), 0.5); + // BooleanSupplier spindexerRunningForward = + // () -> MathUtil.isNear(7.0, spindexer.getRollerVoltage(), 1.0); + + // public void pitcheck() { + // SmartDashboard.putData( + // "intakeRoller", + // Commands.sequence( + // pitCheck(intake.intake(), intakeRunningForward), + // pitCheck(intake.outtake(), intakeRunningBackward), + // pitCheck(intake.rest(), intakeRest))); + // SmartDashboard.putData( + // "spindexer", Commands.sequence(pitCheck(spindexer.kick(), spindexerRunningForward))); + // } + + public static Command pitCheck(Command command, BooleanSupplier endstate) { return command .until(