Skip to content

Commit

Permalink
shooter won't say its good if we are just idle reving
Browse files Browse the repository at this point in the history
  • Loading branch information
rflood07 committed Mar 28, 2024
1 parent a4305c6 commit 08685c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/frc/robot/commands/IndexCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class IndexCommand extends Command {
BooleanSupplier OverStagePassSup;
boolean auto;
double runsEmpty = 0;
boolean idleReving;

/**
* A command to manage the control of notes throughout the robot. This command controls the Intake, Shooter, and Indexer. If any of these preferences are turned off, the command should not be initialized. If
Expand Down Expand Up @@ -97,6 +98,7 @@ public IndexCommand(IndexerSubsystem m_IndexerSubsystem, BooleanSupplier shootIf
@Override
public void initialize() {
runsEmpty = 0;
idleReving = false;
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down Expand Up @@ -131,6 +133,7 @@ public void execute() {
runsEmpty = 0;
intake.intakeOff();
if(revUpSupplier.getAsBoolean()||stageAngleSup.getAsBoolean()||subwooferAngleSup.getAsBoolean()||OverStagePassSup.getAsBoolean()) {
idleReving = false;
if(OverStagePassSup.getAsBoolean()) {
shooter.shootRPS(ShooterConstants.PASS_RPS);
} else {
Expand All @@ -139,13 +142,15 @@ public void execute() {
} else {
if (operatorRevSup.getAsBoolean()){
shooter.shootRPS(PASS_RPS);
idleReving = false;
} else {
// shooter.turnOff();
shooter.shootRPSWithCurrent(LONG_SHOOTING_RPS, 20, 30);
idleReving = true;
}
}
boolean indexer = false;
if(angleShooterSubsytem.validShot() && drivetrain.validShot() && shooter.validShot() && shooter.isReving()) {
if(angleShooterSubsytem.validShot() && drivetrain.validShot() && shooter.validShot() && shooter.isReving()&&!idleReving) {
RobotState.getInstance().ShooterReady = true;
if (shootIfReadySupplier.getAsBoolean()) {
indexer = true;
Expand Down

0 comments on commit 08685c7

Please sign in to comment.