From 26f5143840a4fc94482cd0eff98d25529a673da8 Mon Sep 17 00:00:00 2001 From: lQuasar9206 Date: Sun, 25 Jan 2026 15:51:47 -0800 Subject: [PATCH 1/3] 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 54cd82c..0c55a26 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 b4dcfd1..f1e7791 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 9a6196f..13b4128 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 a400db1..8875291 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 f0b3051..a159762 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/3] 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 0000000..73e4dbc --- /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/3] 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 0c55a26..3383376 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 f1e7791..e0693a6 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 13b4128..1aa57a2 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 8875291..52ccb3e 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 73e4dbc..d5057cc 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); + } +}