From 432788460bccfde56d48ba31180a592b16ba3e2e Mon Sep 17 00:00:00 2001 From: GearBoxFox Date: Wed, 31 Jan 2024 21:17:14 -0500 Subject: [PATCH] feat: climber prototype push cart controls --- src/main/java/frc/robot/RobotContainer.java | 7 ++----- .../frc/robot/subsystems/shooter/ShooterIOPrototype.java | 8 ++++---- .../frc/robot/subsystems/shooter/ShooterSubsystem.java | 8 ++++++++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index e831080b..3f0cf818 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -152,11 +152,8 @@ private void configureButtonBindings() { controller.a().whileTrue(m_shooter.setShooterPowerFactory(0.6, 0.6)) .whileFalse(m_shooter.setShooterPowerFactory(0.0, 0.0)); - -// controller.leftBumper().whileTrue(m_climber.setClimberPowerFactory(-0.25)) -// .whileFalse(m_climber.setClimberPowerFactory(0.0)); -// controller.rightBumper().whileTrue(m_climber.setClimberPowerFactory(0.25)) -// .whileFalse(m_climber.setClimberPowerFactory(0.0)); + controller.b().whileTrue(m_shooter.runFullShooter(0.6, 0.6)) + .whileFalse(m_shooter.runFullShooter(0.0, 0.0)); } /** diff --git a/src/main/java/frc/robot/subsystems/shooter/ShooterIOPrototype.java b/src/main/java/frc/robot/subsystems/shooter/ShooterIOPrototype.java index cf52b9fd..98583be4 100644 --- a/src/main/java/frc/robot/subsystems/shooter/ShooterIOPrototype.java +++ b/src/main/java/frc/robot/subsystems/shooter/ShooterIOPrototype.java @@ -6,14 +6,14 @@ public class ShooterIOPrototype implements ShooterIO { private final CANSparkFlex m_topLeftMotor; - private final CANSparkFlex m_topRightMotor; - private final CANSparkMax m_bottomLeftMotor; + private final CANSparkMax m_topRightMotor; + private final CANSparkFlex m_bottomLeftMotor; private final CANSparkMax m_bottomRightMotor; private final CANSparkMax m_kickekMotor; public ShooterIOPrototype() { m_topLeftMotor = new CANSparkFlex(13, CANSparkLowLevel.MotorType.kBrushless); - m_topRightMotor = new CANSparkFlex(14, CANSparkLowLevel.MotorType.kBrushless); - m_bottomLeftMotor = new CANSparkMax(15, CANSparkLowLevel.MotorType.kBrushless); + m_topRightMotor = new CANSparkMax(14, CANSparkLowLevel.MotorType.kBrushless); + m_bottomLeftMotor = new CANSparkFlex(15, CANSparkLowLevel.MotorType.kBrushless); m_bottomRightMotor = new CANSparkMax(16, CANSparkLowLevel.MotorType.kBrushless); m_kickekMotor = new CANSparkMax(17, CANSparkLowLevel.MotorType.kBrushless); diff --git a/src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java index a4307e88..fa9c7202 100644 --- a/src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java @@ -49,5 +49,13 @@ public Command setIntakePowerFactory(double power) { setKickerPower(power == 0.0 ? 0.0 : 0.75); }); } + + public Command runFullShooter(double left, double right) { + return runOnce(() -> { + setShooterPowerLeft(left); + setShooterPowerRight(right); + setKickerPower(left == 0.0 ? 0.0 : 0.75); + }); + } }