From d666e9eb9d7a86340e1f58a49b42052cb057b547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=AEAarav=20Shah?= <76842@psdschools.org> Date: Sat, 29 Jan 2022 11:33:57 -0700 Subject: [PATCH] added tentative button mapping for boomboom --- .../java/frc4388/robot/RobotContainer.java | 6 ++- .../frc4388/robot/subsystems/BoomBoom.java | 41 ------------------- 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 8dee4e3..5360b3c 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -92,8 +92,12 @@ public class RobotContainer { new JoystickButton(getOperatorJoystick(), XboxController.A_BUTTON) .whenPressed(() -> m_robotLED.setPattern(LEDPatterns.LAVA_RAINBOW)) .whenReleased(() -> m_robotLED.setPattern(LEDConstants.DEFAULT_PATTERN)); + // activates "BoomBoom" + new JoystickButton(getOperatorJoystick(), XboxController.B_BUTTON) + .whenPressed(() -> m_robotBoomBoom.runDrumShooterVelocityPID(0.1)) + .whenReleased(() -> m_robotBoomBoom.runDrumShooterVelocityPID(0)); + /* Driver Buttons */ } - /** * Use this to pass the autonomous command to the main {@link Robot} class. * diff --git a/src/main/java/frc4388/robot/subsystems/BoomBoom.java b/src/main/java/frc4388/robot/subsystems/BoomBoom.java index 88835cd..2e4b8f3 100644 --- a/src/main/java/frc4388/robot/subsystems/BoomBoom.java +++ b/src/main/java/frc4388/robot/subsystems/BoomBoom.java @@ -39,42 +39,6 @@ public double m_fireVel; public Hood m_hoodSubsystem; public Turret m_turretSubsystem; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SimpleMotorFeedforward feedforward = new SimpleMotorFeedforward(69, 42, 0); //get real values later @@ -151,9 +115,6 @@ try { m_turretSubsystem = subsystem1; } - public double addFireVel(){ - return m_fireVel; - } public void runDrumShooter(double speed) { m_shooterFalconLeft.set(TalonFXControlMode.PercentOutput, speed); m_shooterFalconRight.follow(m_shooterFalconLeft); @@ -177,7 +138,5 @@ public void setShooterGains() { // m_shooterFalconLeft.set(controller.calculate(encoder.getRate(), targetVel) + 0.9 * feedforward.calculate(targetVel)); m_shooterFalconLeft.set(m_controller.calculate(m_shooterFalconLeft.get(), targetVel)); - - } } \ No newline at end of file