From 9f02f791b40e3f22eef1e655ad9a88fc2b43ac7d Mon Sep 17 00:00:00 2001 From: iefomit Date: Wed, 4 Mar 2026 16:02:47 -0800 Subject: [PATCH] testing xbox emulation --- .../controls/GameControllerDriverConfig.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/frc/robot/controls/GameControllerDriverConfig.java b/src/main/java/frc/robot/controls/GameControllerDriverConfig.java index e21c1eb..e30d47c 100644 --- a/src/main/java/frc/robot/controls/GameControllerDriverConfig.java +++ b/src/main/java/frc/robot/controls/GameControllerDriverConfig.java @@ -6,6 +6,8 @@ import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.wpilibj.DriverStation.Alliance; import edu.wpi.first.wpilibj2.command.CommandScheduler; import edu.wpi.first.wpilibj2.command.InstantCommand; +import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; +import edu.wpi.first.wpilibj2.command.WaitCommand; import frc.robot.Robot; import frc.robot.constants.Constants; import frc.robot.subsystems.drivetrain.Drivetrain; @@ -36,6 +38,12 @@ public class GameControllerDriverConfig extends BaseDriverConfig { getDrivetrain().setDesiredPose(() -> null); CommandScheduler.getInstance().cancelAll(); })); + + // rumble test + driver.get(Button.A).onTrue(new SequentialCommandGroup( + new InstantCommand(() -> driver.setRumble(GameController.RumbleStatus.RUMBLE_ON)), + new WaitCommand(0.5), + new InstantCommand(() -> driver.setRumble(GameController.RumbleStatus.RUMBLE_OFF)))); } @Override @@ -78,4 +86,12 @@ public class GameControllerDriverConfig extends BaseDriverConfig { return driver; } + public void startRumble() { + driver.setRumble(GameController.RumbleStatus.RUMBLE_ON); + } + + public void endRumble() { + driver.setRumble(GameController.RumbleStatus.RUMBLE_OFF); + } + } -- 2.39.5