From b6b8b72603c608183d6704f5ecc4dace982026f6 Mon Sep 17 00:00:00 2001 From: joshuaharding2 Date: Tue, 20 Jan 2026 15:48:07 -0500 Subject: [PATCH 01/26] Add basic subsystem folders --- src/main/java/frc/robot/subsystems/climb/Climb.java | 0 src/main/java/frc/robot/subsystems/indexer/Indexer.java | 5 +++++ 2 files changed, 5 insertions(+) create mode 100644 src/main/java/frc/robot/subsystems/climb/Climb.java create mode 100644 src/main/java/frc/robot/subsystems/indexer/Indexer.java diff --git a/src/main/java/frc/robot/subsystems/climb/Climb.java b/src/main/java/frc/robot/subsystems/climb/Climb.java new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/frc/robot/subsystems/indexer/Indexer.java b/src/main/java/frc/robot/subsystems/indexer/Indexer.java new file mode 100644 index 0000000..c97d4f3 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/indexer/Indexer.java @@ -0,0 +1,5 @@ +package frc.robot.subsystems.indexer; + +public class Indexer { + +} From d95209bb618e6e3b379c871cdf307d6a8494aa46 Mon Sep 17 00:00:00 2001 From: joshuaharding2 Date: Wed, 21 Jan 2026 07:56:24 -0500 Subject: [PATCH 02/26] Started programming flywheel subsystem --- .../frc/robot/subsystems/climb/Climb.java | 5 +++ .../robot/subsystems/flywheel/Flywheel.java | 3 ++ .../robot/subsystems/flywheel/FlywheelIO.java | 15 +++++++ .../subsystems/flywheel/FlywheelIOSim.java | 0 vendordeps/AdvantageKit.json | 35 +++++++++++++++ vendordeps/ChoreoLib2026.json | 44 +++++++++++++++++++ vendordeps/PathplannerLib-2026.1.2.json | 38 ++++++++++++++++ 7 files changed, 140 insertions(+) create mode 100644 src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java create mode 100644 src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java create mode 100644 vendordeps/AdvantageKit.json create mode 100644 vendordeps/ChoreoLib2026.json create mode 100644 vendordeps/PathplannerLib-2026.1.2.json diff --git a/src/main/java/frc/robot/subsystems/climb/Climb.java b/src/main/java/frc/robot/subsystems/climb/Climb.java index e69de29..04d2ba8 100644 --- a/src/main/java/frc/robot/subsystems/climb/Climb.java +++ b/src/main/java/frc/robot/subsystems/climb/Climb.java @@ -0,0 +1,5 @@ +package frc.robot.subsystems.climb; + +public class Climb { + +} diff --git a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java index 417ab9e..fc656ae 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java +++ b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java @@ -1,5 +1,8 @@ package frc.robot.subsystems.flywheel; public class Flywheel { + public static final double RPM_TO_TANGENTIAL_CONVERSION = 4.655E-03; + public static final double TANGENTIAL_TO_RPM_CONVERSION = 2.148E02; + } diff --git a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java new file mode 100644 index 0000000..52a2cfb --- /dev/null +++ b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java @@ -0,0 +1,15 @@ +package frc.robot.subsystems.flywheel; +import org.littletonrobotics.junction.AutoLog; + +public interface FlywheelIO { + + @AutoLog + public static class FlywheelIOInputs { + public double flywheelRPM = 0.0; + public double appliedVolts = 0.0; + public double appliedAmps = 0.0; + } + public default void updateInputs(FlywheelIOInputs inputs) {} + + public default void setVoltage(double volts) {} +} diff --git a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java new file mode 100644 index 0000000..e69de29 diff --git a/vendordeps/AdvantageKit.json b/vendordeps/AdvantageKit.json new file mode 100644 index 0000000..162ad66 --- /dev/null +++ b/vendordeps/AdvantageKit.json @@ -0,0 +1,35 @@ +{ + "fileName": "AdvantageKit.json", + "name": "AdvantageKit", + "version": "26.0.0", + "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", + "frcYear": "2026", + "mavenUrls": [ + "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" + ], + "jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json", + "javaDependencies": [ + { + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-java", + "version": "26.0.0" + } + ], + "jniDependencies": [ + { + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-wpilibio", + "version": "26.0.0", + "skipInvalidPlatforms": false, + "isJar": false, + "validPlatforms": [ + "linuxathena", + "linuxx86-64", + "linuxarm64", + "osxuniversal", + "windowsx86-64" + ] + } + ], + "cppDependencies": [] +} \ No newline at end of file diff --git a/vendordeps/ChoreoLib2026.json b/vendordeps/ChoreoLib2026.json new file mode 100644 index 0000000..322c9e2 --- /dev/null +++ b/vendordeps/ChoreoLib2026.json @@ -0,0 +1,44 @@ +{ + "fileName": "ChoreoLib2026.json", + "name": "ChoreoLib", + "version": "2026.0.1", + "uuid": "b5e23f0a-dac9-4ad2-8dd6-02767c520aca", + "frcYear": "2026", + "mavenUrls": [ + "https://frcmaven.wpi.edu/artifactory/sleipnirgroup-mvn-release/", + "https://repo1.maven.org/maven2" + ], + "jsonUrl": "https://choreo.autos/lib/ChoreoLib2026.json", + "javaDependencies": [ + { + "groupId": "choreo", + "artifactId": "ChoreoLib-java", + "version": "2026.0.1" + }, + { + "groupId": "com.google.code.gson", + "artifactId": "gson", + "version": "2.11.0" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "choreo", + "artifactId": "ChoreoLib-cpp", + "version": "2026.0.1", + "libName": "ChoreoLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxuniversal", + "linuxathena", + "linuxarm32", + "linuxarm64" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/PathplannerLib-2026.1.2.json b/vendordeps/PathplannerLib-2026.1.2.json new file mode 100644 index 0000000..f72fa41 --- /dev/null +++ b/vendordeps/PathplannerLib-2026.1.2.json @@ -0,0 +1,38 @@ +{ + "fileName": "PathplannerLib-2026.1.2.json", + "name": "PathplannerLib", + "version": "2026.1.2", + "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", + "frcYear": "2026", + "mavenUrls": [ + "https://3015rangerrobotics.github.io/pathplannerlib/repo" + ], + "jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json", + "javaDependencies": [ + { + "groupId": "com.pathplanner.lib", + "artifactId": "PathplannerLib-java", + "version": "2026.1.2" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "com.pathplanner.lib", + "artifactId": "PathplannerLib-cpp", + "version": "2026.1.2", + "libName": "PathplannerLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxuniversal", + "linuxathena", + "linuxarm32", + "linuxarm64" + ] + } + ] +} \ No newline at end of file From 238ebdf09a438e27cdfa9f0f018ea05d4897d9c4 Mon Sep 17 00:00:00 2001 From: joshuaharding2 Date: Thu, 22 Jan 2026 17:35:35 -0500 Subject: [PATCH 03/26] Flywheel subsystem simulation --- simgui-ds.json | 92 +++++++++++++++++++ src/main/java/frc/robot/Robot.java | 14 ++- .../robot/subsystems/flywheel/Flywheel.java | 25 ++++- .../robot/subsystems/flywheel/FlywheelIO.java | 5 +- .../subsystems/flywheel/FlywheelIOSim.java | 43 +++++++++ 5 files changed, 170 insertions(+), 9 deletions(-) create mode 100644 simgui-ds.json diff --git a/simgui-ds.json b/simgui-ds.json new file mode 100644 index 0000000..73cc713 --- /dev/null +++ b/simgui-ds.json @@ -0,0 +1,92 @@ +{ + "keyboardJoysticks": [ + { + "axisConfig": [ + { + "decKey": 65, + "incKey": 68 + }, + { + "decKey": 87, + "incKey": 83 + }, + { + "decKey": 69, + "decayRate": 0.0, + "incKey": 82, + "keyRate": 0.009999999776482582 + } + ], + "axisCount": 3, + "buttonCount": 4, + "buttonKeys": [ + 90, + 88, + 67, + 86 + ], + "povConfig": [ + { + "key0": 328, + "key135": 323, + "key180": 322, + "key225": 321, + "key270": 324, + "key315": 327, + "key45": 329, + "key90": 326 + } + ], + "povCount": 1 + }, + { + "axisConfig": [ + { + "decKey": 74, + "incKey": 76 + }, + { + "decKey": 73, + "incKey": 75 + } + ], + "axisCount": 2, + "buttonCount": 4, + "buttonKeys": [ + 77, + 44, + 46, + 47 + ], + "povCount": 0 + }, + { + "axisConfig": [ + { + "decKey": 263, + "incKey": 262 + }, + { + "decKey": 265, + "incKey": 264 + } + ], + "axisCount": 2, + "buttonCount": 6, + "buttonKeys": [ + 260, + 268, + 266, + 261, + 269, + 267 + ], + "povCount": 0 + }, + { + "axisCount": 0, + "buttonCount": 0, + "povCount": 0 + } + ] +} diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index efbb977..01fff3d 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -8,6 +8,9 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; +import frc.robot.subsystems.flywheel.Flywheel; +import frc.robot.subsystems.flywheel.FlywheelIOSim; + /** * The methods in this class are called automatically corresponding to each mode, as described in * the TimedRobot documentation. If you change the name of this class or the package after creating @@ -19,6 +22,8 @@ public class Robot extends TimedRobot { private String m_autoSelected; private final SendableChooser m_chooser = new SendableChooser<>(); + private final Flywheel flywheel = new Flywheel(new FlywheelIOSim()); + /** * This function is run when the robot is first started up and should be used for any * initialization code. @@ -37,7 +42,9 @@ public Robot() { * SmartDashboard integrated updating. */ @Override - public void robotPeriodic() {} + public void robotPeriodic() { + flywheel.periodic(); + } /** * This autonomous (along with the chooser code above) shows how to select between different @@ -76,7 +83,10 @@ public void teleopInit() {} /** This function is called periodically during operator control. */ @Override - public void teleopPeriodic() {} + public void teleopPeriodic() { + flywheel.runAtVoltage(6.0); // Example voltage + System.out.println("Flywheel RPM: " + flywheel.getRPM()); + } /** This function is called once when the robot is disabled. */ @Override diff --git a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java index fc656ae..a92a8f8 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java +++ b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java @@ -1,8 +1,25 @@ package frc.robot.subsystems.flywheel; +import edu.wpi.first.wpilibj2.command.SubsystemBase; -public class Flywheel { - public static final double RPM_TO_TANGENTIAL_CONVERSION = 4.655E-03; - public static final double TANGENTIAL_TO_RPM_CONVERSION = 2.148E02; +public class Flywheel extends SubsystemBase { + private final FlywheelIO io; + private final FlywheelIO.FlywheelIOInputs inputs = new FlywheelIO.FlywheelIOInputs(); - + public Flywheel(FlywheelIO io) { + this.io = io; + } + + @Override + public void periodic() { + io.updateInputs(inputs); + } + + public void runAtVoltage(double volts) { + io.setVoltage(volts); + } + + public double getRPM() { + return inputs.velocityRPM; + } } + diff --git a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java index 52a2cfb..58a186c 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java +++ b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java @@ -5,11 +5,10 @@ public interface FlywheelIO { @AutoLog public static class FlywheelIOInputs { - public double flywheelRPM = 0.0; + public double velocityRPM = 0.0; public double appliedVolts = 0.0; - public double appliedAmps = 0.0; } - public default void updateInputs(FlywheelIOInputs inputs) {} + public default void updateInputs(FlywheelIOInputs inputs) {} public default void setVoltage(double volts) {} } diff --git a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java index e69de29..85a79a2 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java +++ b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java @@ -0,0 +1,43 @@ +package frc.robot.subsystems.flywheel; + +import edu.wpi.first.wpilibj.simulation.FlywheelSim; +import edu.wpi.first.math.system.LinearSystem; +import edu.wpi.first.math.system.plant.LinearSystemId; +import edu.wpi.first.math.system.plant.DCMotor; +import edu.wpi.first.math.numbers.N1; +import edu.wpi.first.math.util.Units; + +public class FlywheelIOSim implements FlywheelIO { + + private static final LinearSystem flywheelPlant = + LinearSystemId.createFlywheelSystem( + DCMotor.getNEO(1), + 0.001, + 1.0 + ); + + private final FlywheelSim sim = + new FlywheelSim( + flywheelPlant, + DCMotor.getNEO(1), + 0.0 + ); + + private double appliedVolts = 0.0; + + @Override + public void setVoltage(double volts) { + appliedVolts = volts; + } + + @Override + public void updateInputs(FlywheelIOInputs inputs) { + sim.setInputVoltage(appliedVolts); + sim.update(0.02); + + inputs.velocityRPM = + Units.radiansPerSecondToRotationsPerMinute(sim.getAngularVelocityRadPerSec()); + + inputs.appliedVolts = appliedVolts; + } +} From aa75d97e8bb484f4c93bb8f3bd717970f9382c05 Mon Sep 17 00:00:00 2001 From: joshuaharding2 Date: Sat, 24 Jan 2026 09:51:51 -0500 Subject: [PATCH 04/26] Flywheel subsystemformatting and motor adjustment --- .../java/frc/robot/subsystems/flywheel/Flywheel.java | 2 +- .../frc/robot/subsystems/flywheel/FlywheelIO.java | 2 ++ .../frc/robot/subsystems/flywheel/FlywheelIOSim.java | 11 +++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java index a92a8f8..30b092c 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java +++ b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java @@ -1,4 +1,5 @@ package frc.robot.subsystems.flywheel; + import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Flywheel extends SubsystemBase { @@ -22,4 +23,3 @@ public double getRPM() { return inputs.velocityRPM; } } - diff --git a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java index 58a186c..49cebb1 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java +++ b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java @@ -1,4 +1,5 @@ package frc.robot.subsystems.flywheel; + import org.littletonrobotics.junction.AutoLog; public interface FlywheelIO { @@ -10,5 +11,6 @@ public static class FlywheelIOInputs { } public default void updateInputs(FlywheelIOInputs inputs) {} + public default void setVoltage(double volts) {} } diff --git a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java index 85a79a2..6213d4a 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java +++ b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java @@ -9,17 +9,17 @@ public class FlywheelIOSim implements FlywheelIO { - private static final LinearSystem flywheelPlant = + private static final LinearSystem flywheelPlant = LinearSystemId.createFlywheelSystem( - DCMotor.getNEO(1), + DCMotor.getNeoVortex(2), 0.001, 1.0 ); - private final FlywheelSim sim = + private final FlywheelSim sim = new FlywheelSim( flywheelPlant, - DCMotor.getNEO(1), + DCMotor.getNeoVortex(2), 0.0 ); @@ -35,8 +35,7 @@ public void updateInputs(FlywheelIOInputs inputs) { sim.setInputVoltage(appliedVolts); sim.update(0.02); - inputs.velocityRPM = - Units.radiansPerSecondToRotationsPerMinute(sim.getAngularVelocityRadPerSec()); + inputs.velocityRPM = Units.radiansPerSecondToRotationsPerMinute(sim.getAngularVelocityRadPerSec()); inputs.appliedVolts = appliedVolts; } From 4c141231607a9e7b1b1031efe907c4e695730d62 Mon Sep 17 00:00:00 2001 From: joshuaharding2 Date: Sat, 24 Jan 2026 11:21:50 -0500 Subject: [PATCH 05/26] Hood subsystem simulation almost working --- src/main/java/frc/robot/Robot.java | 105 +++++++++++------- .../java/frc/robot/subsystems/hood/Hood.java | 28 ++++- .../frc/robot/subsystems/hood/HoodIO.java | 16 +++ .../frc/robot/subsystems/hood/HoodIOSim.java | 43 +++++++ 4 files changed, 151 insertions(+), 41 deletions(-) create mode 100644 src/main/java/frc/robot/subsystems/hood/HoodIO.java create mode 100644 src/main/java/frc/robot/subsystems/hood/HoodIOSim.java diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 01fff3d..d88e071 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -5,15 +5,23 @@ package frc.robot; import edu.wpi.first.wpilibj.TimedRobot; +import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import frc.robot.subsystems.flywheel.Flywheel; +import frc.robot.subsystems.flywheel.FlywheelIO; import frc.robot.subsystems.flywheel.FlywheelIOSim; +import frc.robot.subsystems.hood.Hood; +import frc.robot.subsystems.hood.HoodIO; +import frc.robot.subsystems.hood.HoodIOSim; + /** - * The methods in this class are called automatically corresponding to each mode, as described in - * the TimedRobot documentation. If you change the name of this class or the package after creating + * The methods in this class are called automatically corresponding to each + * mode, as described in + * the TimedRobot documentation. If you change the name of this class or the + * package after creating * this project, you must also update the Main.java file in the project. */ public class Robot extends TimedRobot { @@ -22,40 +30,69 @@ public class Robot extends TimedRobot { private String m_autoSelected; private final SendableChooser m_chooser = new SendableChooser<>(); - private final Flywheel flywheel = new Flywheel(new FlywheelIOSim()); + private Flywheel flywheel; + private Hood hood; /** - * This function is run when the robot is first started up and should be used for any + * This function is run when the robot is first started up and should be used + * for any * initialization code. */ public Robot() { m_chooser.setDefaultOption("Default Auto", kDefaultAuto); m_chooser.addOption("My Auto", kCustomAuto); SmartDashboard.putData("Auto choices", m_chooser); + + // Choose IO implementations based on environment + if (RobotBase.isSimulation()) { + flywheel = new Flywheel(new FlywheelIOSim()); + hood = new Hood(new HoodIOSim()); + } else { + // Real hardware versions later + flywheel = new Flywheel(new FlywheelIO() { + }); + hood = new Hood(new HoodIO() { + }); + } } /** - * This function is called every 20 ms, no matter the mode. Use this for items like diagnostics + * This function is called every 20 ms, no matter the mode. Use this for items + * like diagnostics * that you want ran during disabled, autonomous, teleoperated and test. * - *

This runs after the mode specific periodic functions, but before LiveWindow and + *

+ * This runs after the mode specific periodic functions, but before LiveWindow + * and * SmartDashboard integrated updating. */ @Override public void robotPeriodic() { flywheel.periodic(); + hood.periodic(); + + SmartDashboard.putNumber("Flywheel RPM", flywheel.getRPM()); + SmartDashboard.putNumber("Hood Angle (deg)", hood.getAngleDegrees()); } /** - * This autonomous (along with the chooser code above) shows how to select between different - * autonomous modes using the dashboard. The sendable chooser code works with the Java - * SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the chooser code and - * uncomment the getString line to get the auto name from the text box below the Gyro + * This autonomous (along with the chooser code above) shows how to select + * between different + * autonomous modes using the dashboard. The sendable chooser code works with + * the Java + * SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the + * chooser code and + * uncomment the getString line to get the auto name from the text box below the + * Gyro * - *

You can add additional auto modes by adding additional comparisons to the switch structure - * below with additional strings. If using the SendableChooser make sure to add them to the + *

+ * You can add additional auto modes by adding additional comparisons to the + * switch structure + * below with additional strings. If using the SendableChooser make sure to add + * them to the * chooser code above as well. */ + @Override public void autonomousInit() { m_autoSelected = m_chooser.getSelected(); @@ -63,52 +100,42 @@ public void autonomousInit() { System.out.println("Auto selected: " + m_autoSelected); } - /** This function is called periodically during autonomous. */ @Override public void autonomousPeriodic() { - switch (m_autoSelected) { - case kCustomAuto: - // Put custom auto code here - break; - case kDefaultAuto: - default: - // Put default auto code here - break; - } } - /** This function is called once when teleop is enabled. */ @Override - public void teleopInit() {} + public void teleopInit() { + } - /** This function is called periodically during operator control. */ @Override public void teleopPeriodic() { - flywheel.runAtVoltage(6.0); // Example voltage - System.out.println("Flywheel RPM: " + flywheel.getRPM()); } - /** This function is called once when the robot is disabled. */ @Override - public void disabledInit() {} + public void disabledInit() { + } - /** This function is called periodically when disabled. */ @Override - public void disabledPeriodic() {} + public void disabledPeriodic() { + } - /** This function is called once when test mode is enabled. */ @Override - public void testInit() {} + public void testInit() { + } - /** This function is called periodically during test mode. */ @Override - public void testPeriodic() {} + public void testPeriodic() { + } - /** This function is called once when the robot is first started up. */ @Override - public void simulationInit() {} + public void simulationInit() { + } - /** This function is called periodically whilst in simulation. */ @Override - public void simulationPeriodic() {} + public void simulationPeriodic() { + // Drive subsystems in sim + flywheel.runAtVoltage(6.0); + hood.setVoltage(2.5); // gentle upward motion + } } diff --git a/src/main/java/frc/robot/subsystems/hood/Hood.java b/src/main/java/frc/robot/subsystems/hood/Hood.java index 1bd18a2..ab6018b 100644 --- a/src/main/java/frc/robot/subsystems/hood/Hood.java +++ b/src/main/java/frc/robot/subsystems/hood/Hood.java @@ -1,5 +1,29 @@ package frc.robot.subsystems.hood; -public class Hood { - +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Hood extends SubsystemBase { + private final HoodIO io; + private final HoodIO.HoodIOInputs inputs = new HoodIO.HoodIOInputs(); + + public Hood(HoodIO io) { + this.io = io; + } + + @Override + public void periodic() { + io.updateInputs(inputs); + } + + public void setVoltage(double volts) { + io.setVoltage(volts); + } + + public double getAngleDegrees() { + return inputs.angleDeg; + } + + public double getVelocityDegPerSec() { + return inputs.velocityDegPerSec; + } } diff --git a/src/main/java/frc/robot/subsystems/hood/HoodIO.java b/src/main/java/frc/robot/subsystems/hood/HoodIO.java new file mode 100644 index 0000000..a9e05af --- /dev/null +++ b/src/main/java/frc/robot/subsystems/hood/HoodIO.java @@ -0,0 +1,16 @@ +package frc.robot.subsystems.hood; + +import org.littletonrobotics.junction.AutoLog; + +public interface HoodIO { + + @AutoLog + public static class HoodIOInputs { + public double angleDeg = 0.0; + public double velocityDegPerSec = 0.0; + public double appliedVolts = 0.0; + } + + default void updateInputs(HoodIOInputs inputs) {} + default void setVoltage(double volts) {} +} diff --git a/src/main/java/frc/robot/subsystems/hood/HoodIOSim.java b/src/main/java/frc/robot/subsystems/hood/HoodIOSim.java new file mode 100644 index 0000000..adc50b8 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/hood/HoodIOSim.java @@ -0,0 +1,43 @@ +package frc.robot.subsystems.hood; + +import edu.wpi.first.wpilibj.simulation.SingleJointedArmSim; +import edu.wpi.first.math.system.plant.DCMotor; +import edu.wpi.first.math.util.Units; + +public class HoodIOSim implements HoodIO { + + private static final double kGearRatio = 100.0; + private static final double kArmLengthMeters = 0.3; + private static final double kArmMassKg = 2.0; + + private final SingleJointedArmSim sim = + new SingleJointedArmSim( + DCMotor.getNeo550(1), + kGearRatio, + SingleJointedArmSim.estimateMOI(kArmLengthMeters, kArmMassKg), + kArmLengthMeters, + Units.degreesToRadians(10), // min angle + Units.degreesToRadians(45), // max angle + true, // simulate gravity + Units.degreesToRadians(10) // initial angle + ); + + private double appliedVolts = 0.0; + + @Override + public void setVoltage(double volts) { + appliedVolts = volts; + } + + @Override + public void updateInputs(HoodIOInputs inputs) { + sim.setInputVoltage(appliedVolts); + sim.update(0.02); + + inputs.angleDeg = Units.radiansToDegrees(sim.getAngleRads()); + + inputs.velocityDegPerSec = Units.radiansToDegrees(sim.getVelocityRadPerSec()); + + inputs.appliedVolts = appliedVolts; + } +} From f80b20845da6fcfa6e8ff16059fcef39b44061e4 Mon Sep 17 00:00:00 2001 From: codperson-cyber Date: Sat, 24 Jan 2026 11:42:09 -0500 Subject: [PATCH 06/26] indexer base files made --- build.gradle | 8 ++++ src/main/java/frc/robot/Robot.java | 7 +++ .../frc/robot/subsystems/indexer/Indexer.java | 35 ++++++++++++++- .../robot/subsystems/indexer/IndexerIO.java | 29 ++++++++++++ .../subsystems/indexer/IndexerIOSim.java | 45 +++++++++++++++++++ .../indexer/IndexerIOSparkFlex.java | 5 +++ 6 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 src/main/java/frc/robot/subsystems/indexer/IndexerIO.java create mode 100644 src/main/java/frc/robot/subsystems/indexer/IndexerIOSim.java create mode 100644 src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java diff --git a/build.gradle b/build.gradle index e9b0020..1ba0b4c 100644 --- a/build.gradle +++ b/build.gradle @@ -73,6 +73,9 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + + def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text) + annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version" } test { @@ -105,3 +108,8 @@ wpi.java.configureTestTasks(test) tasks.withType(JavaCompile) { options.compilerArgs.add '-XDstringConcat=inline' } + +task(replayWatch, type: JavaExec) { + mainClass = "org.littletonrobotics.junction.ReplayWatch" + classpath = sourceSets.main.runtimeClasspath +} \ No newline at end of file diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index d88e071..90b36da 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -17,6 +17,10 @@ import frc.robot.subsystems.hood.HoodIO; import frc.robot.subsystems.hood.HoodIOSim; +import frc.robot.subsystems.indexer.Indexer; +import frc.robot.subsystems.indexer.IndexerIO; +import frc.robot.subsystems.indexer.IndexerIOSim; + /** * The methods in this class are called automatically corresponding to each * mode, as described in @@ -32,6 +36,7 @@ public class Robot extends TimedRobot { private Flywheel flywheel; private Hood hood; + private Indexer indexer; /** * This function is run when the robot is first started up and should be used @@ -47,6 +52,8 @@ public Robot() { if (RobotBase.isSimulation()) { flywheel = new Flywheel(new FlywheelIOSim()); hood = new Hood(new HoodIOSim()); + + indexer = new Indexer(new IndexerIOSim()); } else { // Real hardware versions later flywheel = new Flywheel(new FlywheelIO() { diff --git a/src/main/java/frc/robot/subsystems/indexer/Indexer.java b/src/main/java/frc/robot/subsystems/indexer/Indexer.java index c97d4f3..b8678f7 100644 --- a/src/main/java/frc/robot/subsystems/indexer/Indexer.java +++ b/src/main/java/frc/robot/subsystems/indexer/Indexer.java @@ -1,5 +1,36 @@ package frc.robot.subsystems.indexer; -public class Indexer { - + +import org.littletonrobotics.junction.Logger; + + +import edu.wpi.first.wpilibj2.command.SubsystemBase; + + +public class Indexer extends SubsystemBase { + + private IndexerIOInputsAutoLogged inputs = new IndexerIOInputsAutoLogged(); + private IndexerIO io; + private boolean isIntaking = false; + private boolean hasGamepiece = false; + + + public Indexer(IndexerIO io) { + this.io = io; + } + + + @Override + public void periodic() { + io.updateInputs(inputs); + Logger.processInputs("Indexer", inputs); + } + + + // public Command intake() { + // return startEnd( + // () -> io.runVoltage(IndexerConstants.INTAKE_VOLTAGE), + // () -> { io.runVoltage(0.0); isIntaking = false; } + // ); + // } } diff --git a/src/main/java/frc/robot/subsystems/indexer/IndexerIO.java b/src/main/java/frc/robot/subsystems/indexer/IndexerIO.java new file mode 100644 index 0000000..5af350b --- /dev/null +++ b/src/main/java/frc/robot/subsystems/indexer/IndexerIO.java @@ -0,0 +1,29 @@ +package frc.robot.subsystems.indexer; + + +import org.littletonrobotics.junction.AutoLog; + + +public interface IndexerIO { + + + @AutoLog + public static class IndexerIOInputs { + public double RPM = 0.0; + + + public double appliedVolts = 0.0; + + + public double currentAmps = 0.0; + } + public default void updateInputs(IndexerIOInputs inputs) {} + + + public default void runVoltage(double volts) {}; + + + public default void changeCurrentLimit(double current) {}; + + +} diff --git a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSim.java b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSim.java new file mode 100644 index 0000000..13b3f58 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSim.java @@ -0,0 +1,45 @@ +package frc.robot.subsystems.indexer; + + +import edu.wpi.first.math.system.plant.DCMotor; +import edu.wpi.first.math.system.plant.LinearSystemId; +import edu.wpi.first.math.util.Units; +import edu.wpi.first.wpilibj.simulation.DCMotorSim; + + +public class IndexerIOSim implements IndexerIO { + + + + private final DCMotorSim motorSim; + private final double rollerWheelMOI = 0.5 * Units.lbsToKilograms(0.12) * Units.inchesToMeters(1.5) * Units.inchesToMeters(1.5); + public IndexerIOSim() { + this.motorSim = new DCMotorSim( + LinearSystemId.createDCMotorSystem(DCMotor.getNeoVortex(1), 3 * rollerWheelMOI, 1.0), + DCMotor.getNeoVortex(1) + ); + } + + + @Override + public void updateInputs(IndexerIOInputs inputs) { + motorSim.update(0.02); + + + inputs.appliedVolts = 0.0; + + + inputs.RPM = motorSim.getAngularVelocityRPM(); + + + inputs.currentAmps = motorSim.getCurrentDrawAmps(); + + + } + + + @Override + public void runVoltage(double volts) { + motorSim.setInputVoltage(volts); + } +} diff --git a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java new file mode 100644 index 0000000..68caa49 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java @@ -0,0 +1,5 @@ +package frc.robot.subsystems.indexer; + +public class IndexerIOSparkFlex { + +} From c767a49cbafba3322c445f6998c8640b6b6bd96a Mon Sep 17 00:00:00 2001 From: codperson-cyber Date: Sat, 24 Jan 2026 13:03:58 -0500 Subject: [PATCH 07/26] indexer SPARKFLEX created with Constants.java --- src/main/java/frc/robot/Constants.java | 12 + .../indexer/IndexerIOSparkFlex.java | 30 +- vendordeps/Phoenix5-5.36.0.json | 171 +++++++ vendordeps/Phoenix6-26.1.0.json | 449 ++++++++++++++++++ vendordeps/REVLib.json | 133 ++++++ vendordeps/Studica.json | 71 +++ 6 files changed, 864 insertions(+), 2 deletions(-) create mode 100644 src/main/java/frc/robot/Constants.java create mode 100644 vendordeps/Phoenix5-5.36.0.json create mode 100644 vendordeps/Phoenix6-26.1.0.json create mode 100644 vendordeps/REVLib.json create mode 100644 vendordeps/Studica.json diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java new file mode 100644 index 0000000..0dd2bb2 --- /dev/null +++ b/src/main/java/frc/robot/Constants.java @@ -0,0 +1,12 @@ +package frc.robot; + +import edu.wpi.first.math.util.Units; +import edu.wpi.first.wpilibj.RobotBase; + +public class Constants { + public static class IndexerConstants { + // public static final double INTAKE_VOLTAGE = 1.5; + // public static final double OUTAKE_VOLTAGE = -5.0; + public static final int MOTOR_ID = 1; + } +} diff --git a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java index 68caa49..f2e04a6 100644 --- a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java +++ b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java @@ -1,5 +1,31 @@ package frc.robot.subsystems.indexer; -public class IndexerIOSparkFlex { - +import com.revrobotics.spark.SparkFlex; +import com.revrobotics.spark.SparkBase.PersistMode; +import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.spark.SparkLowLevel.MotorType; +import com.revrobotics.spark.config.SparkFlexConfig; +import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; + +import frc.robot.Constants.IndexerConstants; + +public class IndexerIOSparkFlex implements IndexerIO { + private final SparkFlex motor; + + public IndexerIOSparkFlex() { + this.motor = new SparkFlex(IndexerConstants.MOTOR_ID, MotorType.kBrushless); + SparkFlexConfig config = new SparkFlexConfig(); + config.idleMode(IdleMode.kBrake).smartCurrentLimit(50); + motor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); + } + + public void updateInputs(IndexerIOInputs inputs) { + inputs.appliedVolts = motor.getAppliedOutput() * motor.getBusVoltage(); + inputs.currentAmps = motor.getOutputCurrent(); + inputs.RPM = motor.getEncoder().getVelocity(); + } + + public void runVoltage(double volts) { + motor.setVoltage(volts); + } } diff --git a/vendordeps/Phoenix5-5.36.0.json b/vendordeps/Phoenix5-5.36.0.json new file mode 100644 index 0000000..9a27e47 --- /dev/null +++ b/vendordeps/Phoenix5-5.36.0.json @@ -0,0 +1,171 @@ +{ + "fileName": "Phoenix5-5.36.0.json", + "name": "CTRE-Phoenix (v5)", + "version": "5.36.0", + "frcYear": "2026", + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2026-latest.json", + "requires": [ + { + "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.", + "offlineFileName": "Phoenix6-frc2026-latest.json", + "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-latest.json" + } + ], + "conflictsWith": [ + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Users must use the Phoenix 5 replay vendordep when using the Phoenix 6 replay vendordep.", + "offlineFileName": "Phoenix6-replay-frc2026-latest.json" + }, + { + "uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df", + "errorMessage": "Users cannot have both the replay and regular Phoenix 5 vendordeps in their robot program.", + "offlineFileName": "Phoenix5-replay-frc2026-latest.json" + } + ], + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-java", + "version": "5.36.0" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-java", + "version": "5.36.0" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.36.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.36.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-cpp", + "version": "5.36.0", + "libName": "CTRE_Phoenix_WPI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-cpp", + "version": "5.36.0", + "libName": "CTRE_Phoenix", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.36.0", + "libName": "CTRE_PhoenixCCI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "wpiapi-cpp-sim", + "version": "5.36.0", + "libName": "CTRE_Phoenix_WPISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "api-cpp-sim", + "version": "5.36.0", + "libName": "CTRE_PhoenixSim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.36.0", + "libName": "CTRE_PhoenixCCISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ] +} \ No newline at end of file diff --git a/vendordeps/Phoenix6-26.1.0.json b/vendordeps/Phoenix6-26.1.0.json new file mode 100644 index 0000000..dc5dc62 --- /dev/null +++ b/vendordeps/Phoenix6-26.1.0.json @@ -0,0 +1,449 @@ +{ + "fileName": "Phoenix6-26.1.0.json", + "name": "CTRE-Phoenix (v6)", + "version": "26.1.0", + "frcYear": "2026", + "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-latest.json", + "conflictsWith": [ + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.", + "offlineFileName": "Phoenix6-replay-frc2026-latest.json" + } + ], + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "wpiapi-java", + "version": "26.1.0" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "api-cpp", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "api-cpp-sim", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "tools-sim", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simTalonSRX", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simVictorSPX", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simPigeonIMU", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFX", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANcoder", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProPigeon2", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "wpiapi-cpp", + "version": "26.1.0", + "libName": "CTRE_Phoenix6_WPI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.1.0", + "libName": "CTRE_PhoenixTools", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "wpiapi-cpp-sim", + "version": "26.1.0", + "libName": "CTRE_Phoenix6_WPISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "tools-sim", + "version": "26.1.0", + "libName": "CTRE_PhoenixTools_Sim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simTalonSRX", + "version": "26.1.0", + "libName": "CTRE_SimTalonSRX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simVictorSPX", + "version": "26.1.0", + "libName": "CTRE_SimVictorSPX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simPigeonIMU", + "version": "26.1.0", + "libName": "CTRE_SimPigeonIMU", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFX", + "version": "26.1.0", + "libName": "CTRE_SimProTalonFX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "26.1.0", + "libName": "CTRE_SimProTalonFXS", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANcoder", + "version": "26.1.0", + "libName": "CTRE_SimProCANcoder", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProPigeon2", + "version": "26.1.0", + "libName": "CTRE_SimProPigeon2", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "26.1.0", + "libName": "CTRE_SimProCANrange", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "26.1.0", + "libName": "CTRE_SimProCANdi", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "26.1.0", + "libName": "CTRE_SimProCANdle", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ] +} \ No newline at end of file diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json new file mode 100644 index 0000000..d35e593 --- /dev/null +++ b/vendordeps/REVLib.json @@ -0,0 +1,133 @@ +{ + "fileName": "REVLib.json", + "name": "REVLib", + "version": "2026.0.1", + "frcYear": "2026", + "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", + "mavenUrls": [ + "https://maven.revrobotics.com/" + ], + "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2026.json", + "javaDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-java", + "version": "2026.0.1" + } + ], + "jniDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2026.0.1", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibBackendDriver", + "version": "2026.0.1", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibWpiBackendDriver", + "version": "2026.0.1", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-cpp", + "version": "2026.0.1", + "libName": "REVLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2026.0.1", + "libName": "REVLibDriver", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibBackendDriver", + "version": "2026.0.1", + "libName": "BackendDriver", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibWpiBackendDriver", + "version": "2026.0.1", + "libName": "REVLibWpi", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/Studica.json b/vendordeps/Studica.json new file mode 100644 index 0000000..b51bf58 --- /dev/null +++ b/vendordeps/Studica.json @@ -0,0 +1,71 @@ +{ + "fileName": "Studica.json", + "name": "Studica", + "version": "2026.0.0", + "frcYear": "2026", + "uuid": "cb311d09-36e9-4143-a032-55bb2b94443b", + "mavenUrls": [ + "https://dev.studica.com/maven/release/2026/" + ], + "jsonUrl": "https://dev.studica.com/maven/release/2026/json/Studica-2026.0.0.json", + "javaDependencies": [ + { + "groupId": "com.studica.frc", + "artifactId": "Studica-java", + "version": "2026.0.0" + } + ], + "jniDependencies": [ + { + "groupId": "com.studica.frc", + "artifactId": "Studica-driver", + "version": "2026.0.0", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.studica.frc", + "artifactId": "Studica-cpp", + "version": "2026.0.0", + "libName": "Studica", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.studica.frc", + "artifactId": "Studica-driver", + "version": "2026.0.0", + "libName": "StudicaDriver", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ] +} \ No newline at end of file From 1eaa16a1853ec847c9d4c70bef6b34951f510844 Mon Sep 17 00:00:00 2001 From: joshuaharding2 Date: Sat, 24 Jan 2026 14:17:20 -0500 Subject: [PATCH 08/26] Flywheel sparkflex file --- .../robot/subsystems/flywheel/Flywheel.java | 15 ++++++++++ .../flywheel/FlywheelIOSparkFlex.java | 30 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSparkFlex.java diff --git a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java index 30b092c..b928111 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java +++ b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java @@ -1,5 +1,6 @@ package frc.robot.subsystems.flywheel; +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Flywheel extends SubsystemBase { @@ -22,4 +23,18 @@ public void runAtVoltage(double volts) { public double getRPM() { return inputs.velocityRPM; } + + public Command start() { + return startEnd( + () -> runAtVoltage(6.0), // Example voltage + () -> runAtVoltage(0.0) + ); + } + + public Command stop() { + return startEnd( + () -> runAtVoltage(0.0), + () -> {} + ); + } } diff --git a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSparkFlex.java b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSparkFlex.java new file mode 100644 index 0000000..9d0481c --- /dev/null +++ b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSparkFlex.java @@ -0,0 +1,30 @@ +package frc.robot.subsystems.flywheel; + +import com.revrobotics.spark.SparkFlex; +import com.revrobotics.spark.SparkLowLevel.MotorType; +import com.revrobotics.RelativeEncoder; + +public class FlywheelIOSparkFlex implements FlywheelIO { + + private final SparkFlex motor; + private final RelativeEncoder encoder; + + private double appliedVolts = 0.0; + + public FlywheelIOSparkFlex() { + motor = new SparkFlex(1, MotorType.kBrushless); + encoder = motor.getEncoder(); + } + + @Override + public void setVoltage(double volts) { + appliedVolts = volts; + motor.setVoltage(volts); + } + + @Override + public void updateInputs(FlywheelIOInputs inputs) { + inputs.velocityRPM = encoder.getVelocity(); + inputs.appliedVolts = appliedVolts; + } +} From 1096f0755b9c39fc7506f86ff293736bff7c3a87 Mon Sep 17 00:00:00 2001 From: joshuaharding2 Date: Sat, 24 Jan 2026 20:24:09 -0500 Subject: [PATCH 09/26] Flywheel mapped to controller keybinds and bug fixes caused by merge --- build.gradle | 65 +++++- src/main/java/frc/robot/BuildConstants.java | 19 ++ src/main/java/frc/robot/Constants.java | 12 +- src/main/java/frc/robot/Robot.java | 215 +++++++++--------- src/main/java/frc/robot/RobotContainer.java | 85 +++++++ vendordeps/AmLib-2026.0.1.json | 34 +++ vendordeps/DogLog.json | 20 ++ vendordeps/LumynLabs-2026.0.0.json | 103 +++++++++ ....36.0.json => Phoenix5-replay-5.36.0.json} | 88 +++++-- ...6.1.0.json => Phoenix6-replay-26.1.0.json} | 76 +++++-- vendordeps/ReduxLib-2026.1.1.json | 69 ++++++ vendordeps/ThriftyLib-2026.json | 20 ++ vendordeps/URCL.json | 65 ++++++ vendordeps/libgrapplefrc2026.json | 71 ++++++ vendordeps/photonlib.json | 71 ++++++ vendordeps/playingwithfusion2026.json | 71 ++++++ vendordeps/yagsl-2026.1.20.json | 58 +++++ vendordeps/yams.json | 21 ++ 18 files changed, 1020 insertions(+), 143 deletions(-) create mode 100644 src/main/java/frc/robot/BuildConstants.java create mode 100644 src/main/java/frc/robot/RobotContainer.java create mode 100644 vendordeps/AmLib-2026.0.1.json create mode 100644 vendordeps/DogLog.json create mode 100644 vendordeps/LumynLabs-2026.0.0.json rename vendordeps/{Phoenix5-5.36.0.json => Phoenix5-replay-5.36.0.json} (70%) rename vendordeps/{Phoenix6-26.1.0.json => Phoenix6-replay-26.1.0.json} (88%) create mode 100644 vendordeps/ReduxLib-2026.1.1.json create mode 100644 vendordeps/ThriftyLib-2026.json create mode 100644 vendordeps/URCL.json create mode 100644 vendordeps/libgrapplefrc2026.json create mode 100644 vendordeps/photonlib.json create mode 100644 vendordeps/playingwithfusion2026.json create mode 100644 vendordeps/yagsl-2026.1.20.json create mode 100644 vendordeps/yams.json diff --git a/build.gradle b/build.gradle index 1ba0b4c..d74ee34 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id "java" id "edu.wpi.first.GradleRIO" version "2026.1.1" + id "com.peterabeles.gversion" version "1.10" } java { @@ -27,6 +28,17 @@ deploy { // getTargetTypeClass is a shortcut to get the class type using a string frcJava(getArtifactTypeClass('FRCJavaArtifact')) { + jvmArgs.add("-XX:+UnlockExperimentalVMOptions") + jvmArgs.add("-XX:GCTimeRatio=5") + jvmArgs.add("-XX:+UseSerialGC") + jvmArgs.add("-XX:MaxGCPauseMillis=50") + + // The options below may improve performance, but should only be enabled on the RIO 2 + // + final MAX_JAVA_HEAP_SIZE_MB = 100; + jvmArgs.add("-Xmx" + MAX_JAVA_HEAP_SIZE_MB + "M") + jvmArgs.add("-Xms" + MAX_JAVA_HEAP_SIZE_MB + "M") + jvmArgs.add("-XX:+AlwaysPreTouch") } // Static files artifact @@ -50,6 +62,11 @@ wpi.java.debugJni = false // Set this to true to enable desktop support. def includeDesktopSupport = true +task(replayWatch, type: JavaExec) { + mainClass = "org.littletonrobotics.junction.ReplayWatch" + classpath = sourceSets.main.runtimeClasspath +} + // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { @@ -109,7 +126,47 @@ tasks.withType(JavaCompile) { options.compilerArgs.add '-XDstringConcat=inline' } -task(replayWatch, type: JavaExec) { - mainClass = "org.littletonrobotics.junction.ReplayWatch" - classpath = sourceSets.main.runtimeClasspath -} \ No newline at end of file +// Create version file +project.compileJava.dependsOn(createVersionFile) +gversion { + srcDir = "src/main/java/" + classPackage = "frc.robot" + className = "BuildConstants" + dateFormat = "yyyy-MM-dd HH:mm:ss z" + timeZone = "America/New_York" + indent = " " +} + +// Create commit with working changes on event branches +task(eventDeploy) { + doLast { + if (project.gradle.startParameter.taskNames.any({ it.toLowerCase().contains("deploy") })) { + def branchPrefix = "event" + def branch = 'git branch --show-current'.execute().text.trim() + def commitMessage = "Update at '${new Date().toString()}'" + + if (branch.startsWith(branchPrefix)) { + exec { + workingDir(projectDir) + executable 'git' + args 'add', '-A' + } + exec { + workingDir(projectDir) + executable 'git' + args 'commit', '-m', commitMessage + ignoreExitValue = true + } + + println "Committed to branch: '$branch'" + println "Commit message: '$commitMessage'" + } else { + println "Not on an event branch, skipping commit" + } + } else { + println "Not running deploy task, skipping commit" + } + } +} +createVersionFile.dependsOn(eventDeploy) + diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java new file mode 100644 index 0000000..d9f2971 --- /dev/null +++ b/src/main/java/frc/robot/BuildConstants.java @@ -0,0 +1,19 @@ +package frc.robot; + +/** + * Automatically generated file containing build version information. + */ +public final class BuildConstants { + public static final String MAVEN_GROUP = ""; + public static final String MAVEN_NAME = "Dreadbots2026"; + public static final String VERSION = "unspecified"; + public static final int GIT_REVISION = 13; + public static final String GIT_SHA = "1eaa16a1853ec847c9d4c70bef6b34951f510844"; + public static final String GIT_DATE = "2026-01-24 14:17:20 EST"; + public static final String GIT_BRANCH = "dev"; + public static final String BUILD_DATE = "2026-01-24 14:57:25 EST"; + public static final long BUILD_UNIX_TIME = 1769284645240L; + public static final int DIRTY = 1; + + private BuildConstants(){} +} diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 0dd2bb2..2a735b8 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -4,7 +4,17 @@ import edu.wpi.first.wpilibj.RobotBase; public class Constants { - public static class IndexerConstants { + public static final Mode simMode = Mode.SIM; + public static final Mode currentMode = RobotBase.isReal() ? Mode.REAL : simMode; + + public static enum Mode { + REAL, + + SIM, + + REPLAY + } + public static class IndexerConstants { // public static final double INTAKE_VOLTAGE = 1.5; // public static final double OUTAKE_VOLTAGE = -5.0; public static final int MOTOR_ID = 1; diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 90b36da..caf6f70 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -1,134 +1,141 @@ -// 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. +// Copyright 2021-2025 FRC 6328 +// http://github.com/Mechanical-Advantage +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// version 3 as published by the Free Software Foundation or +// available in the root directory of this project. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. package frc.robot; -import edu.wpi.first.wpilibj.TimedRobot; -import edu.wpi.first.wpilibj.RobotBase; -import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; - -import frc.robot.subsystems.flywheel.Flywheel; -import frc.robot.subsystems.flywheel.FlywheelIO; -import frc.robot.subsystems.flywheel.FlywheelIOSim; - -import frc.robot.subsystems.hood.Hood; -import frc.robot.subsystems.hood.HoodIO; -import frc.robot.subsystems.hood.HoodIOSim; - -import frc.robot.subsystems.indexer.Indexer; -import frc.robot.subsystems.indexer.IndexerIO; -import frc.robot.subsystems.indexer.IndexerIOSim; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.CommandScheduler; +import org.littletonrobotics.junction.LogFileUtil; +import org.littletonrobotics.junction.LoggedRobot; +import org.littletonrobotics.junction.Logger; +import org.littletonrobotics.junction.networktables.NT4Publisher; +import org.littletonrobotics.junction.wpilog.WPILOGReader; +import org.littletonrobotics.junction.wpilog.WPILOGWriter; /** - * The methods in this class are called automatically corresponding to each - * mode, as described in - * the TimedRobot documentation. If you change the name of this class or the - * package after creating - * this project, you must also update the Main.java file in the project. + * The VM is configured to automatically run this class, and to call the functions corresponding to + * each mode, as described in the TimedRobot documentation. If you change the name of this class or + * the package after creating this project, you must also update the build.gradle file in the + * project. */ -public class Robot extends TimedRobot { - private static final String kDefaultAuto = "Default"; - private static final String kCustomAuto = "My Auto"; - private String m_autoSelected; - private final SendableChooser m_chooser = new SendableChooser<>(); - - private Flywheel flywheel; - private Hood hood; - private Indexer indexer; - - /** - * This function is run when the robot is first started up and should be used - * for any - * initialization code. - */ +public class Robot extends LoggedRobot { + private RobotContainer robotContainer; + public Robot() { - m_chooser.setDefaultOption("Default Auto", kDefaultAuto); - m_chooser.addOption("My Auto", kCustomAuto); - SmartDashboard.putData("Auto choices", m_chooser); - - // Choose IO implementations based on environment - if (RobotBase.isSimulation()) { - flywheel = new Flywheel(new FlywheelIOSim()); - hood = new Hood(new HoodIOSim()); - - indexer = new Indexer(new IndexerIOSim()); - } else { - // Real hardware versions later - flywheel = new Flywheel(new FlywheelIO() { - }); - hood = new Hood(new HoodIO() { - }); + // Record metadata + Logger.recordMetadata("ProjectName", BuildConstants.MAVEN_NAME); + Logger.recordMetadata("BuildDate", BuildConstants.BUILD_DATE); + Logger.recordMetadata("GitSHA", BuildConstants.GIT_SHA); + Logger.recordMetadata("GitDate", BuildConstants.GIT_DATE); + Logger.recordMetadata("GitBranch", BuildConstants.GIT_BRANCH); + switch (BuildConstants.DIRTY) { + case 0: + Logger.recordMetadata("GitDirty", "All changes committed"); + break; + case 1: + Logger.recordMetadata("GitDirty", "Uncomitted changes"); + break; + default: + Logger.recordMetadata("GitDirty", "Unknown"); + break; + } + + // Set up data receivers & replay source + switch (Constants.currentMode) { + case REAL: + // Running on a real robot, log to a USB stick ("/U/logs") + Logger.addDataReceiver(new WPILOGWriter()); + Logger.addDataReceiver(new NT4Publisher()); + break; + + case SIM: + // Running a physics simulator, log to NT + Logger.addDataReceiver(new NT4Publisher()); + break; + + case REPLAY: + // Replaying a log, set up replay source + setUseTiming(false); // Run as fast as possible + String logPath = LogFileUtil.findReplayLog(); + Logger.setReplaySource(new WPILOGReader(logPath)); + Logger.addDataReceiver(new WPILOGWriter(LogFileUtil.addPathSuffix(logPath, "_sim"))); + break; } + + // Start AdvantageKit logger + Logger.start(); + + // Instantiate our RobotContainer. This will perform all our button bindings, + // and put our autonomous chooser on the dashboard. + robotContainer = new RobotContainer(); } - /** - * This function is called every 20 ms, no matter the mode. Use this for items - * like diagnostics - * that you want ran during disabled, autonomous, teleoperated and test. - * - *

- * This runs after the mode specific periodic functions, but before LiveWindow - * and - * SmartDashboard integrated updating. - */ + /** This function is called periodically during all modes. */ @Override public void robotPeriodic() { - flywheel.periodic(); - hood.periodic(); - - SmartDashboard.putNumber("Flywheel RPM", flywheel.getRPM()); - SmartDashboard.putNumber("Hood Angle (deg)", hood.getAngleDegrees()); + // Runs the Scheduler. This is responsible for polling buttons, adding + // newly-scheduled commands, running already-scheduled commands, removing + // finished or interrupted commands, and running subsystem periodic() methods. + // This must be called from the robot's periodic block in order for anything in + // the Command-based framework to work. + CommandScheduler.getInstance().run(); } - /** - * This autonomous (along with the chooser code above) shows how to select - * between different - * autonomous modes using the dashboard. The sendable chooser code works with - * the Java - * SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the - * chooser code and - * uncomment the getString line to get the auto name from the text box below the - * Gyro - * - *

- * You can add additional auto modes by adding additional comparisons to the - * switch structure - * below with additional strings. If using the SendableChooser make sure to add - * them to the - * chooser code above as well. - */ - @Override - public void autonomousInit() { - m_autoSelected = m_chooser.getSelected(); - // m_autoSelected = SmartDashboard.getString("Auto Selector", kDefaultAuto); - System.out.println("Auto selected: " + m_autoSelected); + public void disabledInit() { } @Override - public void autonomousPeriodic() { - } + public void disabledPeriodic() {} + /** This autonomous runs the autonomous command selected by your {@link RobotContainer} class. */ @Override - public void teleopInit() { + public void autonomousInit() { + + // schedule the autonomous command (example) + // if (autonomousCommand != null) { + // autonomousCommand.schedule(); + // } + + robotContainer.autonomousInit(); } + /** This function is called periodically during autonomous. */ @Override - public void teleopPeriodic() { - } + public void autonomousPeriodic() {} + /** This function is called once when teleop is enabled. */ @Override - public void disabledInit() { + public void teleopInit() { + // This makes sure that the autonomous stops running when + // teleop starts running. If you want the autonomous to + // continue until interrupted by another command, remove + // this line or comment it out. + // if (autonomousCommand != null) { + // autonomousCommand.cancel(); + // } + + robotContainer.teleopInit(); } + /** This function is called periodically during operator control. */ @Override - public void disabledPeriodic() { - } + public void teleopPeriodic() {} @Override public void testInit() { + // Cancels all running commands at the start of test mode. + CommandScheduler.getInstance().cancelAll(); } @Override @@ -140,9 +147,7 @@ public void simulationInit() { } @Override - public void simulationPeriodic() { - // Drive subsystems in sim - flywheel.runAtVoltage(6.0); - hood.setVoltage(2.5); // gentle upward motion - } + public void simulationPeriodic() {} + + } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java new file mode 100644 index 0000000..fca1c41 --- /dev/null +++ b/src/main/java/frc/robot/RobotContainer.java @@ -0,0 +1,85 @@ +package frc.robot; + +import edu.wpi.first.cameraserver.CameraServer; +import edu.wpi.first.math.geometry.Rotation2d; +import edu.wpi.first.wpilibj.internal.DriverStationModeThread; +import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.button.CommandXboxController; + +import frc.robot.subsystems.flywheel.*; + +public class RobotContainer { + + private final CommandXboxController primaryController = new CommandXboxController(0); + private final CommandXboxController secondaryController = new CommandXboxController(1); + + private final Flywheel flywheel; + + public RobotContainer() { + switch (Constants.currentMode) { + case REAL: + flywheel = new Flywheel(new FlywheelIOSparkFlex()); + // drive = + // new Drive( + // new GyroIONavX(), + // new ModuleIOSpark(0), + // new ModuleIOSpark(1), + // new ModuleIOSpark(2), + // new ModuleIOSpark(3)); + // turret = new Turret(new TurretIOSparkFlex()); + CameraServer.startAutomaticCapture(0); + break; + case SIM: + flywheel = new Flywheel(new FlywheelIOSim()); + // drive = + // new Drive( + // new GyroIO() {}, + // new ModuleIOSim(), + // new ModuleIOSim(), + // new ModuleIOSim(), + // new ModuleIOSim()); + // turret = new Turret(new TurretIOSim()); + break; + + default: + flywheel = new Flywheel(new FlywheelIOSim()); + // drive = + // new Drive( + // new GyroIO() {}, + // new ModuleIO() {}, + // new ModuleIO() {}, + // new ModuleIO() {}, + // new ModuleIO() {}); + // turret = new Turret(new TurretIO() {}); + break; + } + configureButtonBindings(); + } + + private void configureButtonBindings() { + //VisionUtil.getAprilTagPose(1); + // drive.setDefaulComand( + // DriveCommands.joystickDrive( + // drive, + // () -> -primaryController.getLeftY(), + // () -> -primaryController.getLeftX(), + // () -> -primaryController.getRightX())); + + // primaryController.start().onTrue( + // Commands.runOnce( + // () -> drive.setPose( + // new Pose2d(vision.getLastVisionPose().getTranslation(), new Rotation2d())), + // drive).ignoringDisable(true)); + + primaryController.x().onTrue(flywheel.start()); + primaryController.y().onTrue(flywheel.stop()); + } + + public void autonomousInit() { + + } + + public void teleopInit() { + + } +} \ No newline at end of file diff --git a/vendordeps/AmLib-2026.0.1.json b/vendordeps/AmLib-2026.0.1.json new file mode 100644 index 0000000..90df51e --- /dev/null +++ b/vendordeps/AmLib-2026.0.1.json @@ -0,0 +1,34 @@ +{ + "fileName": "AmLib-2026.0.1.json", + "name": "AndyMark AM Library", + "version": "2026.0.1", + "frcYear": "2026", + "uuid": "f463c495-f27c-4102-9dde-af4e65a3eb2d", + "mavenUrls": [ + "https://andymarkproductsoftware.github.io/amlib-vendordep/repo/2026/" + ], + "jsonUrl": "https://andymarkproductsoftware.github.io/amlib-vendordep/vendordeps/2026/AmLib-2026.0.1.json", + "jniDependencies": [], + "javaDependencies": [ + { + "groupId": "com.andymark.frc", + "artifactId": "AmLib-java", + "version": "2026.0.1" + } + ], + "cppDependencies": [ + { + "groupId": "com.andymark.frc", + "artifactId": "AmLib-cpp", + "version": "2026.0.1", + "libName": "AmLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxathena" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/DogLog.json b/vendordeps/DogLog.json new file mode 100644 index 0000000..73503e0 --- /dev/null +++ b/vendordeps/DogLog.json @@ -0,0 +1,20 @@ +{ + "javaDependencies": [ + { + "groupId": "com.github.jonahsnider", + "artifactId": "doglog", + "version": "2026.3.1" + } + ], + "fileName": "DogLog.json", + "frcYear": "2026", + "jsonUrl": "https://doglog.dev/vendordep.json", + "name": "DogLog", + "jniDependencies": [], + "mavenUrls": [ + "https://jitpack.io" + ], + "cppDependencies": [], + "version": "2026.3.1", + "uuid": "65592ce1-2251-4a31-8e4b-2df20dacebe4" +} \ No newline at end of file diff --git a/vendordeps/LumynLabs-2026.0.0.json b/vendordeps/LumynLabs-2026.0.0.json new file mode 100644 index 0000000..7880bd2 --- /dev/null +++ b/vendordeps/LumynLabs-2026.0.0.json @@ -0,0 +1,103 @@ +{ + "fileName": "LumynLabs-2026.0.0.json", + "name": "LumynLabs", + "version": "2026.0.0", + "frcYear": "2026", + "uuid": "eebd34fc-a6d3-48a2-a286-ac1cec59ab89", + "mavenUrls": [ + "https://packages.lumynlabs.com/repo" + ], + "jsonUrl": "https://packages.lumynlabs.com/LumynLabs.json", + "javaDependencies": [ + { + "groupId": "com.lumynlabs.frc", + "artifactId": "LumynLabs-java", + "version": "2026.0.0" + } + ], + "jniDependencies": [ + { + "groupId": "com.lumynlabs.frc", + "artifactId": "LumynLabs-driver", + "version": "2026.0.0", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.lumynlabs.frc", + "artifactId": "LumynLabs-common", + "version": "2026.0.0", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.lumynlabs.frc", + "artifactId": "LumynLabs-cpp", + "version": "2026.0.0", + "libName": "Lumyn", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.lumynlabs.frc", + "artifactId": "LumynLabs-driver", + "version": "2026.0.0", + "libName": "LumynDriver", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.lumynlabs.frc", + "artifactId": "LumynLabs-common", + "version": "2026.0.0", + "libName": "LumynCommon", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/Phoenix5-5.36.0.json b/vendordeps/Phoenix5-replay-5.36.0.json similarity index 70% rename from vendordeps/Phoenix5-5.36.0.json rename to vendordeps/Phoenix5-replay-5.36.0.json index 9a27e47..0e799ed 100644 --- a/vendordeps/Phoenix5-5.36.0.json +++ b/vendordeps/Phoenix5-replay-5.36.0.json @@ -1,31 +1,31 @@ { - "fileName": "Phoenix5-5.36.0.json", + "fileName": "Phoenix5-replay-5.36.0.json", "name": "CTRE-Phoenix (v5)", "version": "5.36.0", "frcYear": "2026", - "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df", "mavenUrls": [ "https://maven.ctr-electronics.com/release/" ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2026-latest.json", + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-replay-frc2026-latest.json", "requires": [ { - "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", "errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.", - "offlineFileName": "Phoenix6-frc2026-latest.json", - "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-latest.json" + "offlineFileName": "Phoenix6-replay-frc2026-latest.json", + "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-replay-frc2026-latest.json" } ], "conflictsWith": [ { - "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", - "errorMessage": "Users must use the Phoenix 5 replay vendordep when using the Phoenix 6 replay vendordep.", - "offlineFileName": "Phoenix6-replay-frc2026-latest.json" + "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "errorMessage": "Users must use the regular Phoenix 5 vendordep when using the regular Phoenix 6 vendordep.", + "offlineFileName": "Phoenix6-frc2026-latest.json" }, { - "uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df", + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", "errorMessage": "Users cannot have both the replay and regular Phoenix 5 vendordeps in their robot program.", - "offlineFileName": "Phoenix5-replay-frc2026-latest.json" + "offlineFileName": "Phoenix5-frc2026-latest.json" } ], "javaDependencies": [ @@ -47,11 +47,22 @@ "version": "5.36.0", "isJar": false, "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.replay", + "artifactId": "cci-replay", + "version": "5.36.0", + "isJar": false, + "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", "linuxarm64", - "linuxathena" + "osxuniversal" ], "simMode": "hwsim" }, @@ -80,9 +91,6 @@ "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -96,9 +104,6 @@ "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -111,11 +116,56 @@ "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.replay", + "artifactId": "wpiapi-cpp-replay", + "version": "5.36.0", + "libName": "CTRE_Phoenix_WPIReplay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", "linuxarm64", - "linuxathena" + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.replay", + "artifactId": "api-cpp-replay", + "version": "5.36.0", + "libName": "CTRE_PhoenixReplay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.replay", + "artifactId": "cci-replay", + "version": "5.36.0", + "libName": "CTRE_PhoenixCCIReplay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" ], "simMode": "hwsim" }, diff --git a/vendordeps/Phoenix6-26.1.0.json b/vendordeps/Phoenix6-replay-26.1.0.json similarity index 88% rename from vendordeps/Phoenix6-26.1.0.json rename to vendordeps/Phoenix6-replay-26.1.0.json index dc5dc62..e49c760 100644 --- a/vendordeps/Phoenix6-26.1.0.json +++ b/vendordeps/Phoenix6-replay-26.1.0.json @@ -1,18 +1,18 @@ { - "fileName": "Phoenix6-26.1.0.json", - "name": "CTRE-Phoenix (v6)", + "fileName": "Phoenix6-replay-26.1.0.json", + "name": "CTRE-Phoenix (v6) Replay", "version": "26.1.0", "frcYear": "2026", - "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", "mavenUrls": [ "https://maven.ctr-electronics.com/release/" ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-latest.json", + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-replay-frc2026-latest.json", "conflictsWith": [ { - "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.", - "offlineFileName": "Phoenix6-replay-frc2026-latest.json" + "offlineFileName": "Phoenix6-frc2026-latest.json" } ], "javaDependencies": [ @@ -30,9 +30,6 @@ "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -43,11 +40,36 @@ "version": "26.1.0", "isJar": false, "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.replay", + "artifactId": "api-cpp-replay", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", "linuxarm64", - "linuxathena" + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.replay", + "artifactId": "tools-replay", + "version": "26.1.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" ], "simMode": "hwsim" }, @@ -230,9 +252,6 @@ "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -245,11 +264,40 @@ "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.replay", + "artifactId": "wpiapi-cpp-replay", + "version": "26.1.0", + "libName": "CTRE_Phoenix6_WPIReplay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", "linuxarm64", - "linuxathena" + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.replay", + "artifactId": "tools-replay", + "version": "26.1.0", + "libName": "CTRE_PhoenixTools_Replay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" ], "simMode": "hwsim" }, diff --git a/vendordeps/ReduxLib-2026.1.1.json b/vendordeps/ReduxLib-2026.1.1.json new file mode 100644 index 0000000..09dd4f0 --- /dev/null +++ b/vendordeps/ReduxLib-2026.1.1.json @@ -0,0 +1,69 @@ +{ + "fileName": "ReduxLib-2026.1.1.json", + "name": "ReduxLib", + "version": "2026.1.1", + "frcYear": "2026", + "uuid": "151ecca8-670b-4026-8160-cdd2679ef2bd", + "mavenUrls": [ + "https://maven.reduxrobotics.com/" + ], + "jsonUrl": "https://frcsdk.reduxrobotics.com/ReduxLib_2026.json", + "javaDependencies": [ + { + "groupId": "com.reduxrobotics.frc", + "artifactId": "ReduxLib-java", + "version": "2026.1.1" + } + ], + "jniDependencies": [ + { + "groupId": "com.reduxrobotics.frc", + "artifactId": "ReduxLib-fifo", + "version": "2026.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena", + "linuxx86-64", + "linuxarm64", + "osxuniversal", + "windowsx86-64" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.reduxrobotics.frc", + "artifactId": "ReduxLib-cpp", + "version": "2026.1.1", + "libName": "ReduxLib", + "headerClassifier": "headers", + "sourcesClassifier": "sources", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena", + "linuxx86-64", + "linuxarm64", + "osxuniversal", + "windowsx86-64" + ] + }, + { + "groupId": "com.reduxrobotics.frc", + "artifactId": "ReduxLib-fifo", + "version": "2026.1.1", + "libName": "reduxfifo", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena", + "linuxx86-64", + "linuxarm64", + "osxuniversal", + "windowsx86-64" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/ThriftyLib-2026.json b/vendordeps/ThriftyLib-2026.json new file mode 100644 index 0000000..9aa5808 --- /dev/null +++ b/vendordeps/ThriftyLib-2026.json @@ -0,0 +1,20 @@ +{ + "fileName": "ThriftyLib-2026.json", + "name": "ThriftyLib", + "version": "2026.0.1", + "frcYear": "2026", + "uuid": "60b2694b-9e6e-4026-81ee-6f167946f4b0", + "mavenUrls": [ + "https://docs.home.thethriftybot.com" + ], + "jsonUrl": "https://docs.home.thethriftybot.com/ThriftyLib-2026.json", + "javaDependencies": [ + { + "groupId": "com.thethriftybot.frc", + "artifactId": "ThriftyLib-java", + "version": "2026.0.1" + } + ], + "jniDependencies": [], + "cppDependencies": [] +} \ No newline at end of file diff --git a/vendordeps/URCL.json b/vendordeps/URCL.json new file mode 100644 index 0000000..49552f9 --- /dev/null +++ b/vendordeps/URCL.json @@ -0,0 +1,65 @@ +{ + "fileName": "URCL.json", + "name": "URCL", + "version": "2026.0.0", + "frcYear": "2026", + "uuid": "84246d17-a797-4d1e-bd9f-c59cd8d2477c", + "mavenUrls": [ + "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" + ], + "jsonUrl": "https://raw.githubusercontent.com/Mechanical-Advantage/URCL/main/URCL.json", + "javaDependencies": [ + { + "groupId": "org.littletonrobotics.urcl", + "artifactId": "URCL-java", + "version": "2026.0.0" + } + ], + "jniDependencies": [ + { + "groupId": "org.littletonrobotics.urcl", + "artifactId": "URCL-driver", + "version": "2026.0.0", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxathena", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "org.littletonrobotics.urcl", + "artifactId": "URCL-cpp", + "version": "2026.0.0", + "libName": "URCL", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxathena", + "osxuniversal" + ] + }, + { + "groupId": "org.littletonrobotics.urcl", + "artifactId": "URCL-driver", + "version": "2026.0.0", + "libName": "URCLDriver", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxathena", + "osxuniversal" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/libgrapplefrc2026.json b/vendordeps/libgrapplefrc2026.json new file mode 100644 index 0000000..2f620b5 --- /dev/null +++ b/vendordeps/libgrapplefrc2026.json @@ -0,0 +1,71 @@ +{ + "fileName": "libgrapplefrc2026.json", + "name": "libgrapplefrc", + "version": "2026.0.0", + "frcYear": "2026", + "uuid": "8ef3423d-9532-4665-8339-206dae1d7168", + "mavenUrls": [ + "https://storage.googleapis.com/grapple-frc-maven" + ], + "jsonUrl": "https://storage.googleapis.com/grapple-frc-maven/libgrapplefrc2026.json", + "javaDependencies": [ + { + "groupId": "au.grapplerobotics", + "artifactId": "libgrapplefrcjava", + "version": "2026.0.0" + } + ], + "jniDependencies": [ + { + "groupId": "au.grapplerobotics", + "artifactId": "libgrapplefrcdriver", + "version": "2026.0.0", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "au.grapplerobotics", + "artifactId": "libgrapplefrccpp", + "version": "2026.0.0", + "libName": "grapplefrc", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "au.grapplerobotics", + "artifactId": "libgrapplefrcdriver", + "version": "2026.0.0", + "libName": "grapplefrcdriver", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/photonlib.json b/vendordeps/photonlib.json new file mode 100644 index 0000000..a1bc5a5 --- /dev/null +++ b/vendordeps/photonlib.json @@ -0,0 +1,71 @@ +{ + "fileName": "photonlib.json", + "name": "photonlib", + "version": "v2026.1.1", + "uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004", + "frcYear": "2026", + "mavenUrls": [ + "https://maven.photonvision.org/repository/internal", + "https://maven.photonvision.org/repository/snapshots" + ], + "jsonUrl": "https://maven.photonvision.org/repository/internal/org/photonvision/photonlib-json/1.0/photonlib-json-1.0.json", + "jniDependencies": [ + { + "groupId": "org.photonvision", + "artifactId": "photontargeting-cpp", + "version": "v2026.1.1", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxathena", + "linuxx86-64", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "org.photonvision", + "artifactId": "photonlib-cpp", + "version": "v2026.1.1", + "libName": "photonlib", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxathena", + "linuxx86-64", + "osxuniversal" + ] + }, + { + "groupId": "org.photonvision", + "artifactId": "photontargeting-cpp", + "version": "v2026.1.1", + "libName": "photontargeting", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxathena", + "linuxx86-64", + "osxuniversal" + ] + } + ], + "javaDependencies": [ + { + "groupId": "org.photonvision", + "artifactId": "photonlib-java", + "version": "v2026.1.1" + }, + { + "groupId": "org.photonvision", + "artifactId": "photontargeting-java", + "version": "v2026.1.1" + } + ] +} \ No newline at end of file diff --git a/vendordeps/playingwithfusion2026.json b/vendordeps/playingwithfusion2026.json new file mode 100644 index 0000000..c3875a1 --- /dev/null +++ b/vendordeps/playingwithfusion2026.json @@ -0,0 +1,71 @@ +{ + "fileName": "playingwithfusion2026.json", + "name": "PlayingWithFusion", + "version": "2026.1.16", + "uuid": "14b8ad04-24df-11ea-978f-2e728ce88125", + "frcYear": "2026", + "jsonUrl": "https://www.playingwithfusion.com/frc/playingwithfusion2026.json", + "mavenUrls": [ + "https://www.playingwithfusion.com/frc/maven/" + ], + "javaDependencies": [ + { + "groupId": "com.playingwithfusion.frc", + "artifactId": "PlayingWithFusion-java", + "version": "2026.1.16" + } + ], + "jniDependencies": [ + { + "groupId": "com.playingwithfusion.frc", + "artifactId": "PlayingWithFusion-driver", + "version": "2026.1.16", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.playingwithfusion.frc", + "artifactId": "PlayingWithFusion-cpp", + "version": "2026.1.16", + "libName": "PlayingWithFusion", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.playingwithfusion.frc", + "artifactId": "PlayingWithFusion-driver", + "version": "2026.1.16", + "libName": "PlayingWithFusionDriver", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/yagsl-2026.1.20.json b/vendordeps/yagsl-2026.1.20.json new file mode 100644 index 0000000..40d4b39 --- /dev/null +++ b/vendordeps/yagsl-2026.1.20.json @@ -0,0 +1,58 @@ +{ + "fileName": "yagsl-2026.1.20.json", + "name": "YAGSL", + "version": "2026.1.20", + "frcYear": "2026", + "uuid": "1ccce5a4-acd2-4d18-bca3-4b8047188400", + "mavenUrls": [ + "https://yet-another-software-suite.github.io/YAGSL/releases/", + "https://repo1.maven.org/maven2" + ], + "jsonUrl": "https://yet-another-software-suite.github.io/YAGSL/yagsl.json", + "javaDependencies": [ + { + "groupId": "swervelib", + "artifactId": "YAGSL-java", + "version": "2026.1.20" + }, + { + "groupId": "org.dyn4j", + "artifactId": "dyn4j", + "version": "5.0.2" + } + ], + "requires": [ + { + "uuid": "151ecca8-670b-4026-8160-cdd2679ef2bd", + "errorMessage": "ReduxLib is required!", + "offlineFileName": "ReduxLib.json", + "onlineUrl": "https://frcsdk.reduxrobotics.com/ReduxLib_2026.json" + }, + { + "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", + "errorMessage": "REVLib is required!", + "offlineFileName": "REVLib.json", + "onlineUrl": "https://software-metadata.revrobotics.com/REVLib-2026.json" + }, + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Phoenix6 Replay is required!", + "offlineFileName": "Phoenix6-replay-26.1.0.json", + "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-replay-frc2026-latest.json" + }, + { + "uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df", + "errorMessage": "Phoenix5 Replay Compatibility is required!", + "offlineFileName": "Phoenix5-replay-5.36.0.json", + "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-replay-frc2026-latest.json" + }, + { + "uuid": "60b2694b-9e6e-4026-81ee-6f167946f4b0", + "errorMessage": "ThriftyLib is required!", + "offlineFileName": "ThriftyLib.json", + "onlineUrl": "https://docs.home.thethriftybot.com/ThriftyLib-2026.json" + } + ], + "jniDependencies": [], + "cppDependencies": [] +} \ No newline at end of file diff --git a/vendordeps/yams.json b/vendordeps/yams.json new file mode 100644 index 0000000..01bfad1 --- /dev/null +++ b/vendordeps/yams.json @@ -0,0 +1,21 @@ +{ + "fileName": "yams.json", + "name": "Yet Another Mechanism System", + "version": "2026.1.23", + "frcYear": "2026", + "uuid": "a1051e86-a979-4880-a28b-a0d5362d1d96", + "mavenUrls": [ + "https://yet-another-software-suite.github.io/YAMS/releases/" + ], + "jsonUrl": "https://yet-another-software-suite.github.io/YAMS/yams.json", + "javaDependencies": [ + { + "groupId": "yams", + "artifactId": "YAMS-java", + "version": "2026.1.23" + } + ], + "cppDependencies": [], + "jniDependencies": [], + "requires": [] +} \ No newline at end of file From 2d78e11b17597624f6896b33b2d31056591d8ae2 Mon Sep 17 00:00:00 2001 From: joshuaharding2 Date: Tue, 27 Jan 2026 18:02:16 -0500 Subject: [PATCH 10/26] Flywheel SparkFlex Updates --- src/main/java/frc/robot/BuildConstants.java | 10 +++---- src/main/java/frc/robot/Constants.java | 7 ++++- src/main/java/frc/robot/RobotContainer.java | 4 +-- .../robot/subsystems/flywheel/Flywheel.java | 6 ++--- .../flywheel/FlywheelIOSparkFlex.java | 27 ++++++++++++++----- 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index d9f2971..42e80b7 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 13; - public static final String GIT_SHA = "1eaa16a1853ec847c9d4c70bef6b34951f510844"; - public static final String GIT_DATE = "2026-01-24 14:17:20 EST"; + public static final int GIT_REVISION = 14; + public static final String GIT_SHA = "1096f0755b9c39fc7506f86ff293736bff7c3a87"; + public static final String GIT_DATE = "2026-01-24 20:24:09 EST"; public static final String GIT_BRANCH = "dev"; - public static final String BUILD_DATE = "2026-01-24 14:57:25 EST"; - public static final long BUILD_UNIX_TIME = 1769284645240L; + public static final String BUILD_DATE = "2026-01-27 17:34:51 EST"; + public static final long BUILD_UNIX_TIME = 1769553291980L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 2a735b8..49576ff 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -14,9 +14,14 @@ public static enum Mode { REPLAY } - public static class IndexerConstants { + public static class IndexerConstants { // public static final double INTAKE_VOLTAGE = 1.5; // public static final double OUTAKE_VOLTAGE = -5.0; public static final int MOTOR_ID = 1; } + public static class FlywheelConstants { + public static final double SHOOT_VOLTAGE = 3.0; + public static final int MOTOR_ID_1 = 13; + public static final int MOTOR_ID_2 = 14; + } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index fca1c41..9754588 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -71,8 +71,8 @@ private void configureButtonBindings() { // new Pose2d(vision.getLastVisionPose().getTranslation(), new Rotation2d())), // drive).ignoringDisable(true)); - primaryController.x().onTrue(flywheel.start()); - primaryController.y().onTrue(flywheel.stop()); + primaryController.x().whileTrue(flywheel.start()); + primaryController.y().whileTrue(flywheel.stop()); } public void autonomousInit() { diff --git a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java index b928111..67d2072 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java +++ b/src/main/java/frc/robot/subsystems/flywheel/Flywheel.java @@ -26,14 +26,14 @@ public double getRPM() { public Command start() { return startEnd( - () -> runAtVoltage(6.0), // Example voltage - () -> runAtVoltage(0.0) + () -> io.setVoltage(6.0), // Example voltage + () -> io.setVoltage(0.0) ); } public Command stop() { return startEnd( - () -> runAtVoltage(0.0), + () -> io.setVoltage(0.0), () -> {} ); } diff --git a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSparkFlex.java b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSparkFlex.java index 9d0481c..d86559e 100644 --- a/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSparkFlex.java +++ b/src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSparkFlex.java @@ -2,29 +2,42 @@ import com.revrobotics.spark.SparkFlex; import com.revrobotics.spark.SparkLowLevel.MotorType; -import com.revrobotics.RelativeEncoder; +import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; +import com.revrobotics.spark.config.SparkFlexConfig; +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; + +import frc.robot.Constants.FlywheelConstants; public class FlywheelIOSparkFlex implements FlywheelIO { - private final SparkFlex motor; - private final RelativeEncoder encoder; + private final SparkFlex motor1; + private final SparkFlex motor2; private double appliedVolts = 0.0; public FlywheelIOSparkFlex() { - motor = new SparkFlex(1, MotorType.kBrushless); - encoder = motor.getEncoder(); + motor1 = new SparkFlex(FlywheelConstants.MOTOR_ID_1, MotorType.kBrushless); + SparkFlexConfig config1 = new SparkFlexConfig(); + config1 + .idleMode(IdleMode.kBrake) + .smartCurrentLimit(50); + motor1.configure(config1, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); + motor2 = new SparkFlex(FlywheelConstants.MOTOR_ID_2, MotorType.kBrushless); + SparkFlexConfig config2 = new SparkFlexConfig(); + config2.follow(FlywheelConstants.MOTOR_ID_1); + motor2.configure(config2, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); } @Override public void setVoltage(double volts) { appliedVolts = volts; - motor.setVoltage(volts); + motor1.setVoltage(volts); } @Override public void updateInputs(FlywheelIOInputs inputs) { - inputs.velocityRPM = encoder.getVelocity(); + inputs.velocityRPM = motor1.getEncoder().getVelocity(); inputs.appliedVolts = appliedVolts; } } From 55bf80cad700682ef8579b096ef144fedf5c09aa Mon Sep 17 00:00:00 2001 From: codperson-cyber Date: Thu, 29 Jan 2026 15:44:43 -0500 Subject: [PATCH 11/26] fixed variables --- build.gradle | 2 +- .../java/frc/robot/subsystems/indexer/Indexer.java | 14 +++++++------- .../subsystems/indexer/IndexerIOSparkFlex.java | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index d74ee34..436b0af 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.1.1" + id "edu.wpi.first.GradleRIO" version "2026.2.1" id "com.peterabeles.gversion" version "1.10" } diff --git a/src/main/java/frc/robot/subsystems/indexer/Indexer.java b/src/main/java/frc/robot/subsystems/indexer/Indexer.java index b8678f7..e70ec8a 100644 --- a/src/main/java/frc/robot/subsystems/indexer/Indexer.java +++ b/src/main/java/frc/robot/subsystems/indexer/Indexer.java @@ -1,8 +1,8 @@ package frc.robot.subsystems.indexer; - import org.littletonrobotics.junction.Logger; +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; @@ -27,10 +27,10 @@ public void periodic() { } - // public Command intake() { - // return startEnd( - // () -> io.runVoltage(IndexerConstants.INTAKE_VOLTAGE), - // () -> { io.runVoltage(0.0); isIntaking = false; } - // ); - // } + public Command intake() { + return startEnd( + () -> io.runVoltage(IndexerConstants.INTAKE_VOLTAGE), + () -> { io.runVoltage(0.0); isIntaking = false; } + ); + } } diff --git a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java index f2e04a6..a6a80dd 100644 --- a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java +++ b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java @@ -16,7 +16,7 @@ public IndexerIOSparkFlex() { this.motor = new SparkFlex(IndexerConstants.MOTOR_ID, MotorType.kBrushless); SparkFlexConfig config = new SparkFlexConfig(); config.idleMode(IdleMode.kBrake).smartCurrentLimit(50); - motor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); + motor.configure(config, ResetMode.kResetSafe, PersistMode.kPersist); } public void updateInputs(IndexerIOInputs inputs) { From 18ffd4d69e2f0a9f008177bb5b46d8f15f44975d Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Thu, 29 Jan 2026 15:47:25 -0500 Subject: [PATCH 12/26] Climb base setup? --- Dreadbots2026 | 1 + src/main/java/frc/robot/BuildConstants.java | 12 +++---- .../frc/robot/subsystems/climb/ClimbIO.java | 34 +++++++++++++++++++ .../robot/subsystems/climb/ClimbIOSim.java | 32 +++++++++++++++++ 4 files changed, 73 insertions(+), 6 deletions(-) create mode 160000 Dreadbots2026 create mode 100644 src/main/java/frc/robot/subsystems/climb/ClimbIO.java create mode 100644 src/main/java/frc/robot/subsystems/climb/ClimbIOSim.java diff --git a/Dreadbots2026 b/Dreadbots2026 new file mode 160000 index 0000000..121fb16 --- /dev/null +++ b/Dreadbots2026 @@ -0,0 +1 @@ +Subproject commit 121fb16d5e5a72929f748a04372898497991f3da diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 42e80b7..6245b9c 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,13 +7,13 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 14; - public static final String GIT_SHA = "1096f0755b9c39fc7506f86ff293736bff7c3a87"; - public static final String GIT_DATE = "2026-01-24 20:24:09 EST"; + public static final int GIT_REVISION = 15; + public static final String GIT_SHA = "2d78e11b17597624f6896b33b2d31056591d8ae2"; + public static final String GIT_DATE = "2026-01-27 18:02:16 EST"; public static final String GIT_BRANCH = "dev"; - public static final String BUILD_DATE = "2026-01-27 17:34:51 EST"; - public static final long BUILD_UNIX_TIME = 1769553291980L; - public static final int DIRTY = 1; + public static final String BUILD_DATE = "2026-01-29 15:42:08 EST"; + public static final long BUILD_UNIX_TIME = 1769719328629L; + public static final int DIRTY = 0; private BuildConstants(){} } diff --git a/src/main/java/frc/robot/subsystems/climb/ClimbIO.java b/src/main/java/frc/robot/subsystems/climb/ClimbIO.java new file mode 100644 index 0000000..c6b3f57 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/climb/ClimbIO.java @@ -0,0 +1,34 @@ +package frc.robot.subsystems.climb; + +import org.littletonrobotics.junction.AutoLog; + +public interface ClimbIO { + @AutoLog + class ClimbIOInputs { + //Screw Rotations + public double RPM = 0.0; + + //The Volts being applied to Screw Motor + public double appliedVolts = 0.0; + + //The Amps Curently in Screw Motor + public double currentAmps = 0.0; + } + public default void updateInputs(ClimbIOInputs inputs) {}; + + + public default void runVoltage(double volts) {}; + + + public default void changeCurrentLimit(double current) {}; + //The Volts + public double screwMotorAppliedVolts = 0.0; + + + //Current + public double screwMotorCurrentAmps = 0.0; + + + //gets the voltage of the motor + public default void runScrewMotorVoltage(double volts) {} +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/climb/ClimbIOSim.java b/src/main/java/frc/robot/subsystems/climb/ClimbIOSim.java new file mode 100644 index 0000000..b6b4505 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/climb/ClimbIOSim.java @@ -0,0 +1,32 @@ +package frc.robot.subsystems.climb; + +import com.revrobotics.sim.SparkFlexSim; +import com.revrobotics.spark.SparkFlex; + + +//Redone Code from 2024/2025 Slapdown Algae I wrote to get voltage from a motor needs work so commented out for now -Landon + +// I think issue is that the Sparkflex Motor has not been defined nad named yet +public class ClimbIOSim implements ClimbIO { + + ///private final SparkFlex ScrewMotor; + + +// public ClimbIOSim() { + + // ScrewMotorVolts = 0.0; + + // private double ScrewMotorVolts; + + // @Override + // public void updateInputs(ClimbIOInputs inputs) { + + + // inputs.screwMotorAppliedVolts = ScrewMotorVolts; + + + // inputs.screwMotorCurrentAmps = ScrewMotor.getCurrentDrawAmps(); + + //} + //} +} \ No newline at end of file From 96ce8ccb9aa10588028894efb5e5b7e76b3ee44b Mon Sep 17 00:00:00 2001 From: codperson-cyber Date: Thu, 29 Jan 2026 15:51:54 -0500 Subject: [PATCH 13/26] fixed files --- src/main/java/frc/robot/BuildConstants.java | 12 ++++++------ src/main/java/frc/robot/Constants.java | 4 ++-- .../java/frc/robot/subsystems/indexer/Indexer.java | 2 ++ .../robot/subsystems/indexer/IndexerIOSparkFlex.java | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 6245b9c..a11edf0 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,13 +7,13 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 15; - public static final String GIT_SHA = "2d78e11b17597624f6896b33b2d31056591d8ae2"; - public static final String GIT_DATE = "2026-01-27 18:02:16 EST"; + public static final int GIT_REVISION = 17; + public static final String GIT_SHA = "18ffd4d69e2f0a9f008177bb5b46d8f15f44975d"; + public static final String GIT_DATE = "2026-01-29 15:47:25 EST"; public static final String GIT_BRANCH = "dev"; - public static final String BUILD_DATE = "2026-01-29 15:42:08 EST"; - public static final long BUILD_UNIX_TIME = 1769719328629L; - public static final int DIRTY = 0; + public static final String BUILD_DATE = "2026-01-29 15:51:24 EST"; + public static final long BUILD_UNIX_TIME = 1769719884969L; + public static final int DIRTY = 1; private BuildConstants(){} } diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 49576ff..32c31c1 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -15,8 +15,8 @@ public static enum Mode { REPLAY } public static class IndexerConstants { - // public static final double INTAKE_VOLTAGE = 1.5; - // public static final double OUTAKE_VOLTAGE = -5.0; + public static final double INTAKE_VOLTAGE = 1.5; + public static final double OUTAKE_VOLTAGE = -5.0; public static final int MOTOR_ID = 1; } public static class FlywheelConstants { diff --git a/src/main/java/frc/robot/subsystems/indexer/Indexer.java b/src/main/java/frc/robot/subsystems/indexer/Indexer.java index e70ec8a..5afb176 100644 --- a/src/main/java/frc/robot/subsystems/indexer/Indexer.java +++ b/src/main/java/frc/robot/subsystems/indexer/Indexer.java @@ -1,5 +1,7 @@ package frc.robot.subsystems.indexer; +import frc.robot.Constants.IndexerConstants; + import org.littletonrobotics.junction.Logger; import edu.wpi.first.wpilibj2.command.Command; diff --git a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java index a6a80dd..b1c2277 100644 --- a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java +++ b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java @@ -16,7 +16,7 @@ public IndexerIOSparkFlex() { this.motor = new SparkFlex(IndexerConstants.MOTOR_ID, MotorType.kBrushless); SparkFlexConfig config = new SparkFlexConfig(); config.idleMode(IdleMode.kBrake).smartCurrentLimit(50); - motor.configure(config, ResetMode.kResetSafe, PersistMode.kPersist); + motor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); } public void updateInputs(IndexerIOInputs inputs) { From 2a9d2580dee02a5b1f7455327d93289c7e246a08 Mon Sep 17 00:00:00 2001 From: codperson-cyber Date: Thu, 29 Jan 2026 15:53:34 -0500 Subject: [PATCH 14/26] fixed files --- .../java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java index b1c2277..69e898d 100644 --- a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java +++ b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkFlex.java @@ -1,8 +1,8 @@ package frc.robot.subsystems.indexer; import com.revrobotics.spark.SparkFlex; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.config.SparkFlexConfig; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; From 4d049e5a0c43da59601dfb122b43157d400fac30 Mon Sep 17 00:00:00 2001 From: joshuaharding2 Date: Thu, 29 Jan 2026 16:16:57 -0500 Subject: [PATCH 15/26] Finished merging main branch into dev --- Dreadbots2026 | 1 - src/main/java/frc/robot/BuildConstants.java | 12 ++++++------ src/main/java/frc/robot/Robot.java | 6 ------ 3 files changed, 6 insertions(+), 13 deletions(-) delete mode 160000 Dreadbots2026 diff --git a/Dreadbots2026 b/Dreadbots2026 deleted file mode 160000 index 121fb16..0000000 --- a/Dreadbots2026 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 121fb16d5e5a72929f748a04372898497991f3da diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index f1a50d3..54c69a8 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 12; - public static final String GIT_SHA = "7b13ffa48be066b1546d17fa83b739acae12826e"; - public static final String GIT_DATE = "2026-01-27 18:12:48 EST"; - public static final String GIT_BRANCH = "main"; - public static final String BUILD_DATE = "2026-01-28 12:56:56 EST"; - public static final long BUILD_UNIX_TIME = 1769623016280L; + public static final int GIT_REVISION = 29; + public static final String GIT_SHA = "32954ae8d7dd0db2806a98c483d4a8a52b40c5ee"; + public static final String GIT_DATE = "2026-01-29 16:11:09 EST"; + public static final String GIT_BRANCH = "dev"; + public static final String BUILD_DATE = "2026-01-29 16:14:24 EST"; + public static final long BUILD_UNIX_TIME = 1769721264826L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index caf30e5..d5f0795 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -99,12 +99,6 @@ public void robotPeriodic() { Threads.setCurrentThreadPriority(false, 10); } - @Override - public void testInit() { - // Cancels all running commands at the start of test mode. - CommandScheduler.getInstance().cancelAll(); - } - @Override public void disabledPeriodic() {} From b014574bb2ef2866e4fa50d00adb411b6a7f04ce Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Thu, 29 Jan 2026 17:00:54 -0500 Subject: [PATCH 16/26] Climb Sub Branch builded self --- src/main/java/frc/robot/BuildConstants.java | 12 ++--- src/main/java/frc/robot/Constants.java | 7 ++- .../frc/robot/subsystems/climb/Climb.java | 23 ++++++++- .../robot/subsystems/climb/ClimbIOSim.java | 47 +++++++++++-------- 4 files changed, 61 insertions(+), 28 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 54c69a8..a0f4d8e 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 29; - public static final String GIT_SHA = "32954ae8d7dd0db2806a98c483d4a8a52b40c5ee"; - public static final String GIT_DATE = "2026-01-29 16:11:09 EST"; - public static final String GIT_BRANCH = "dev"; - public static final String BUILD_DATE = "2026-01-29 16:14:24 EST"; - public static final long BUILD_UNIX_TIME = 1769721264826L; + public static final int GIT_REVISION = 30; + public static final String GIT_SHA = "4d049e5a0c43da59601dfb122b43157d400fac30"; + public static final String GIT_DATE = "2026-01-29 16:16:57 EST"; + public static final String GIT_BRANCH = "Climb"; + public static final String BUILD_DATE = "2026-01-29 16:59:01 EST"; + public static final long BUILD_UNIX_TIME = 1769723941311L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 57163ef..69b8ec9 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -27,6 +27,12 @@ public static class FlywheelConstants { public static final int MOTOR_ID_2 = 14; } + public static class ClimbConstants { + public static final double INTAKE_VOLTAGE = 1.5; + public static final double OUTAKE_VOLTAGE = -5.0; + public static final int MOTOR_ID = 17; + } + public static final class AutoAlignConstants { public static final double TRANSLATION_KP = 0.5; public static final double TRANSLATION_KD = 0.0; @@ -39,6 +45,5 @@ public static final class AutoAlignConstants { public static final double ROTATION_MAX_ACCELERATION = 10.0; public static final double LEFT_REEF_BRANCH_OFFSET = Units.inchesToMeters(11.5 / 2.0); public static final double RIGHT_REEF_BRANCH_OFFSET = Units.inchesToMeters(13.5 / 2.0); - } } \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/climb/Climb.java b/src/main/java/frc/robot/subsystems/climb/Climb.java index 04d2ba8..273a0fe 100644 --- a/src/main/java/frc/robot/subsystems/climb/Climb.java +++ b/src/main/java/frc/robot/subsystems/climb/Climb.java @@ -1,5 +1,26 @@ package frc.robot.subsystems.climb; -public class Climb { +import org.littletonrobotics.junction.AutoLogOutput; +import org.littletonrobotics.junction.Logger; + +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Climb extends SubsystemBase { + private ClimbIO io; + private ClimbIOInputsAutoLogged inputs = new ClimbIOInputsAutoLogged(); + + @AutoLogOutput + public boolean isClimbed = false; + public Climb(ClimbIO io) { + this.io = io; +} + @Override + public void periodic() { + io.updateInputs(inputs); + Logger.processInputs("Climb", inputs); + + } } diff --git a/src/main/java/frc/robot/subsystems/climb/ClimbIOSim.java b/src/main/java/frc/robot/subsystems/climb/ClimbIOSim.java index b6b4505..dea9ef7 100644 --- a/src/main/java/frc/robot/subsystems/climb/ClimbIOSim.java +++ b/src/main/java/frc/robot/subsystems/climb/ClimbIOSim.java @@ -1,32 +1,39 @@ package frc.robot.subsystems.climb; -import com.revrobotics.sim.SparkFlexSim; -import com.revrobotics.spark.SparkFlex; +import edu.wpi.first.math.system.plant.DCMotor; +import edu.wpi.first.math.system.plant.LinearSystemId; +import edu.wpi.first.math.util.Units; +import edu.wpi.first.wpilibj.simulation.DCMotorSim; -//Redone Code from 2024/2025 Slapdown Algae I wrote to get voltage from a motor needs work so commented out for now -Landon - -// I think issue is that the Sparkflex Motor has not been defined nad named yet public class ClimbIOSim implements ClimbIO { + + + + private final DCMotorSim motorSim; + private final double rollerWheelMOI = 0.5 * Units.lbsToKilograms(0.12) * Units.inchesToMeters(1.5) * Units.inchesToMeters(1.5); + public ClimbIOSim() { + this.motorSim = new DCMotorSim( + LinearSystemId.createDCMotorSystem(DCMotor.getNeoVortex(1), 3 * rollerWheelMOI, 1.0), + DCMotor.getNeoVortex(1) + ); + } + - ///private final SparkFlex ScrewMotor; + @Override + public void updateInputs(ClimbIOInputs inputs) { + motorSim.update(0.02); + inputs.appliedVolts = 0.0; -// public ClimbIOSim() { - - // ScrewMotorVolts = 0.0; + inputs.RPM = motorSim.getAngularVelocityRPM(); - // private double ScrewMotorVolts; - - // @Override - // public void updateInputs(ClimbIOInputs inputs) { - + inputs.currentAmps = motorSim.getCurrentDrawAmps(); - // inputs.screwMotorAppliedVolts = ScrewMotorVolts; - - - // inputs.screwMotorCurrentAmps = ScrewMotor.getCurrentDrawAmps(); + } - //} - //} + @Override + public void runVoltage(double volts) { + motorSim.setInputVoltage(volts); + } } \ No newline at end of file From 0b2172dd36dbc4ae2c0f6bd7f363e3370fdd6798 Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Sat, 31 Jan 2026 14:02:53 -0500 Subject: [PATCH 17/26] Got Motor hypotherically working --- .../subsystems/climb/ClimbIOSparkFlex.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/main/java/frc/robot/subsystems/climb/ClimbIOSparkFlex.java diff --git a/src/main/java/frc/robot/subsystems/climb/ClimbIOSparkFlex.java b/src/main/java/frc/robot/subsystems/climb/ClimbIOSparkFlex.java new file mode 100644 index 0000000..582aa10 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/climb/ClimbIOSparkFlex.java @@ -0,0 +1,57 @@ +package frc.robot.subsystems.climb; + +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; +import com.revrobotics.sim.SparkFlexSim; +import com.revrobotics.spark.SparkFlex; +import com.revrobotics.spark.SparkLowLevel.MotorType; +import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; +import com.revrobotics.spark.config.SparkFlexConfig; + +import frc.robot.subsystems.indexer.IndexerIO; +import frc.robot.subsystems.indexer.IndexerIO.IndexerIOInputs; + +import frc.robot.Constants.ClimbConstants; + +//Redone Code from 2024/2025 Slapdown Algae I wrote to get voltage from a motor needs work so commented out for now -Landon + +// I think issue is that the Sparkflex Motor has not been defined nad named yet +public class ClimbIOSparkFlex implements ClimbIO { + private SparkFlex screwMotor; + + + public void ClimbIOSparkFlex() { + this.screwMotor = new SparkFlex(ClimbConstants.MOTOR_ID, MotorType.kBrushless); + SparkFlexConfig config = new SparkFlexConfig(); + config.idleMode(IdleMode.kBrake).smartCurrentLimit(50); + screwMotor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); + } + + public void updateInputs(ClimbIOInputs inputs) { + inputs.appliedVolts = screwMotor.getAppliedOutput() * screwMotor.getBusVoltage(); + inputs.currentAmps = screwMotor.getOutputCurrent(); + inputs.RPM = screwMotor.getEncoder().getVelocity(); + } + + public void runVoltage(double volts) { + screwMotor.setVoltage(volts); + } +} + +// public ClimbIOSim() { + +// ScrewMotorVolts = 0.0; + +// private double ScrewMotorVolts; + +// @Override +// public void updateInputs(ClimbIOInputs inputs) { + + +// inputs.screwMotorAppliedVolts = ScrewMotorVolts; + + +// inputs.screwMotorCurrentAmps = ScrewMotor.getCurrentDrawAmps(); + +// } +// } \ No newline at end of file From 4fda026e075a86f913db9f917a2383c65f1fb510 Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Sat, 31 Jan 2026 14:35:47 -0500 Subject: [PATCH 18/26] Working Climb test Motor 1 works on test board --- src/main/java/frc/robot/BuildConstants.java | 10 +- src/main/java/frc/robot/Constants.java | 4 +- src/main/java/frc/robot/RobotContainer.java | 92 +++++++++++++++---- .../frc/robot/subsystems/climb/Climb.java | 34 ++++++- .../frc/robot/subsystems/climb/ClimbIO.java | 12 ++- .../subsystems/climb/ClimbIOSparkFlex.java | 30 +----- ...mLib-2026.0.1.json => AmLib-2026.0.2.json} | 10 +- vendordeps/DogLog.json | 4 +- 8 files changed, 129 insertions(+), 67 deletions(-) rename vendordeps/{AmLib-2026.0.1.json => AmLib-2026.0.2.json} (82%) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index a0f4d8e..dd66981 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 30; - public static final String GIT_SHA = "4d049e5a0c43da59601dfb122b43157d400fac30"; - public static final String GIT_DATE = "2026-01-29 16:16:57 EST"; + public static final int GIT_REVISION = 32; + public static final String GIT_SHA = "0b2172dd36dbc4ae2c0f6bd7f363e3370fdd6798"; + public static final String GIT_DATE = "2026-01-31 14:02:53 EST"; public static final String GIT_BRANCH = "Climb"; - public static final String BUILD_DATE = "2026-01-29 16:59:01 EST"; - public static final long BUILD_UNIX_TIME = 1769723941311L; + public static final String BUILD_DATE = "2026-01-31 14:29:20 EST"; + public static final long BUILD_UNIX_TIME = 1769887760871L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 69b8ec9..98b65b2 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -29,8 +29,8 @@ public static class FlywheelConstants { public static class ClimbConstants { public static final double INTAKE_VOLTAGE = 1.5; - public static final double OUTAKE_VOLTAGE = -5.0; - public static final int MOTOR_ID = 17; + public static final double OUTAKE_VOLTAGE = -1.5; + public static final int MOTOR_ID = 1; } public static final class AutoAlignConstants { diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 84dfd76..2ffd6c7 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -24,6 +24,7 @@ import frc.robot.subsystems.vision.VisionIOCamera; import frc.robot.subsystems.flywheel.*; +import frc.robot.subsystems.climb.*; public class RobotContainer { @@ -33,39 +34,74 @@ public class RobotContainer { private final Vision vision; private final List cameras; private final Flywheel flywheel; + private final Climb climb; public RobotContainer() { switch (Constants.currentMode) { case REAL: - drive = + // drive = + // new Drive( + // new GyroIONavX(), + // new ModuleIOSpark(0), + // new ModuleIOSpark(1), + // new ModuleIOSpark(2), + // new ModuleIOSpark(3)); + + + drive = new Drive( - new GyroIONavX(), - new ModuleIOSpark(0), - new ModuleIOSpark(1), - new ModuleIOSpark(2), - new ModuleIOSpark(3)); + new GyroIO() {}, + new ModuleIOSim(), + new ModuleIOSim(), + new ModuleIOSim(), + new ModuleIOSim()); + // turret = new Turret(new TurretIOSparkMax()); - cameras = List.of( + // cameras = List.of( + // new VisionCamera( + // new VisionIOCamera(VisionConstants.frontRightCameraName), + // 0), + // new VisionCamera( + // new VisionIOCamera(VisionConstants.frontLeftCameraName), + // 1), + // new VisionCamera( + // new VisionIOCamera(VisionConstants.backCameraName), + // 2)); + // vision = new Vision( + // cameras, + // drive::addVisionMeasurement, + // drive::getPose); + // CameraServer.startAutomaticCapture(0); + + cameras = List.of( new VisionCamera( - new VisionIOCamera(VisionConstants.frontRightCameraName), - 0), + new VisionIOCamera(VisionConstants.frontRightCameraName), + 0), new VisionCamera( - new VisionIOCamera(VisionConstants.frontLeftCameraName), - 1), + new VisionIOCamera(VisionConstants.frontLeftCameraName), + 1), new VisionCamera( - new VisionIOCamera(VisionConstants.backCameraName), - 2)); - vision = new Vision( + new VisionIOCamera(VisionConstants.backCameraName), + 2)); + vision = new Vision( cameras, drive::addVisionMeasurement, drive::getPose); - CameraServer.startAutomaticCapture(0); - flywheel = new Flywheel(new FlywheelIOSparkFlex()); + + flywheel = new Flywheel(new FlywheelIOSim()); + //flywheel = new Flywheel(new FlywheelIOSparkFlex()); + climb = new Climb(new ClimbIOSparkFlex()); break; - case SIM: + + + + + + case SIM: + drive = new Drive( new GyroIO() {}, @@ -90,8 +126,12 @@ public RobotContainer() { flywheel = new Flywheel(new FlywheelIOSim()); // turret = new Turret(new TurretIOSim()); + + + climb = new Climb(new ClimbIOSim()); break; + default: drive = @@ -117,6 +157,7 @@ public RobotContainer() { drive::addVisionMeasurement, drive::getPose); + climb = new Climb(new ClimbIO() {}); flywheel = new Flywheel(new FlywheelIOSim()); // turret = new Turret(new TurretIO() {}); break; @@ -124,6 +165,15 @@ public RobotContainer() { configureButtonBindings(); } + + + + + + + + +//This Configures the Button's bindings for the controller with the system for the robot private void configureButtonBindings() { VisionUtil.getApriltagPose(1); drive.setDefaultCommand( @@ -138,6 +188,14 @@ private void configureButtonBindings() { () -> drive.setPose( new Pose2d(vision.getLastVisionPose().getTranslation(), new Rotation2d())), drive).ignoringDisable(true)); + + + + // //Slapdown Algae Buttons (Left Trigger Intakes wheels/ Right Trigger Outakes wheels) (D-pad Up will pull in the intake system while D-pad down will push the intake system out to grab Algae) + primaryController.rightTrigger().whileTrue(climb.doClimbSequence()); + primaryController.leftTrigger().whileTrue(climb.unClimbSequence()); + + } public Command getAutonomousCommand() { return null; //choreoAutoChooser.selectedCommand(); diff --git a/src/main/java/frc/robot/subsystems/climb/Climb.java b/src/main/java/frc/robot/subsystems/climb/Climb.java index 273a0fe..4cf6a02 100644 --- a/src/main/java/frc/robot/subsystems/climb/Climb.java +++ b/src/main/java/frc/robot/subsystems/climb/Climb.java @@ -6,21 +6,45 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants.ClimbConstants; public class Climb extends SubsystemBase { - +//Auto logging output to something private ClimbIO io; private ClimbIOInputsAutoLogged inputs = new ClimbIOInputsAutoLogged(); + @AutoLogOutput + // Setting up the boolean Varible, which is for right now isClimbed (Basic will be updated later) public boolean isClimbed = false; public Climb(ClimbIO io) { this.io = io; -} + } + + public Command doClimbSequence() { + return Commands.sequence( + Commands.startEnd( + () -> io.runVoltage(ClimbConstants.INTAKE_VOLTAGE), + () -> io.runVoltage(0.0) + ) + ); + } + + public Command unClimbSequence() { + return Commands.sequence( + Commands.startEnd( + () -> io.runVoltage(ClimbConstants.OUTAKE_VOLTAGE), + () -> io.runVoltage(0.0) + ) + ); + } + + + // Updates the inputs of ClimbIO perodic. + // ClimbIO takes the inputs and outputs of Climb from the contorller @Override public void periodic() { - io.updateInputs(inputs); - Logger.processInputs("Climb", inputs); - + io.updateInputs(inputs); + Logger.processInputs("Climb", inputs); } } diff --git a/src/main/java/frc/robot/subsystems/climb/ClimbIO.java b/src/main/java/frc/robot/subsystems/climb/ClimbIO.java index c6b3f57..195fe71 100644 --- a/src/main/java/frc/robot/subsystems/climb/ClimbIO.java +++ b/src/main/java/frc/robot/subsystems/climb/ClimbIO.java @@ -3,6 +3,8 @@ import org.littletonrobotics.junction.AutoLog; public interface ClimbIO { + + //Autologging the Rotations Per Minute, the Applied Volts to the motor and the Current Amps of the motor @AutoLog class ClimbIOInputs { //Screw Rotations @@ -14,21 +16,21 @@ class ClimbIOInputs { //The Amps Curently in Screw Motor public double currentAmps = 0.0; } + //Updates inputs of Climb IO public default void updateInputs(ClimbIOInputs inputs) {}; - + // Updates the runVoltage command to update how many volts it needs to run public default void runVoltage(double volts) {}; - + //Changes the current limit of the volts on the motor public default void changeCurrentLimit(double current) {}; + //The Volts public double screwMotorAppliedVolts = 0.0; - //Current public double screwMotorCurrentAmps = 0.0; - - + //gets the voltage of the motor public default void runScrewMotorVoltage(double volts) {} } \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/climb/ClimbIOSparkFlex.java b/src/main/java/frc/robot/subsystems/climb/ClimbIOSparkFlex.java index 582aa10..dc69845 100644 --- a/src/main/java/frc/robot/subsystems/climb/ClimbIOSparkFlex.java +++ b/src/main/java/frc/robot/subsystems/climb/ClimbIOSparkFlex.java @@ -13,15 +13,11 @@ import frc.robot.Constants.ClimbConstants; -//Redone Code from 2024/2025 Slapdown Algae I wrote to get voltage from a motor needs work so commented out for now -Landon - -// I think issue is that the Sparkflex Motor has not been defined nad named yet public class ClimbIOSparkFlex implements ClimbIO { private SparkFlex screwMotor; - - - public void ClimbIOSparkFlex() { - this.screwMotor = new SparkFlex(ClimbConstants.MOTOR_ID, MotorType.kBrushless); + + public ClimbIOSparkFlex() { + screwMotor = new SparkFlex(ClimbConstants.MOTOR_ID, MotorType.kBrushless); SparkFlexConfig config = new SparkFlexConfig(); config.idleMode(IdleMode.kBrake).smartCurrentLimit(50); screwMotor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); @@ -36,22 +32,4 @@ public void updateInputs(ClimbIOInputs inputs) { public void runVoltage(double volts) { screwMotor.setVoltage(volts); } -} - -// public ClimbIOSim() { - -// ScrewMotorVolts = 0.0; - -// private double ScrewMotorVolts; - -// @Override -// public void updateInputs(ClimbIOInputs inputs) { - - -// inputs.screwMotorAppliedVolts = ScrewMotorVolts; - - -// inputs.screwMotorCurrentAmps = ScrewMotor.getCurrentDrawAmps(); - -// } -// } \ No newline at end of file +} \ No newline at end of file diff --git a/vendordeps/AmLib-2026.0.1.json b/vendordeps/AmLib-2026.0.2.json similarity index 82% rename from vendordeps/AmLib-2026.0.1.json rename to vendordeps/AmLib-2026.0.2.json index 90df51e..1d8ef5d 100644 --- a/vendordeps/AmLib-2026.0.1.json +++ b/vendordeps/AmLib-2026.0.2.json @@ -1,26 +1,26 @@ { - "fileName": "AmLib-2026.0.1.json", + "fileName": "AmLib-2026.0.2.json", "name": "AndyMark AM Library", - "version": "2026.0.1", + "version": "2026.0.2", "frcYear": "2026", "uuid": "f463c495-f27c-4102-9dde-af4e65a3eb2d", "mavenUrls": [ "https://andymarkproductsoftware.github.io/amlib-vendordep/repo/2026/" ], - "jsonUrl": "https://andymarkproductsoftware.github.io/amlib-vendordep/vendordeps/2026/AmLib-2026.0.1.json", + "jsonUrl": "https://andymarkproductsoftware.github.io/amlib-vendordep/vendordeps/2026/AmLib-2026.0.2.json", "jniDependencies": [], "javaDependencies": [ { "groupId": "com.andymark.frc", "artifactId": "AmLib-java", - "version": "2026.0.1" + "version": "2026.0.2" } ], "cppDependencies": [ { "groupId": "com.andymark.frc", "artifactId": "AmLib-cpp", - "version": "2026.0.1", + "version": "2026.0.2", "libName": "AmLib", "headerClassifier": "headers", "sharedLibrary": false, diff --git a/vendordeps/DogLog.json b/vendordeps/DogLog.json index 73503e0..de3ef13 100644 --- a/vendordeps/DogLog.json +++ b/vendordeps/DogLog.json @@ -3,7 +3,7 @@ { "groupId": "com.github.jonahsnider", "artifactId": "doglog", - "version": "2026.3.1" + "version": "2026.4.0" } ], "fileName": "DogLog.json", @@ -15,6 +15,6 @@ "https://jitpack.io" ], "cppDependencies": [], - "version": "2026.3.1", + "version": "2026.4.0", "uuid": "65592ce1-2251-4a31-8e4b-2df20dacebe4" } \ No newline at end of file From ff2614094a1d01be04db2c996db9f26e3d618923 Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Sat, 7 Feb 2026 13:27:00 -0500 Subject: [PATCH 19/26] Climb work 2/7/2026 --- src/main/java/frc/robot/RobotContainer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 2ffd6c7..131e31d 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -132,6 +132,8 @@ public RobotContainer() { break; + + default: drive = From d550eca8f5604af56feb69a2c5ad2561f4f35b32 Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Sat, 7 Feb 2026 14:05:57 -0500 Subject: [PATCH 20/26] Climb --- src/main/java/frc/robot/BuildConstants.java | 10 ++-- .../frc/robot/subsystems/climb/Climb.java | 52 +++++++++++++++++-- .../frc/robot/subsystems/climb/ClimbIO.java | 6 +++ ...-2026.0.0.json => LumynLabs-2026.1.2.json} | 44 +++------------- vendordeps/photonlib.json | 12 ++--- vendordeps/yams.json | 4 +- 6 files changed, 72 insertions(+), 56 deletions(-) rename vendordeps/{LumynLabs-2026.0.0.json => LumynLabs-2026.1.2.json} (60%) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index dd66981..9bf20b3 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 32; - public static final String GIT_SHA = "0b2172dd36dbc4ae2c0f6bd7f363e3370fdd6798"; - public static final String GIT_DATE = "2026-01-31 14:02:53 EST"; + public static final int GIT_REVISION = 33; + public static final String GIT_SHA = "4fda026e075a86f913db9f917a2383c65f1fb510"; + public static final String GIT_DATE = "2026-01-31 14:35:47 EST"; public static final String GIT_BRANCH = "Climb"; - public static final String BUILD_DATE = "2026-01-31 14:29:20 EST"; - public static final long BUILD_UNIX_TIME = 1769887760871L; + public static final String BUILD_DATE = "2026-02-05 16:40:52 EST"; + public static final long BUILD_UNIX_TIME = 1770327652643L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc/robot/subsystems/climb/Climb.java b/src/main/java/frc/robot/subsystems/climb/Climb.java index 4cf6a02..7adc0e5 100644 --- a/src/main/java/frc/robot/subsystems/climb/Climb.java +++ b/src/main/java/frc/robot/subsystems/climb/Climb.java @@ -2,18 +2,38 @@ import org.littletonrobotics.junction.AutoLogOutput; import org.littletonrobotics.junction.Logger; +import org.littletonrobotics.junction.inputs.LoggableInputs; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants.ClimbConstants; +import edu.wpi.first.math.controller.ArmFeedforward; +import edu.wpi.first.math.controller.PIDController; +import edu.wpi.first.math.trajectory.TrapezoidProfile; +import edu.wpi.first.math.trajectory.TrapezoidProfile; +import edu.wpi.first.wpilibj.DriverStation; + public class Climb extends SubsystemBase { //Auto logging output to something private ClimbIO io; private ClimbIOInputsAutoLogged inputs = new ClimbIOInputsAutoLogged(); + + +<<<<<<< Updated upstream +======= + //PID work? + private final PIDController pid = new PIDController(0.013, 0.0, 0); + private final TrapezoidProfile profile = new TrapezoidProfile(new TrapezoidProfile.Constraints(540, 540)); + private TrapezoidProfile.State goal = new TrapezoidProfile.State(0, 0); + private TrapezoidProfile.State setpoint = new TrapezoidProfile.State(); + public final ArmFeedforward feedforward = new ArmFeedforward(0.00, 0.0, 0.023); + + + - +>>>>>>> Stashed changes @AutoLogOutput // Setting up the boolean Varible, which is for right now isClimbed (Basic will be updated later) public boolean isClimbed = false; @@ -22,29 +42,51 @@ public Climb(ClimbIO io) { } public Command doClimbSequence() { + System.out.println("Climbing/Climbed"); + Logger.recordOutput("Climbing/Climbed", isClimbed); return Commands.sequence( Commands.startEnd( () -> io.runVoltage(ClimbConstants.INTAKE_VOLTAGE), () -> io.runVoltage(0.0) ) + ); } public Command unClimbSequence() { + isClimbed = false; + System.out.println("UnClimbing/UnClimbed"); + Logger.recordOutput("unClimbSequence", isClimbed); return Commands.sequence( Commands.startEnd( () -> io.runVoltage(ClimbConstants.OUTAKE_VOLTAGE), - () -> io.runVoltage(0.0) - ) + () -> io.runVoltage(0.0) + ) +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes ); } - // Updates the inputs of ClimbIO perodic. // ClimbIO takes the inputs and outputs of Climb from the contorller @Override public void periodic() { io.updateInputs(inputs); Logger.processInputs("Climb", inputs); + if (DriverStation.isDisabled()) { + setpoint = new TrapezoidProfile.State(inputs.absolutePosition, 0); + goal = setpoint; + } + + Logger.recordOutput("Slapdown/SetpointPosition", setpoint.position); + Logger.recordOutput("Slapdown/GoalPosition", goal.position); + setpoint = profile.calculate(0.02, setpoint, goal); + io.runPivotVoltage( + pid.calculate(inputs.absolutePosition, setpoint.position) + + feedforward.calculate(inputs.absolutePosition + 90, setpoint.velocity) + // use acutal position degrees to make sure that we always apply the correct gravity feed forward. + ); } -} +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/climb/ClimbIO.java b/src/main/java/frc/robot/subsystems/climb/ClimbIO.java index 195fe71..5352e52 100644 --- a/src/main/java/frc/robot/subsystems/climb/ClimbIO.java +++ b/src/main/java/frc/robot/subsystems/climb/ClimbIO.java @@ -9,6 +9,7 @@ public interface ClimbIO { class ClimbIOInputs { //Screw Rotations public double RPM = 0.0; + public double absolutePosition = 0.0; //The Volts being applied to Screw Motor public double appliedVolts = 0.0; @@ -16,6 +17,9 @@ class ClimbIOInputs { //The Amps Curently in Screw Motor public double currentAmps = 0.0; } + + // functions + //Updates inputs of Climb IO public default void updateInputs(ClimbIOInputs inputs) {}; @@ -33,4 +37,6 @@ class ClimbIOInputs { //gets the voltage of the motor public default void runScrewMotorVoltage(double volts) {} + + public default void stopMotors() {}; } \ No newline at end of file diff --git a/vendordeps/LumynLabs-2026.0.0.json b/vendordeps/LumynLabs-2026.1.2.json similarity index 60% rename from vendordeps/LumynLabs-2026.0.0.json rename to vendordeps/LumynLabs-2026.1.2.json index 7880bd2..a3d700c 100644 --- a/vendordeps/LumynLabs-2026.0.0.json +++ b/vendordeps/LumynLabs-2026.1.2.json @@ -1,7 +1,7 @@ { - "fileName": "LumynLabs-2026.0.0.json", + "fileName": "LumynLabs-2026.1.2.json", "name": "LumynLabs", - "version": "2026.0.0", + "version": "2026.1.2", "frcYear": "2026", "uuid": "eebd34fc-a6d3-48a2-a286-ac1cec59ab89", "mavenUrls": [ @@ -12,29 +12,14 @@ { "groupId": "com.lumynlabs.frc", "artifactId": "LumynLabs-java", - "version": "2026.0.0" + "version": "2026.1.2" } ], "jniDependencies": [ { "groupId": "com.lumynlabs.frc", "artifactId": "LumynLabs-driver", - "version": "2026.0.0", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxathena", - "linuxarm32", - "osxuniversal" - ] - }, - { - "groupId": "com.lumynlabs.frc", - "artifactId": "LumynLabs-common", - "version": "2026.0.0", + "version": "2026.1.2", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -51,7 +36,7 @@ { "groupId": "com.lumynlabs.frc", "artifactId": "LumynLabs-cpp", - "version": "2026.0.0", + "version": "2026.1.2", "libName": "Lumyn", "headerClassifier": "headers", "sharedLibrary": true, @@ -68,7 +53,7 @@ { "groupId": "com.lumynlabs.frc", "artifactId": "LumynLabs-driver", - "version": "2026.0.0", + "version": "2026.1.2", "libName": "LumynDriver", "headerClassifier": "headers", "sharedLibrary": true, @@ -81,23 +66,6 @@ "linuxarm32", "osxuniversal" ] - }, - { - "groupId": "com.lumynlabs.frc", - "artifactId": "LumynLabs-common", - "version": "2026.0.0", - "libName": "LumynCommon", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxathena", - "linuxarm32", - "osxuniversal" - ] } ] } \ No newline at end of file diff --git a/vendordeps/photonlib.json b/vendordeps/photonlib.json index a1bc5a5..afac990 100644 --- a/vendordeps/photonlib.json +++ b/vendordeps/photonlib.json @@ -1,7 +1,7 @@ { "fileName": "photonlib.json", "name": "photonlib", - "version": "v2026.1.1", + "version": "v2026.2.1", "uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004", "frcYear": "2026", "mavenUrls": [ @@ -13,7 +13,7 @@ { "groupId": "org.photonvision", "artifactId": "photontargeting-cpp", - "version": "v2026.1.1", + "version": "v2026.2.1", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -28,7 +28,7 @@ { "groupId": "org.photonvision", "artifactId": "photonlib-cpp", - "version": "v2026.1.1", + "version": "v2026.2.1", "libName": "photonlib", "headerClassifier": "headers", "sharedLibrary": true, @@ -43,7 +43,7 @@ { "groupId": "org.photonvision", "artifactId": "photontargeting-cpp", - "version": "v2026.1.1", + "version": "v2026.2.1", "libName": "photontargeting", "headerClassifier": "headers", "sharedLibrary": true, @@ -60,12 +60,12 @@ { "groupId": "org.photonvision", "artifactId": "photonlib-java", - "version": "v2026.1.1" + "version": "v2026.2.1" }, { "groupId": "org.photonvision", "artifactId": "photontargeting-java", - "version": "v2026.1.1" + "version": "v2026.2.1" } ] } \ No newline at end of file diff --git a/vendordeps/yams.json b/vendordeps/yams.json index 01bfad1..9557c14 100644 --- a/vendordeps/yams.json +++ b/vendordeps/yams.json @@ -1,7 +1,7 @@ { "fileName": "yams.json", "name": "Yet Another Mechanism System", - "version": "2026.1.23", + "version": "2026.2.3", "frcYear": "2026", "uuid": "a1051e86-a979-4880-a28b-a0d5362d1d96", "mavenUrls": [ @@ -12,7 +12,7 @@ { "groupId": "yams", "artifactId": "YAMS-java", - "version": "2026.1.23" + "version": "2026.2.3" } ], "cppDependencies": [], From 0248de651fff2924bb45cef2f3de7f00590990e8 Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Sat, 7 Feb 2026 14:11:40 -0500 Subject: [PATCH 21/26] Might have fixed my gihub --- Dreadbots2026 | 1 + 1 file changed, 1 insertion(+) create mode 160000 Dreadbots2026 diff --git a/Dreadbots2026 b/Dreadbots2026 new file mode 160000 index 0000000..d11e292 --- /dev/null +++ b/Dreadbots2026 @@ -0,0 +1 @@ +Subproject commit d11e292e48db7bd8f0eaaea9c28378b4ba6f4749 From a3675ea7d2c93730df48b0064816aa6b2d65a946 Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Tue, 10 Feb 2026 15:27:25 -0500 Subject: [PATCH 22/26] Git working? Randomley? PLease? --- src/main/java/frc/robot/BuildConstants.java | 10 +++++----- .../java/frc/robot/subsystems/climb/Climb.java | 15 ++++----------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 9bf20b3..9227f8e 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 33; - public static final String GIT_SHA = "4fda026e075a86f913db9f917a2383c65f1fb510"; - public static final String GIT_DATE = "2026-01-31 14:35:47 EST"; + public static final int GIT_REVISION = 36; + public static final String GIT_SHA = "0248de651fff2924bb45cef2f3de7f00590990e8"; + public static final String GIT_DATE = "2026-02-07 14:11:40 EST"; public static final String GIT_BRANCH = "Climb"; - public static final String BUILD_DATE = "2026-02-05 16:40:52 EST"; - public static final long BUILD_UNIX_TIME = 1770327652643L; + public static final String BUILD_DATE = "2026-02-09 17:42:39 EST"; + public static final long BUILD_UNIX_TIME = 1770676959719L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc/robot/subsystems/climb/Climb.java b/src/main/java/frc/robot/subsystems/climb/Climb.java index 7adc0e5..c5d637a 100644 --- a/src/main/java/frc/robot/subsystems/climb/Climb.java +++ b/src/main/java/frc/robot/subsystems/climb/Climb.java @@ -21,9 +21,7 @@ public class Climb extends SubsystemBase { private ClimbIOInputsAutoLogged inputs = new ClimbIOInputsAutoLogged(); -<<<<<<< Updated upstream -======= - //PID work? + //PID work? private final PIDController pid = new PIDController(0.013, 0.0, 0); private final TrapezoidProfile profile = new TrapezoidProfile(new TrapezoidProfile.Constraints(540, 540)); private TrapezoidProfile.State goal = new TrapezoidProfile.State(0, 0); @@ -33,7 +31,6 @@ public class Climb extends SubsystemBase { ->>>>>>> Stashed changes @AutoLogOutput // Setting up the boolean Varible, which is for right now isClimbed (Basic will be updated later) public boolean isClimbed = false; @@ -62,10 +59,6 @@ public Command unClimbSequence() { () -> io.runVoltage(ClimbConstants.OUTAKE_VOLTAGE), () -> io.runVoltage(0.0) ) -<<<<<<< Updated upstream -======= - ->>>>>>> Stashed changes ); } @@ -80,10 +73,10 @@ public void periodic() { goal = setpoint; } - Logger.recordOutput("Slapdown/SetpointPosition", setpoint.position); - Logger.recordOutput("Slapdown/GoalPosition", goal.position); + Logger.recordOutput("Climb/SetpointPosition", setpoint.position); + Logger.recordOutput("Climb/GoalPosition", goal.position); setpoint = profile.calculate(0.02, setpoint, goal); - io.runPivotVoltage( + io.runScrewMotorVoltage( pid.calculate(inputs.absolutePosition, setpoint.position) + feedforward.calculate(inputs.absolutePosition + 90, setpoint.velocity) // use acutal position degrees to make sure that we always apply the correct gravity feed forward. From f112bc53527ceb5a263bc8876cb253ab4ca6fa3d Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Tue, 10 Feb 2026 15:35:52 -0500 Subject: [PATCH 23/26] Git Folder made? --- src/main/java/frc/robot/subsystems/slapdown/slapdown.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/java/frc/robot/subsystems/slapdown/slapdown.java diff --git a/src/main/java/frc/robot/subsystems/slapdown/slapdown.java b/src/main/java/frc/robot/subsystems/slapdown/slapdown.java new file mode 100644 index 0000000..e69de29 From 6873b464290370b958336c0bcf2bcae7eca3315f Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Tue, 10 Feb 2026 16:01:27 -0500 Subject: [PATCH 24/26] Slapdown Setup --- .../robot/subsystems/slapdown/SlapdownIO.java | 45 ++++++++++ .../subsystems/slapdown/SlapdownIOSim.java | 67 +++++++++++++++ .../slapdown/SlapdownIOSparkMax.java | 86 +++++++++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 src/main/java/frc/robot/subsystems/slapdown/SlapdownIO.java create mode 100644 src/main/java/frc/robot/subsystems/slapdown/SlapdownIOSim.java create mode 100644 src/main/java/frc/robot/subsystems/slapdown/SlapdownIOSparkMax.java diff --git a/src/main/java/frc/robot/subsystems/slapdown/SlapdownIO.java b/src/main/java/frc/robot/subsystems/slapdown/SlapdownIO.java new file mode 100644 index 0000000..6de66f7 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/slapdown/SlapdownIO.java @@ -0,0 +1,45 @@ +package frc.robot.subsystems.slapdown; + +import org.littletonrobotics.junction.AutoLog; + +import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; + +public interface SlapdownIO { + + @AutoLog + public static class SlapdownIOInputs { + + + //The Volts + public double pivotAppliedVolts = 0.0; + public double intakeAppliedVolts = 0.0; + + //Current + public double pivotCurrentAmps = 0.0; + public double intakeCurrentAmps = 0.0; + + //Rotating By Degrees + public double pivotRotationDegrees = 0.0; + + //RPM + public double intakeRPM = 0.0; + public double absolutePosition = 0.0; + + //Temp + public double intakeTemperature = 0.0; + public double pivotTemperature = 0.0; + + } + + + // functions + public default void updateInputs(SlapdownIOInputs inputs) {}; + + public default void runPivotVoltage(double volts) {} + + public default void runIntakeVoltage(double volts) {} + + public default void setIdleMode(IdleMode pivotIdleMode, IdleMode intakeIdleMode) {}; + + public default void stopMotors() {}; +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/slapdown/SlapdownIOSim.java b/src/main/java/frc/robot/subsystems/slapdown/SlapdownIOSim.java new file mode 100644 index 0000000..8364da3 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/slapdown/SlapdownIOSim.java @@ -0,0 +1,67 @@ +package frc.robot.subsystems.slapdown; + +import edu.wpi.first.math.system.plant.DCMotor; +import edu.wpi.first.math.system.plant.LinearSystemId; +import edu.wpi.first.math.util.Units; +import edu.wpi.first.wpilibj.simulation.DCMotorSim; +import edu.wpi.first.wpilibj.simulation.SingleJointedArmSim; +import frc.robot.Constants.SlapdownConstants; + + +public class SlapdownIOSim implements SlapdownIO { + + private final SingleJointedArmSim slapdown; + private final DCMotorSim intakeMotor; + + private double pivotVolts; + private double intakeVolts; + + + public SlapdownIOSim() { + this.slapdown = new SingleJointedArmSim( + DCMotor.getNeoVortex(1), + 50.0, + SlapdownConstants.SIM_PIVOT_MOI, + Units.inchesToMeters(16), + Units.degreesToRadians(-20), + Units.degreesToRadians(90), + true, + Units.degreesToRadians(0) + ); + this.intakeMotor = new DCMotorSim( + LinearSystemId.createDCMotorSystem(DCMotor.getNEO(1), SlapdownConstants.SIM_INTAKE_MOI, 2), + DCMotor.getNEO(1) + ); + pivotVolts = 0.0; + intakeVolts = 0.0; + + } + + @Override + public void updateInputs(SlapdownIOInputs inputs) { + slapdown.update(0.02); + intakeMotor.update(0.02); + + inputs.pivotAppliedVolts = pivotVolts; + inputs.intakeAppliedVolts = intakeVolts; + + inputs.pivotCurrentAmps = slapdown.getCurrentDrawAmps(); + inputs.intakeCurrentAmps = intakeMotor.getCurrentDrawAmps(); + + inputs.pivotRotationDegrees = Units.radiansToDegrees(slapdown.getAngleRads()); + + inputs.intakeRPM = intakeMotor.getAngularVelocityRPM(); + } + + @Override + public void runPivotVoltage(double volts) { + slapdown.setInputVoltage(volts); + this.pivotVolts = volts; + } + @Override + public void runIntakeVoltage(double volts) { + intakeMotor.setInputVoltage(volts); + this.intakeVolts = volts; + } + +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/slapdown/SlapdownIOSparkMax.java b/src/main/java/frc/robot/subsystems/slapdown/SlapdownIOSparkMax.java new file mode 100644 index 0000000..80cc67c --- /dev/null +++ b/src/main/java/frc/robot/subsystems/slapdown/SlapdownIOSparkMax.java @@ -0,0 +1,86 @@ +package frc.robot.subsystems.slapdown; + +import com.revrobotics.spark.SparkBase; +import com.revrobotics.spark.SparkFlex; +import com.revrobotics.spark.SparkMax; +import com.revrobotics.spark.SparkBase.PersistMode; +import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.spark.SparkLowLevel.MotorType; +import com.revrobotics.spark.config.SparkMaxConfig; +import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; + +import edu.wpi.first.wpilibj.DigitalInput; +import edu.wpi.first.wpilibj.DutyCycleEncoder; +import frc.robot.Constants.SlapdownConstants; + + +public class SlapdownIOSparkMax implements SlapdownIO { + + private final SparkBase intakeMotor; + private final SparkBase pivotMotor; + private final DutyCycleEncoder absoluteEncoder; + + public SlapdownIOSparkMax() { + this.absoluteEncoder = new DutyCycleEncoder(new DigitalInput(SlapdownConstants.SLAPDOWN_DUTY_CYCLE_ENCODER), 360, 0); //Update code with the 0 and max angle + absoluteEncoder.setAssumedFrequency(SlapdownConstants.ENCODER_FREQUENCY); + this.intakeMotor = new SparkMax(SlapdownConstants.INTAKE_MOTOR_ID, MotorType.kBrushless); + this.pivotMotor = new SparkFlex(SlapdownConstants.PIVOT_MOTOR_ID, MotorType.kBrushless); + SparkMaxConfig intakeConfig = new SparkMaxConfig(); + SparkMaxConfig pivotConfig = new SparkMaxConfig(); + + intakeConfig + .idleMode(IdleMode.kBrake); + intakeMotor.configure(intakeConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); + pivotConfig + .idleMode(IdleMode.kBrake); + pivotMotor.configure(pivotConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); + } + + @Override + public void updateInputs(SlapdownIOInputs inputs) { + inputs.absolutePosition = absoluteEncoder.get() - SlapdownConstants.ENCODER_OFFSET; + inputs.intakeRPM = intakeMotor.getEncoder().getVelocity(); + + inputs.intakeAppliedVolts = intakeMotor.getAppliedOutput() * intakeMotor.getBusVoltage(); + inputs.intakeCurrentAmps = intakeMotor.getOutputCurrent(); + inputs.intakeTemperature = intakeMotor.getMotorTemperature(); + + inputs.pivotAppliedVolts = pivotMotor.getAppliedOutput() * pivotMotor.getBusVoltage(); + inputs.pivotCurrentAmps = pivotMotor.getOutputCurrent(); + inputs.pivotTemperature = pivotMotor.getMotorTemperature(); + + inputs.pivotRotationDegrees = absoluteEncoder.get(); + } + + @Override + public void runIntakeVoltage(double voltage) { + intakeMotor.setVoltage(voltage); + } + + @Override + public void setIdleMode(IdleMode pivotIdleMode, IdleMode intakeIdleMode) { + SparkMaxConfig pivotConfig = new SparkMaxConfig(); + pivotConfig.idleMode(pivotIdleMode); + SparkMaxConfig intakeConfig = new SparkMaxConfig(); + intakeConfig.idleMode(intakeIdleMode); + /* + * Don't reset parameters + don't save this config if reboot hapens. + * This is ony if we need to switch out of break mode for some reason + */ + intakeMotor.configure(intakeConfig, ResetMode.kNoResetSafeParameters, PersistMode.kNoPersistParameters); + pivotMotor.configure(pivotConfig, ResetMode.kNoResetSafeParameters, PersistMode.kNoPersistParameters); + } + + @Override + public void stopMotors() { + intakeMotor.setVoltage(0); + intakeMotor.stopMotor(); + pivotMotor.setVoltage(0); + pivotMotor.stopMotor(); + } + + @Override + public void runPivotVoltage(double voltage){ + pivotMotor.setVoltage(voltage); + } + } \ No newline at end of file From 4c40382dd26c43ed87d2d8efdc9a7018bf93e481 Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Thu, 12 Feb 2026 16:07:04 -0500 Subject: [PATCH 25/26] Slapdown with all files --- src/main/java/frc/robot/BuildConstants.java | 12 +-- src/main/java/frc/robot/Constants.java | 20 +++++ src/main/java/frc/robot/RobotContainer.java | 9 ++- .../robot/subsystems/slapdown/slapdown.java | 80 +++++++++++++++++++ 4 files changed, 113 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 9227f8e..a40fd05 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 36; - public static final String GIT_SHA = "0248de651fff2924bb45cef2f3de7f00590990e8"; - public static final String GIT_DATE = "2026-02-07 14:11:40 EST"; - public static final String GIT_BRANCH = "Climb"; - public static final String BUILD_DATE = "2026-02-09 17:42:39 EST"; - public static final long BUILD_UNIX_TIME = 1770676959719L; + public static final int GIT_REVISION = 39; + public static final String GIT_SHA = "6873b464290370b958336c0bcf2bcae7eca3315f"; + public static final String GIT_DATE = "2026-02-10 16:01:27 EST"; + public static final String GIT_BRANCH = "Slapdown"; + public static final String BUILD_DATE = "2026-02-12 16:05:58 EST"; + public static final long BUILD_UNIX_TIME = 1770930358436L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 98b65b2..825307e 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -21,6 +21,26 @@ public static class IndexerConstants { public static final int MOTOR_ID = 1; } + public static class SlapdownConstants { + public static final double INTAKE_VOLTAGE = -5.0; + public static final double OUTAKE_VOLTAGE = 5.0; + public static final int SLAPDOWN_DUTY_CYCLE_ENCODER = 8; + public static final double ENCODER_OFFSET = 108.125; + public static final double HOME_ANGLE_DEGREES = 0; + public static final double OUTTAKE_ANGLE_DEGREES = 3; + public static final double INTAKE_ANGLE_DEGREES = 60.0; + public static final double HOLD_ANGLE_DEGREES = 14.0; + public static final double MAX_ANGLE_DEGREES = 80.0; + public static final double ENCODER_FREQUENCY = 975.6; + public static final int INTAKE_MOTOR_ID = 20; + public static final int PIVOT_MOTOR_ID = 18; + + public static final double SIM_INTAKE_MOI = 0.00011264; + public static final double SIM_PIVOT_MOI = 0.15180934; + + } + + public static class FlywheelConstants { public static final double SHOOT_VOLTAGE = 3.0; public static final int MOTOR_ID_1 = 13; diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 131e31d..759658b 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -24,6 +24,7 @@ import frc.robot.subsystems.vision.VisionIOCamera; import frc.robot.subsystems.flywheel.*; +import frc.robot.subsystems.slapdown.*; import frc.robot.subsystems.climb.*; public class RobotContainer { @@ -35,6 +36,7 @@ public class RobotContainer { private final List cameras; private final Flywheel flywheel; private final Climb climb; + private final Slapdown slapdown; public RobotContainer() { switch (Constants.currentMode) { @@ -93,6 +95,7 @@ public RobotContainer() { flywheel = new Flywheel(new FlywheelIOSim()); //flywheel = new Flywheel(new FlywheelIOSparkFlex()); climb = new Climb(new ClimbIOSparkFlex()); + slapdown = new Slapdown(new SlapdownIOSparkMax()); break; @@ -126,7 +129,7 @@ public RobotContainer() { flywheel = new Flywheel(new FlywheelIOSim()); // turret = new Turret(new TurretIOSim()); - + slapdown = new Slapdown(new SlapdownIOSim()); climb = new Climb(new ClimbIOSim()); break; @@ -161,6 +164,7 @@ public RobotContainer() { climb = new Climb(new ClimbIO() {}); flywheel = new Flywheel(new FlywheelIOSim()); + slapdown = new Slapdown(new SlapdownIOSparkMax()); // turret = new Turret(new TurretIO() {}); break; } @@ -197,7 +201,8 @@ private void configureButtonBindings() { primaryController.rightTrigger().whileTrue(climb.doClimbSequence()); primaryController.leftTrigger().whileTrue(climb.unClimbSequence()); - + primaryController.rightTrigger().whileTrue(slapdown.intakeSequence()); + primaryController.leftTrigger().whileTrue(slapdown.outtakeSequence()); } public Command getAutonomousCommand() { return null; //choreoAutoChooser.selectedCommand(); diff --git a/src/main/java/frc/robot/subsystems/slapdown/slapdown.java b/src/main/java/frc/robot/subsystems/slapdown/slapdown.java index e69de29..044894f 100644 --- a/src/main/java/frc/robot/subsystems/slapdown/slapdown.java +++ b/src/main/java/frc/robot/subsystems/slapdown/slapdown.java @@ -0,0 +1,80 @@ +package frc.robot.subsystems.slapdown; + +import org.littletonrobotics.junction.Logger; + +import edu.wpi.first.math.controller.ArmFeedforward; +import edu.wpi.first.math.controller.PIDController; +import edu.wpi.first.math.trajectory.TrapezoidProfile; +import edu.wpi.first.wpilibj.DriverStation; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants.SlapdownConstants; + +public class Slapdown extends SubsystemBase { + + + private final SlapdownIOInputsAutoLogged inputs = new SlapdownIOInputsAutoLogged(); + private final SlapdownIO io; + public final PIDController pid = new PIDController(0.013, 0.0, 0); + public final ArmFeedforward feedforward = new ArmFeedforward(0.00, 0.0, 0.023); + private final TrapezoidProfile profile = new TrapezoidProfile(new TrapezoidProfile.Constraints(540, 540)); + private TrapezoidProfile.State goal = new TrapezoidProfile.State(0, 0); + private TrapezoidProfile.State setpoint = new TrapezoidProfile.State(); + + public Slapdown(SlapdownIO io) { + this.io = io; + } + + public Command intakeSequence() { + return Commands.sequence( + setAngleDegrees(SlapdownConstants.INTAKE_ANGLE_DEGREES), + Commands.startEnd( + () -> io.runIntakeVoltage(SlapdownConstants.INTAKE_VOLTAGE), + () -> io.runIntakeVoltage(0.0) + ) + ).finallyDo( + () -> { + goal = new TrapezoidProfile.State(SlapdownConstants.HOLD_ANGLE_DEGREES, 0); + }); + } + + public Command outtakeSequence() { + return Commands.sequence( + setAngleDegrees(SlapdownConstants.OUTTAKE_ANGLE_DEGREES), + Commands.startEnd( + () -> io.runIntakeVoltage(SlapdownConstants.OUTAKE_VOLTAGE), + () -> io.runIntakeVoltage(0.0) + ) + ); + } + + @Override + public void periodic() { + io.updateInputs(inputs); + Logger.processInputs("SlapdownIntake", inputs); + if (DriverStation.isDisabled()) { + setpoint = new TrapezoidProfile.State(inputs.absolutePosition, 0); + goal = setpoint; + } + + Logger.recordOutput("Slapdown/SetpointPosition", setpoint.position); + Logger.recordOutput("Slapdown/GoalPosition", goal.position); + setpoint = profile.calculate(0.02, setpoint, goal); + io.runPivotVoltage( + pid.calculate(inputs.absolutePosition, setpoint.position) + + feedforward.calculate(inputs.absolutePosition + 90, setpoint.velocity) + // use acutal position degrees to make sure that we always apply the correct gravity feed forward. + ); + } + + public Command setAngleDegrees(double angle) { + return runOnce( + () -> { + goal = new TrapezoidProfile.State(angle, 0); + } ); + } + public double getAngle() { + return inputs.pivotRotationDegrees; + } +} \ No newline at end of file From c551be04c2eb77758f64b32be97e0e73ba3bedcc Mon Sep 17 00:00:00 2001 From: Low-Debug Date: Sat, 14 Feb 2026 10:28:19 -0500 Subject: [PATCH 26/26] Slapdown toggle 3 commands needs controls setup --- src/main/java/frc/robot/BuildConstants.java | 10 +++++----- src/main/java/frc/robot/RobotContainer.java | 10 +++++++--- .../robot/subsystems/slapdown/slapdown.java | 18 ++++++++++-------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index a40fd05..65253fe 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Dreadbots2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 39; - public static final String GIT_SHA = "6873b464290370b958336c0bcf2bcae7eca3315f"; - public static final String GIT_DATE = "2026-02-10 16:01:27 EST"; + public static final int GIT_REVISION = 40; + public static final String GIT_SHA = "4c40382dd26c43ed87d2d8efdc9a7018bf93e481"; + public static final String GIT_DATE = "2026-02-12 16:07:04 EST"; public static final String GIT_BRANCH = "Slapdown"; - public static final String BUILD_DATE = "2026-02-12 16:05:58 EST"; - public static final long BUILD_UNIX_TIME = 1770930358436L; + public static final String BUILD_DATE = "2026-02-14 10:26:57 EST"; + public static final long BUILD_UNIX_TIME = 1771082817325L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 759658b..2360917 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -197,13 +197,17 @@ private void configureButtonBindings() { - // //Slapdown Algae Buttons (Left Trigger Intakes wheels/ Right Trigger Outakes wheels) (D-pad Up will pull in the intake system while D-pad down will push the intake system out to grab Algae) + // Climb controls primaryController.rightTrigger().whileTrue(climb.doClimbSequence()); primaryController.leftTrigger().whileTrue(climb.unClimbSequence()); - primaryController.rightTrigger().whileTrue(slapdown.intakeSequence()); - primaryController.leftTrigger().whileTrue(slapdown.outtakeSequence()); + + // Slapdwon controls + primaryController.rightTrigger().whileTrue(slapdown.slapDownSequence()); + primaryController.leftTrigger().whileTrue(slapdown.slapUpSequence()); + primaryController.rightTrigger().whileTrue(slapdown.intakeMotorSequence()); } + public Command getAutonomousCommand() { return null; //choreoAutoChooser.selectedCommand(); } diff --git a/src/main/java/frc/robot/subsystems/slapdown/slapdown.java b/src/main/java/frc/robot/subsystems/slapdown/slapdown.java index 044894f..3f487b6 100644 --- a/src/main/java/frc/robot/subsystems/slapdown/slapdown.java +++ b/src/main/java/frc/robot/subsystems/slapdown/slapdown.java @@ -26,22 +26,24 @@ public Slapdown(SlapdownIO io) { this.io = io; } - public Command intakeSequence() { + public Command slapDownSequence() { return Commands.sequence( - setAngleDegrees(SlapdownConstants.INTAKE_ANGLE_DEGREES), - Commands.startEnd( - () -> io.runIntakeVoltage(SlapdownConstants.INTAKE_VOLTAGE), - () -> io.runIntakeVoltage(0.0) - ) + setAngleDegrees(SlapdownConstants.INTAKE_ANGLE_DEGREES) + ).finallyDo( () -> { goal = new TrapezoidProfile.State(SlapdownConstants.HOLD_ANGLE_DEGREES, 0); }); } - public Command outtakeSequence() { + public Command slapUpSequence() { + return Commands.sequence( + setAngleDegrees(SlapdownConstants.OUTTAKE_ANGLE_DEGREES) + ); + } + + public Command intakeMotorSequence() { return Commands.sequence( - setAngleDegrees(SlapdownConstants.OUTTAKE_ANGLE_DEGREES), Commands.startEnd( () -> io.runIntakeVoltage(SlapdownConstants.OUTAKE_VOLTAGE), () -> io.runIntakeVoltage(0.0)