Skip to content

Commit

Permalink
indexer is off unless ground intake or source intake is on
Browse files Browse the repository at this point in the history
  • Loading branch information
trixydevs committed Feb 28, 2024
1 parent 935f6ba commit eefbfb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private void indexInit() {
indexer = new IndexerSubsystem();
}
private void indexCommandInst() {
defaulNoteHandlingCommand = new IndexCommand(indexer, ShootIfReadySup, AimWhileMovingSup, shooter, intake, driveTrain, angleShooterSubsystem, HumanPlaySup, StageAngleSup, SubwooferAngleSup);
defaulNoteHandlingCommand = new IndexCommand(indexer, ShootIfReadySup, AimWhileMovingSup, shooter, intake, driveTrain, angleShooterSubsystem, HumanPlaySup, StageAngleSup, SubwooferAngleSup, GroundIntakeSup);
indexer.setDefaultCommand(defaulNoteHandlingCommand);
}

Expand Down
12 changes: 10 additions & 2 deletions src/main/java/frc/robot/commands/IndexCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.settings.Constants.Field;
import frc.robot.settings.Constants.IndexerConstants;
import frc.robot.settings.Constants.IntakeConstants;
import frc.robot.settings.Constants.ShooterConstants;
import frc.robot.subsystems.AngleShooterSubsystem;
import frc.robot.subsystems.DrivetrainSubsystem;
Expand All @@ -28,6 +29,7 @@ public class IndexCommand extends Command {
Boolean revUp;
BooleanSupplier shootIfReadySupplier;
DoubleSupplier ampSupplier;;
BooleanSupplier groundIntakeSup;
Boolean shootIfReady;
// DoubleSupplier POVSupplier;
BooleanSupplier humanPlayerSupplier;
Expand All @@ -42,7 +44,7 @@ public class IndexCommand extends Command {
double runsEmpty = 0;

/** Creates a new IndexCommand. */
public IndexCommand(IndexerSubsystem m_IndexerSubsystem, BooleanSupplier shootIfReadySupplier, BooleanSupplier revUpSupplier, ShooterSubsystem shooter, IntakeSubsystem intake, DrivetrainSubsystem drivetrain, AngleShooterSubsystem angleShooterSubsystem, BooleanSupplier humanPlaySupplier, BooleanSupplier stageAngleSup, BooleanSupplier SubwooferSup) {
public IndexCommand(IndexerSubsystem m_IndexerSubsystem, BooleanSupplier shootIfReadySupplier, BooleanSupplier revUpSupplier, ShooterSubsystem shooter, IntakeSubsystem intake, DrivetrainSubsystem drivetrain, AngleShooterSubsystem angleShooterSubsystem, BooleanSupplier humanPlaySupplier, BooleanSupplier stageAngleSup, BooleanSupplier SubwooferSup, BooleanSupplier groundIntakeSup) {
this.m_Indexer = m_IndexerSubsystem;
this.shootIfReadySupplier = shootIfReadySupplier;//R2
this.revUpSupplier = revUpSupplier;//L2
Expand All @@ -53,6 +55,7 @@ public IndexCommand(IndexerSubsystem m_IndexerSubsystem, BooleanSupplier shootIf
this.humanPlayerSupplier = humanPlaySupplier;//R1
this.subwooferAngleSup = SubwooferSup;
this.stageAngleSup = stageAngleSup;
this.groundIntakeSup = groundIntakeSup;
SmartDashboard.putNumber("amp RPS", AMP_RPS);
SmartDashboard.putNumber("indexer amp speed", IndexerConstants.INDEXER_AMP_SPEED);
SmartDashboard.putNumber("amp angle", Field.AMPLIFIER_ANGLE);
Expand Down Expand Up @@ -84,7 +87,12 @@ public void execute() {
intake.intakeOff();
}
else {
m_Indexer.set(IndexerConstants.INDEXER_INTAKE_SPEED);
if(groundIntakeSup.getAsBoolean()) {
m_Indexer.set(IndexerConstants.INDEXER_INTAKE_SPEED);
intake.intakeYes(IntakeConstants.INTAKE_SPEED);
} else {
m_Indexer.off();
}
shooter.turnOff();
}
}
Expand Down

0 comments on commit eefbfb3

Please sign in to comment.