Skip to content

Commit

Permalink
Changed controls for Driver and Operator
Browse files Browse the repository at this point in the history
  • Loading branch information
ReeledWarrior14 committed Mar 9, 2024
1 parent 599e075 commit 172c72c
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public RobotContainer() {
.getLeftTriggerAxis()
* IOConstants.kSlowModeScalar)
/ 2,
!m_driverController.getRightBumper()),
!m_driverController.getLeftBumper()),
m_robotDrive));
}

Expand All @@ -151,29 +151,44 @@ private void configureBindings() {
new NoteOuttakeCommand(m_intakeSubsystem)))
.onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off));

new JoystickButton(m_operatorController, Button.kA.value)
.onTrue(new InstantCommand(() -> m_climberSubsystem.forward(),
m_climberSubsystem));
new JoystickButton(m_operatorController, Button.kB.value)
.onTrue(new InstantCommand(() -> m_climberSubsystem.reverse(),
m_climberSubsystem));
new JoystickButton(m_driverController, Button.kRightBumper.value)
.onTrue(new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Amp))
.onFalse(new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Retracted));

// Intake, Driver Controller Right Trigger
new Trigger(() -> {
return m_driverController.getLeftTriggerAxis() > 0.5;
return m_driverController.getRightTriggerAxis() > 0.5;
}).whileTrue(
new SequentialCommandGroup(
new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Extended),
new NoteIntakeCommand(m_intakeSubsystem),
new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Retracted)))
.onFalse(new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Retracted));

// Outtake, Operator Controller Right Trigger
new Trigger(() -> {
return m_driverController.getRightTriggerAxis() > 0.5;
}).whileTrue(
new SequentialCommandGroup(
new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Amp),
new NoteOuttakeCommand(m_intakeSubsystem)))
.onFalse(new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Retracted));
return m_operatorController.getRightTriggerAxis() > 0.5;
}).whileTrue(new NoteOuttakeCommand(m_intakeSubsystem));

new Trigger(() -> {
return m_operatorController.getLeftTriggerAxis() > 0.5;
}).onTrue(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting))
.onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off));

// Climber Up, Operator Controller Right Bumper + A Button
new Trigger(() -> {
return m_operatorController.getAButton() && m_operatorController.getRightBumper();
}).whileTrue(new InstantCommand(() -> m_climberSubsystem.forward()));

// Climber Down, Operator Controller Right Bumper + B Button
new Trigger(() -> {
return m_operatorController.getBButton() && m_operatorController.getRightBumper();
}).whileTrue(new InstantCommand(() -> m_climberSubsystem.reverse()));

// Toggle Distance Sensor, Operatoe Controller Left Bumper + Start Button
new Trigger(() -> {
return m_operatorController.getLeftBumper() && m_operatorController.getStartButton();
}).onTrue(new InstantCommand(() -> m_intakeSubsystem.toggleDistanceSensor()));
}

/**
Expand Down

0 comments on commit 172c72c

Please sign in to comment.