Skip to content

Commit

Permalink
update triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
gvaldez7206 committed Sep 28, 2024
1 parent 5d438df commit 60b9389
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ private void configureButtonBindings() {
operator.rightTrigger().and(operator.leftTrigger()).whileTrue(intake.runIndexerMotor(1));
// set shooter to home preset position
operator.y().onTrue(elevatorWrist.homePosition());
operator.y().and(elevatorWrist.elevatorAtAmp).and(noteInIndexer)
operator.y().and(elevatorWrist.elevatorAtAmp).and(intake.noteInIndexer)
.onTrue(intake.runIntakeMotorNonStop(0, -0.2).withTimeout(2.0)
.until(new Trigger(() -> !this.intake.getIndexerBeamBrakeStatus()).debounce(.5)));
.until(intake.noteNotInIndexer.debounce(.5)));

// increment once through states list to next state
operator.povRight().onTrue(Commands.runOnce(() -> {
Expand All @@ -253,8 +253,7 @@ private void configureButtonBindings() {
operator.povLeft().onTrue(Commands.runOnce(() -> {
OperatorState.decrement();
}).ignoringDisable(true));
new Trigger(() -> OperatorState.getCurrentState() == OperatorState.State.kAmp)
.and(new Trigger(() -> !this.intake.getIndexerBeamBrakeStatus()).debounce(1.0))
OperatorState.isAmpMode.and(intake.noteNotInIndexer.debounce(1.0))
.onTrue(elevatorWrist.homePosition());
// run action based on current state as incremented through operator states list
operator.a().and(OperatorState.isSpeakerMode).whileTrue(elevatorWrist.speakerPreset());
Expand Down
1 change: 1 addition & 0 deletions src/main/java/frc/robot/subsystems/intake/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class Intake extends SubsystemBase {

public Trigger noteInIndexer = new Trigger(() -> getIndexerBeamBrakeStatus()).debounce(0.25,
Debouncer.DebounceType.kRising);
public Trigger noteNotInIndexer = new Trigger(() -> !getIndexerBeamBrakeStatus());
public Trigger noteInIntake = new Trigger(() -> getintakeBeamBrakeStatus()).debounce(0.25,
Debouncer.DebounceType.kRising);
public Trigger intakeActive = new Trigger(() -> getIntakeRPM() > 0);
Expand Down

0 comments on commit 60b9389

Please sign in to comment.