From 846ceca1e821bcc6d3e8e36f8d342c71e0d6617a Mon Sep 17 00:00:00 2001 From: Team2890HawkCollective <2890frc@gmail.com> Date: Fri, 20 Feb 2026 17:55:41 -0500 Subject: [PATCH] Adjusted shooter RPM code --- src/main/java/frc/robot/Constants.java | 8 +-- .../robot/subsystems/ShooterSubsystem.java | 20 +++---- .../robot/subsystems/TargetingSubsystems.java | 4 +- vendordeps/REVLib.json | 54 ++++--------------- 4 files changed, 23 insertions(+), 63 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 9771c38..e9c5feb 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -71,8 +71,7 @@ public final class Constants { private static GenericEntry shooterVelocity = programmingTab.add("Desired Shooter RPM", -1000) .withWidget(BuiltInWidgets.kNumberBar).getEntry(); - public static double SHOOTER_RPM = -0.6; - public static double SHOOTER_POWER = -0.45; + public static double SHOOTER_RPM; public static void getShooterVelocity() { SHOOTER_RPM = shooterVelocity.getDouble(-1000); @@ -87,6 +86,7 @@ public final class Constants { public static double SHOOTER_MOTOR_P = 0.001; public static double SHOOTER_MOTOR_I = 0; public static double SHOOTER_MOTOR_D = 0; + private static GenericEntry indexerAndRampRPM = programmingTab.add("Desired Ramp + Indexer Speed", 1000) .withWidget(BuiltInWidgets.kNumberBar).getEntry(); @@ -113,7 +113,6 @@ public final class Constants { public static final int INTAKE_WHEELS_MOTOR_ID = 50; public static final int INTAKE_ROTATOR_MOTOR_ID = 51; - public static class IntakeRotatorPID { public static final double INTAKE_ROTATOR_P = 0.01; @@ -124,7 +123,7 @@ public final class Constants { public static final double INTAKE_COLLECT_ENCODER_VALUE = 4.1290459632873535; public static final double INTAKE_MIDDLE_ENCODER_VALUE = 1.2550222873687744; public static final double INTAKE_RETRACT_ENCODER_VALUE = 0; - } + } public static class RampConstants { public static final int RAMP_MOTOR_ID = 45; @@ -138,6 +137,7 @@ public final class Constants { public static void getRampMotorSpeed() { RAMP_MOTOR_SPEED = rampSpeed.getDouble(0.4); } + public static double RAMP_MOTOR_SPEED = .6; // create object and a new widget under programming tab in Elastic where object diff --git a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java index eba0ce2..235523f 100644 --- a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java @@ -104,33 +104,29 @@ public class ShooterSubsystem extends SubsystemBase { } public void setIndexerAndRampMotorRPM() { - // if (LimelightHelpers.getTX("limelight") < 1.5 && - // LimelightHelpers.getTX("limelight") > -1.5) { indexerAndRampMotorPIDController.setSetpoint(Constants.ShooterConstants.INDEXER_AND_RAMP_MOTOR_RPM, ControlType.kVelocity); - // } else - // indexerMotor.set(0); } - /* public Command shootFuelCommand() { - return run(() -> startShooterMotors()) + public Command shootFuelCommand() { + return run(() -> setShooterMotorsRPM()) .until(() -> { - return (getShooterMotorVelocity() >= Constants.ShooterConstants.SHOOTER_VELOCITY); + return (getShooterMotorRPM() >= Constants.ShooterConstants.SHOOTER_RPM); }) - .andThen(() -> startIndexerMotor()); - } */ + .andThen(() -> setIndexerAndRampMotorRPM()); + } - public Command shootFuelCommand() { + /* public Command shootFuelCommand() { return runOnce(() -> setShooterMotorsRPM()).andThen(new WaitCommand(2)) .andThen(() -> setIndexerAndRampMotorRPM()); - }; + }; */ public void stopShooters() { centerShooterMotor.set(0); leftShooterMotor.set(0); - //rightShooterMotor.set(0); + rightShooterMotor.set(0); indexerAndRampMotor.set(0); } diff --git a/src/main/java/frc/robot/subsystems/TargetingSubsystems.java b/src/main/java/frc/robot/subsystems/TargetingSubsystems.java index e4ba6c4..ba4a19e 100644 --- a/src/main/java/frc/robot/subsystems/TargetingSubsystems.java +++ b/src/main/java/frc/robot/subsystems/TargetingSubsystems.java @@ -92,7 +92,7 @@ public class TargetingSubsystems extends SubsystemBase { double angleSpeed = angleController.calculate(currentRobotPose.getRotation().getRadians(), desiredPose.getRotation().getRadians()); - swerveDrive.drive(new Translation2d(xSpeed, ySpeed), angleSpeed, true); + swerveDrive.drive(new Translation2d(xSpeed, ySpeed), angleSpeed, false); }, swerveDrive); } @@ -108,7 +108,7 @@ public class TargetingSubsystems extends SubsystemBase { rot = MathUtil.clamp(rot, -3.0, 3.0); swerveDrive.drive(new Translation2d(driverXbox.getLeftY() * -1, - driverXbox.getLeftX() * -1), rot, true); + driverXbox.getLeftX() * -1), rot, false); }, swerveDrive); } diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json index 5e93833..a5af3e9 100644 --- a/vendordeps/REVLib.json +++ b/vendordeps/REVLib.json @@ -1,11 +1,7 @@ { "fileName": "REVLib.json", "name": "REVLib", -<<<<<<< HEAD - "version": "2026.0.1", -======= - "version": "2026.0.2", ->>>>>>> a50d67d7f53337b144e2b1afb5f7b644747fb21f + "version": "2026.0.3", "frcYear": "2026", "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", "mavenUrls": [ @@ -16,22 +12,14 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-java", -<<<<<<< HEAD - "version": "2026.0.1" -======= - "version": "2026.0.2" ->>>>>>> a50d67d7f53337b144e2b1afb5f7b644747fb21f + "version": "2026.0.3" } ], "jniDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", -<<<<<<< HEAD - "version": "2026.0.1", -======= - "version": "2026.0.2", ->>>>>>> a50d67d7f53337b144e2b1afb5f7b644747fb21f + "version": "2026.0.3", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -46,11 +34,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "RevLibBackendDriver", -<<<<<<< HEAD - "version": "2026.0.1", -======= - "version": "2026.0.2", ->>>>>>> a50d67d7f53337b144e2b1afb5f7b644747fb21f + "version": "2026.0.3", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -65,11 +49,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "RevLibWpiBackendDriver", -<<<<<<< HEAD - "version": "2026.0.1", -======= - "version": "2026.0.2", ->>>>>>> a50d67d7f53337b144e2b1afb5f7b644747fb21f + "version": "2026.0.3", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -86,11 +66,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-cpp", -<<<<<<< HEAD - "version": "2026.0.1", -======= - "version": "2026.0.2", ->>>>>>> a50d67d7f53337b144e2b1afb5f7b644747fb21f + "version": "2026.0.3", "libName": "REVLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -107,11 +83,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", -<<<<<<< HEAD - "version": "2026.0.1", -======= - "version": "2026.0.2", ->>>>>>> a50d67d7f53337b144e2b1afb5f7b644747fb21f + "version": "2026.0.3", "libName": "REVLibDriver", "headerClassifier": "headers", "sharedLibrary": false, @@ -128,11 +100,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "RevLibBackendDriver", -<<<<<<< HEAD - "version": "2026.0.1", -======= - "version": "2026.0.2", ->>>>>>> a50d67d7f53337b144e2b1afb5f7b644747fb21f + "version": "2026.0.3", "libName": "BackendDriver", "sharedLibrary": true, "skipInvalidPlatforms": true, @@ -148,11 +116,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "RevLibWpiBackendDriver", -<<<<<<< HEAD - "version": "2026.0.1", -======= - "version": "2026.0.2", ->>>>>>> a50d67d7f53337b144e2b1afb5f7b644747fb21f + "version": "2026.0.3", "libName": "REVLibWpi", "sharedLibrary": true, "skipInvalidPlatforms": true,