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