From 6830d29eb3ce1f9fc451c080dfed3d658db39404 Mon Sep 17 00:00:00 2001 From: TheRealGrayden Date: Thu, 5 Mar 2026 20:25:48 -0500 Subject: [PATCH 1/2] Hi Ray :) --- src/main/java/frc/robot/Constants.java | 6 ++ .../subsystems/ExampleSubsystem copy.java | 60 +++++++++++++++++++ .../frc/robot/subsystems/HopperSubsystem.java | 19 +++--- 3 files changed, 73 insertions(+), 12 deletions(-) create mode 100644 src/main/java/frc/robot/subsystems/ExampleSubsystem copy.java diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 16168d8..8d901c6 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -4,6 +4,8 @@ package frc.robot; +import java.security.PublicKey; + /** * The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean * constants. This class should not be used for any other purpose. All constants should be declared @@ -66,4 +68,8 @@ public final class Constants { public static final int INTAKE_MOTOR_ID = 2; } + public static class HopperConstants { + public static final int KICKER_MOTOR_ID = 0; + public static final int SPINDEXER_MOTOR_ID = 1; + } } diff --git a/src/main/java/frc/robot/subsystems/ExampleSubsystem copy.java b/src/main/java/frc/robot/subsystems/ExampleSubsystem copy.java new file mode 100644 index 0000000..07e3657 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/ExampleSubsystem copy.java @@ -0,0 +1,60 @@ +// 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.subsystems; + +import org.fairportrobotics.frc.posty.TestableSubsystem; +import org.fairportrobotics.frc.posty.test.PostTest; +import static org.fairportrobotics.frc.posty.assertions.Assertions.*; + +import edu.wpi.first.wpilibj2.command.Command; + +public class ExampleSubsystem extends TestableSubsystem { + /** Creates a new ExampleSubsystem. */ + public ExampleSubsystem() {} + + /** + * Example command factory method. + * + * @return a command + */ + public Command exampleMethodCommand() { + // Inline construction of command goes here. + // Subsystem::RunOnce implicitly requires `this` subsystem. + return runOnce( + () -> { + /* one-time action goes here */ + }); + } + + /** + * An example method querying a boolean state of the subsystem (for example, a digital sensor). + * + * @return value of some boolean subsystem state, such as a digital sensor. + */ + public boolean exampleCondition() { + // Query some boolean state, such as a digital sensor. + return false; + } + + @Override + public void periodic() { + // This method will be called once per scheduler run + } + + @Override + public void simulationPeriodic() { + // This method will be called once per scheduler run during simulation + } + + @PostTest(name = "A friendly name", enabled = true) + public void myFailingPostTest(){ + assertThat(true).isFalse(); + } + + @PostTest(enabled = true) + public void myPassingPostTest(){ + assertThat("Hello World").endWith("World"); + } +} diff --git a/src/main/java/frc/robot/subsystems/HopperSubsystem.java b/src/main/java/frc/robot/subsystems/HopperSubsystem.java index bd36015..8dfe649 100644 --- a/src/main/java/frc/robot/subsystems/HopperSubsystem.java +++ b/src/main/java/frc/robot/subsystems/HopperSubsystem.java @@ -10,7 +10,7 @@ import org.fairportrobotics.frc.posty.test.PostTest; import com.ctre.phoenix6.hardware.TalonFX; import static org.fairportrobotics.frc.posty.assertions.Assertions.*; - +import frc.robot.Constants; import edu.wpi.first.wpilibj2.command.Command; public class HopperSubsystem extends TestableSubsystem { @@ -19,28 +19,23 @@ public class HopperSubsystem extends TestableSubsystem { private TalonFX kickerMotor; /** Creates a new HopperSubsystem. */ public HopperSubsystem() { - spindexerMotor = new TalonFX(0); - kickerMotor = new TalonFX(1); + spindexerMotor = new TalonFX(Constants.HopperConstants.SPINDEXER_MOTOR_ID); + kickerMotor = new TalonFX(Constants.HopperConstants.KICKER_MOTOR_ID); } - public void feed(){ - + public void feed() { kickerMotor.set(0.5); } - public void reverse(){ - + public void reverse() { kickerMotor.set(-0.5); - } - public void stop(){ - + public void stop() { kickerMotor.set(0); } - public void spin(double speed){ - + public void spin(double speed) { spindexerMotor.set(speed); } From 42c581957e7aafc7552b059dbe3da9460d9bbe69 Mon Sep 17 00:00:00 2001 From: TheRealGrayden Date: Thu, 5 Mar 2026 20:28:48 -0500 Subject: [PATCH 2/2] Ok it builds --- .../subsystems/ExampleSubsystem copy.java | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 src/main/java/frc/robot/subsystems/ExampleSubsystem copy.java diff --git a/src/main/java/frc/robot/subsystems/ExampleSubsystem copy.java b/src/main/java/frc/robot/subsystems/ExampleSubsystem copy.java deleted file mode 100644 index 07e3657..0000000 --- a/src/main/java/frc/robot/subsystems/ExampleSubsystem copy.java +++ /dev/null @@ -1,60 +0,0 @@ -// 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.subsystems; - -import org.fairportrobotics.frc.posty.TestableSubsystem; -import org.fairportrobotics.frc.posty.test.PostTest; -import static org.fairportrobotics.frc.posty.assertions.Assertions.*; - -import edu.wpi.first.wpilibj2.command.Command; - -public class ExampleSubsystem extends TestableSubsystem { - /** Creates a new ExampleSubsystem. */ - public ExampleSubsystem() {} - - /** - * Example command factory method. - * - * @return a command - */ - public Command exampleMethodCommand() { - // Inline construction of command goes here. - // Subsystem::RunOnce implicitly requires `this` subsystem. - return runOnce( - () -> { - /* one-time action goes here */ - }); - } - - /** - * An example method querying a boolean state of the subsystem (for example, a digital sensor). - * - * @return value of some boolean subsystem state, such as a digital sensor. - */ - public boolean exampleCondition() { - // Query some boolean state, such as a digital sensor. - return false; - } - - @Override - public void periodic() { - // This method will be called once per scheduler run - } - - @Override - public void simulationPeriodic() { - // This method will be called once per scheduler run during simulation - } - - @PostTest(name = "A friendly name", enabled = true) - public void myFailingPostTest(){ - assertThat(true).isFalse(); - } - - @PostTest(enabled = true) - public void myPassingPostTest(){ - assertThat("Hello World").endWith("World"); - } -}