From 88aea5ac141ca5eb87f437f1328d0383c4c72b01 Mon Sep 17 00:00:00 2001 From: Greydman25 Date: Fri, 27 Feb 2026 09:28:49 -0500 Subject: [PATCH] Started work on subsystems --- .../frc/robot/subsystems/DriveSubsystem.java | 2 +- .../frc/robot/subsystems/HopperSubsystem.java | 61 +++++++++++++ .../frc/robot/subsystems/IntakeSubsystem.java | 86 +++++++++++++++++++ .../robot/subsystems/ShooterSubsystem.java | 61 +++++++++++++ 4 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 src/main/java/frc/robot/subsystems/HopperSubsystem.java create mode 100644 src/main/java/frc/robot/subsystems/IntakeSubsystem.java create mode 100644 src/main/java/frc/robot/subsystems/ShooterSubsystem.java diff --git a/src/main/java/frc/robot/subsystems/DriveSubsystem.java b/src/main/java/frc/robot/subsystems/DriveSubsystem.java index d93b7d8..b4cef30 100644 --- a/src/main/java/frc/robot/subsystems/DriveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/DriveSubsystem.java @@ -48,7 +48,7 @@ public class DriveSubsystem extends TestableSubsystem { .withSteerKI(steerI) .withSteerKD(steerD) .withSteerKV(steerKV) - .withSteerOffset(0.359375) + .withSteerOffset(1.752197) .withSteerEncoderId(10) .withModuleLocation(new Translation2d(1, 1)) .withModuleName("Front Left") diff --git a/src/main/java/frc/robot/subsystems/HopperSubsystem.java b/src/main/java/frc/robot/subsystems/HopperSubsystem.java new file mode 100644 index 0000000..744368c --- /dev/null +++ b/src/main/java/frc/robot/subsystems/HopperSubsystem.java @@ -0,0 +1,61 @@ +// 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 HopperSubsystem extends TestableSubsystem { + + /** Creates a new ExampleSubsystem. */ + public HopperSubsystem() {} + + /** + * 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/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java new file mode 100644 index 0000000..d679e62 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -0,0 +1,86 @@ +// 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 com.ctre.phoenix6.hardware.TalonFX; + +import static org.fairportrobotics.frc.posty.assertions.Assertions.*; + +import edu.wpi.first.wpilibj.DigitalInput; +import edu.wpi.first.wpilibj.DigitalOutput; +import edu.wpi.first.wpilibj2.command.Command; + +public class IntakeSubsystem extends TestableSubsystem { + /** Creates a new ExampleSubsystem. */ + public IntakeSubsystem() {} + DigitalOutput LinearActuator = new DigitalOutput(0); + boolean deployed = false; + TalonFX rollers = new TalonFX(0); + + /** + * 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 + } + + public void intake(int value) + { + + } + + public void actuatorToggle() + { + + LinearActuator.set(!deployed); + deployed = !deployed; + + } + + public boolean getDeployed() + { + return deployed; + } + + @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/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java new file mode 100644 index 0000000..32feddd --- /dev/null +++ b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java @@ -0,0 +1,61 @@ +// 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 ShooterSubsystem extends TestableSubsystem { + + /** Creates a new ExampleSubsystem. */ + public ShooterSubsystem() {} + + /** + * 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"); + } +}