[wpilib,cmd] Rename gamepad face-button trigger APIs to directional names (faceUp/Down/Left/Right) (#8896)

This updates gamepad trigger naming from cardinal-style face buttons
(`northFace/southFace/eastFace/westFace` and
`NorthFace/SouthFace/EastFace/WestFace`) to directional naming
(`faceUp/faceDown/faceRight/faceLeft` and
`FaceUp/FaceDown/FaceRight/FaceLeft`) to match the requested API shape.
The change is applied across Java and C++ HID/command layers, along with
related examples and binding metadata.

- **API surface updates (Java)**
  - Renamed trigger/event methods in:
    - `wpilibj` `Gamepad`
    - `commandsv2` `CommandGamepad`
    - `commandsv3` `CommandGamepad`
  - Mapping preserved:
    - `southFace` → `faceDown`
    - `eastFace` → `faceRight`
    - `westFace` → `faceLeft`
    - `northFace` → `faceUp`

- **API surface updates (C++)**
  - Renamed trigger/event methods in:
    - `wpilibc` `Gamepad`
    - `commandsv2` `CommandGamepad`
  - Mapping preserved:
    - `SouthFace` → `FaceDown`
    - `EastFace` → `FaceRight`
    - `WestFace` → `FaceLeft`
    - `NorthFace` → `FaceUp`

- **Python semiwrap updates**
- Updated `wpilibc/src/main/python/semiwrap/Gamepad.yml` method mappings
to the renamed C++ method names (`FaceDown/FaceRight/FaceLeft/FaceUp`).

- **Callsite migration**
- Updated Java examples/template code and C++ examples/template code to
use the new method names so samples remain aligned with the API rename.

- **Docs/comments alignment**
- Updated related Javadoc/reference text and example comments to use
directional terminology.

```java
// Before
driverController.southFace().onTrue(command);
driverController.eastFace().onTrue(command);

// After
driverController.faceDown().onTrue(command);
driverController.faceRight().onTrue(command);
```

```cpp
// Before
driverController.SouthFace().OnTrue(command);
driverController.EastFace().OnTrue(command);

// After
driverController.FaceDown().OnTrue(command);
driverController.FaceRight().OnTrue(command);
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ThadHouse <7727148+ThadHouse@users.noreply.github.com>
This commit is contained in:
Thad House
2026-05-14 22:08:57 -07:00
committed by GitHub
parent 67b795057b
commit fa24446ce3
20 changed files with 173 additions and 173 deletions

View File

@@ -54,13 +54,13 @@ public class RobotContainer {
// Drive at half velocity when the bumper is held
driverController.rightBumper().onTrue(driveHalfVelocity).onFalse(driveFullVelocity);
// Drive forward by 3 meters when the 'South Face' button is pressed, with a timeout of 10
// Drive forward by 3 meters when the 'Face Down' button is pressed, with a timeout of 10
// seconds
driverController.southFace().onTrue(robotDrive.profiledDriveDistance(3).withTimeout(10));
driverController.faceDown().onTrue(robotDrive.profiledDriveDistance(3).withTimeout(10));
// Do the same thing as above when the 'East Face' button is pressed, but without resetting the
// Do the same thing as above when the 'Face Right' button is pressed, but without resetting the
// encoders
driverController.eastFace().onTrue(robotDrive.dynamicProfiledDriveDistance(3).withTimeout(10));
driverController.faceRight().onTrue(robotDrive.dynamicProfiledDriveDistance(3).withTimeout(10));
}
/**

View File

@@ -73,9 +73,9 @@ public class RobotContainer {
*/
private void configureButtonBindings() {
// Grab the hatch when the Circle button is pressed.
driverController.eastFace().onTrue(hatchSubsystem.grabHatchCommand());
driverController.faceRight().onTrue(hatchSubsystem.grabHatchCommand());
// Release the hatch when the Square button is pressed.
driverController.westFace().onTrue(hatchSubsystem.releaseHatchCommand());
driverController.faceLeft().onTrue(hatchSubsystem.releaseHatchCommand());
// While holding R1, drive at half speed
driverController
.rightBumper()

View File

@@ -74,10 +74,10 @@ public class RobotContainer {
* org.wpilib.command2.button.JoystickButton}.
*/
private void configureButtonBindings() {
// Grab the hatch when the east face button is pressed.
driverController.eastFace().onTrue(hatchSubsystem.grabHatchCommand());
// Release the hatch when the west face button is pressed.
driverController.westFace().onTrue(hatchSubsystem.releaseHatchCommand());
// Grab the hatch when the right face button is pressed.
driverController.faceRight().onTrue(hatchSubsystem.grabHatchCommand());
// Release the hatch when the left face button is pressed.
driverController.faceLeft().onTrue(hatchSubsystem.releaseHatchCommand());
// While holding right bumper, drive at half velocity
driverController
.rightBumper()

View File

@@ -59,14 +59,14 @@ public class RapidReactCommandBot {
drive.arcadeDriveCommand(
() -> -driverController.getLeftY(), () -> -driverController.getRightX()));
// Deploy the intake with the west face button
driverController.westFace().onTrue(intake.intakeCommand());
// Retract the intake with the north face button
driverController.northFace().onTrue(intake.retractCommand());
// Deploy the intake with the left face button
driverController.faceLeft().onTrue(intake.intakeCommand());
// Retract the intake with the up face button
driverController.faceUp().onTrue(intake.retractCommand());
// Fire the shooter with the south face button
// Fire the shooter with the down face button
driverController
.southFace()
.faceDown()
.onTrue(
parallel(shooter.shootCommand(ShooterConstants.kShooterTargetRPS), storage.runCommand())
// Since we composed this inline we should give it a name

View File

@@ -45,19 +45,19 @@ public class SysIdRoutineBot {
// Using bumpers as a modifier and combining it with the buttons so that we can have both sets
// of bindings at once
driverController
.southFace()
.faceDown()
.and(driverController.rightBumper())
.whileTrue(drive.sysIdQuasistatic(SysIdRoutine.Direction.kForward));
driverController
.eastFace()
.faceRight()
.and(driverController.rightBumper())
.whileTrue(drive.sysIdQuasistatic(SysIdRoutine.Direction.kReverse));
driverController
.westFace()
.faceLeft()
.and(driverController.rightBumper())
.whileTrue(drive.sysIdDynamic(SysIdRoutine.Direction.kForward));
driverController
.northFace()
.faceUp()
.and(driverController.rightBumper())
.whileTrue(drive.sysIdDynamic(SysIdRoutine.Direction.kReverse));
@@ -65,19 +65,19 @@ public class SysIdRoutineBot {
shooter.setDefaultCommand(shooter.runShooter(driverController::getLeftTriggerAxis));
driverController
.southFace()
.faceDown()
.and(driverController.leftBumper())
.whileTrue(shooter.sysIdQuasistatic(SysIdRoutine.Direction.kForward));
driverController
.eastFace()
.faceRight()
.and(driverController.leftBumper())
.whileTrue(shooter.sysIdQuasistatic(SysIdRoutine.Direction.kReverse));
driverController
.westFace()
.faceLeft()
.and(driverController.leftBumper())
.whileTrue(shooter.sysIdDynamic(SysIdRoutine.Direction.kForward));
driverController
.northFace()
.faceUp()
.and(driverController.leftBumper())
.whileTrue(shooter.sysIdDynamic(SysIdRoutine.Direction.kReverse));
}

View File

@@ -42,9 +42,9 @@ public class RobotContainer {
// Schedule `ExampleCommand` when `exampleCondition` changes to `true`
new Trigger(exampleSubsystem::exampleCondition).onTrue(new ExampleCommand(exampleSubsystem));
// Schedule `exampleMethodCommand` when the Gamepad's east face button is pressed,
// Schedule `exampleMethodCommand` when the Gamepad's right face button is pressed,
// cancelling on release.
driverController.eastFace().whileTrue(exampleSubsystem.exampleMethodCommand());
driverController.faceRight().whileTrue(exampleSubsystem.exampleMethodCommand());
}
/**