Adjusted shooter RPM code

This commit is contained in:
Team2890HawkCollective
2026-02-20 17:55:41 -05:00
parent 7eb5122c55
commit 846ceca1e8
4 changed files with 23 additions and 63 deletions

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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,