]> git.taranathan.com Git - FRC2026.git/commitdiff
shooter power modifier
authoriefomit <timofei.stem@gmail.com>
Wed, 1 Apr 2026 01:36:13 +0000 (18:36 -0700)
committeriefomit <timofei.stem@gmail.com>
Wed, 1 Apr 2026 01:36:13 +0000 (18:36 -0700)
src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java
src/main/java/frc/robot/subsystems/shooter/Shooter.java

index 4146791a25f71479ad8bd2c4b46658b3bf989725..ae091303b0880dbd41070ef55fb12b242c99427e 100644 (file)
@@ -4,6 +4,7 @@ import java.util.function.BooleanSupplier;
 
 import edu.wpi.first.math.geometry.Rotation2d;
 import edu.wpi.first.wpilibj.DriverStation.Alliance;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
 import edu.wpi.first.wpilibj2.command.Command;
 import edu.wpi.first.wpilibj2.command.CommandScheduler;
 import edu.wpi.first.wpilibj2.command.FunctionalCommand;
@@ -170,6 +171,18 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig {
     //     controller.get(PS5Button.TOUCHPAD).onTrue(new InstantCommand(() -> {
     //         new BrownOutControl(shooter, spindexer, turret, intake, hood, getDrivetrain());
     //     }));
+
+        // shooter power modifier
+        if (shooter != null) {
+            controller.get(PS5Button.PS).onTrue(new InstantCommand(() -> {
+                double current = SmartDashboard.getNumber("OPERATOR: Shooter Power Modifier", 1.05);
+                SmartDashboard.putNumber("OPERATOR: Shooter Power Modifier", current + 0.05);
+            }));
+            controller.get(PS5Button.TRIANGLE).onTrue(new InstantCommand(() -> {
+                double current = SmartDashboard.getNumber("OPERATOR: Shooter Power Modifier", 1.05);
+                SmartDashboard.putNumber("OPERATOR: Shooter Power Modifier", Math.max(0.5, current - 0.05));
+            }));
+        }
     }
 
     @Override
index bdd18741481d228567d8f33589853282b61b99da..13d20a81ac7026ad2f464056cce0c771d7c17bfc 100644 (file)
@@ -61,6 +61,7 @@ public class Shooter extends SubsystemBase implements ShooterIO {
         shooterMotorLeft.getConfigurator().apply(limitConfig);
         shooterMotorRight.getConfigurator().apply(limitConfig);
 
+        SmartDashboard.putNumber("OPERATOR: Shooter Power Modifier", powerModifier);
         SmartDashboard.putData("Turn on shooter", new InstantCommand(()-> setShooter(12.0)));
     }