From fa24446ce338d2c6d549ce35c3b4c3bd323e05e6 Mon Sep 17 00:00:00 2001 From: Thad House Date: Thu, 14 May 2026 22:08:57 -0700 Subject: [PATCH] [wpilib,cmd] Rename gamepad face-button trigger APIs to directional names (faceUp/Down/Left/Right) (#8896) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- .../command2/button/CommandGamepad.java | 64 +++++++++---------- .../frc2/command/button/CommandGamepad.cpp | 8 +-- .../wpi/commands2/button/CommandGamepad.hpp | 44 ++++++------- .../java/org/wpilib/command3/Trigger.java | 2 +- .../command3/button/CommandGamepad.java | 64 +++++++++---------- .../main/native/cpp/driverstation/Gamepad.cpp | 8 +-- .../include/wpi/driverstation/Gamepad.hpp | 24 +++---- wpilibc/src/main/python/semiwrap/Gamepad.yml | 8 +-- .../cpp/RobotContainer.cpp | 8 +-- .../HatchbotInlined/cpp/RobotContainer.cpp | 8 +-- .../cpp/RapidReactCommandBot.cpp | 12 ++-- .../SysIdRoutine/cpp/SysIdRoutineBot.cpp | 16 ++--- .../commandv2/cpp/RobotContainer.cpp | 4 +- .../org/wpilib/driverstation/Gamepad.java | 24 +++---- .../drivedistanceoffboard/RobotContainer.java | 8 +-- .../hatchbotcmdv3/RobotContainer.java | 4 +- .../hatchbotinlined/RobotContainer.java | 8 +-- .../RapidReactCommandBot.java | 12 ++-- .../sysidroutine/SysIdRoutineBot.java | 16 ++--- .../templates/commandv2/RobotContainer.java | 4 +- 20 files changed, 173 insertions(+), 173 deletions(-) diff --git a/commandsv2/src/main/java/org/wpilib/command2/button/CommandGamepad.java b/commandsv2/src/main/java/org/wpilib/command2/button/CommandGamepad.java index 6c3291108d..6d245a5a80 100644 --- a/commandsv2/src/main/java/org/wpilib/command2/button/CommandGamepad.java +++ b/commandsv2/src/main/java/org/wpilib/command2/button/CommandGamepad.java @@ -61,90 +61,90 @@ public class CommandGamepad extends CommandGenericHID { } /** - * Constructs a Trigger instance around the South Face button's digital signal. + * Constructs a Trigger instance around the Face Down button's digital signal. * - * @return a Trigger instance representing the South Face button's digital signal attached to the + * @return a Trigger instance representing the Face Down button's digital signal attached to the * {@link CommandScheduler#getDefaultButtonLoop() default scheduler button loop}. - * @see #southFace(EventLoop) + * @see #faceDown(EventLoop) */ - public Trigger southFace() { - return southFace(CommandScheduler.getInstance().getDefaultButtonLoop()); + public Trigger faceDown() { + return faceDown(CommandScheduler.getInstance().getDefaultButtonLoop()); } /** - * Constructs a Trigger instance around the South Face button's digital signal. + * Constructs a Trigger instance around the Face Down button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return a Trigger instance representing the South Face button's digital signal attached to the + * @return a Trigger instance representing the Face Down button's digital signal attached to the * given loop. */ - public Trigger southFace(EventLoop loop) { + public Trigger faceDown(EventLoop loop) { return button(Gamepad.Button.SOUTH_FACE, loop); } /** - * Constructs a Trigger instance around the East Face button's digital signal. + * Constructs a Trigger instance around the Face Right button's digital signal. * - * @return a Trigger instance representing the East Face button's digital signal attached to the + * @return a Trigger instance representing the Face Right button's digital signal attached to the * {@link CommandScheduler#getDefaultButtonLoop() default scheduler button loop}. - * @see #eastFace(EventLoop) + * @see #faceRight(EventLoop) */ - public Trigger eastFace() { - return eastFace(CommandScheduler.getInstance().getDefaultButtonLoop()); + public Trigger faceRight() { + return faceRight(CommandScheduler.getInstance().getDefaultButtonLoop()); } /** - * Constructs a Trigger instance around the East Face button's digital signal. + * Constructs a Trigger instance around the Face Right button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return a Trigger instance representing the East Face button's digital signal attached to the + * @return a Trigger instance representing the Face Right button's digital signal attached to the * given loop. */ - public Trigger eastFace(EventLoop loop) { + public Trigger faceRight(EventLoop loop) { return button(Gamepad.Button.EAST_FACE, loop); } /** - * Constructs a Trigger instance around the West Face button's digital signal. + * Constructs a Trigger instance around the Face Left button's digital signal. * - * @return a Trigger instance representing the West Face button's digital signal attached to the + * @return a Trigger instance representing the Face Left button's digital signal attached to the * {@link CommandScheduler#getDefaultButtonLoop() default scheduler button loop}. - * @see #westFace(EventLoop) + * @see #faceLeft(EventLoop) */ - public Trigger westFace() { - return westFace(CommandScheduler.getInstance().getDefaultButtonLoop()); + public Trigger faceLeft() { + return faceLeft(CommandScheduler.getInstance().getDefaultButtonLoop()); } /** - * Constructs a Trigger instance around the West Face button's digital signal. + * Constructs a Trigger instance around the Face Left button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return a Trigger instance representing the West Face button's digital signal attached to the + * @return a Trigger instance representing the Face Left button's digital signal attached to the * given loop. */ - public Trigger westFace(EventLoop loop) { + public Trigger faceLeft(EventLoop loop) { return button(Gamepad.Button.WEST_FACE, loop); } /** - * Constructs a Trigger instance around the North Face button's digital signal. + * Constructs a Trigger instance around the Face Up button's digital signal. * - * @return a Trigger instance representing the North Face button's digital signal attached to the + * @return a Trigger instance representing the Face Up button's digital signal attached to the * {@link CommandScheduler#getDefaultButtonLoop() default scheduler button loop}. - * @see #northFace(EventLoop) + * @see #faceUp(EventLoop) */ - public Trigger northFace() { - return northFace(CommandScheduler.getInstance().getDefaultButtonLoop()); + public Trigger faceUp() { + return faceUp(CommandScheduler.getInstance().getDefaultButtonLoop()); } /** - * Constructs a Trigger instance around the North Face button's digital signal. + * Constructs a Trigger instance around the Face Up button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return a Trigger instance representing the North Face button's digital signal attached to the + * @return a Trigger instance representing the Face Up button's digital signal attached to the * given loop. */ - public Trigger northFace(EventLoop loop) { + public Trigger faceUp(EventLoop loop) { return button(Gamepad.Button.NORTH_FACE, loop); } diff --git a/commandsv2/src/main/native/cpp/frc2/command/button/CommandGamepad.cpp b/commandsv2/src/main/native/cpp/frc2/command/button/CommandGamepad.cpp index c646fa30f3..1c192f609d 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/button/CommandGamepad.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/button/CommandGamepad.cpp @@ -20,19 +20,19 @@ Trigger CommandGamepad::Button(enum wpi::Gamepad::Button button, return CommandGenericHID::Button(static_cast(button), loop); } -Trigger CommandGamepad::SouthFace(wpi::EventLoop* loop) const { +Trigger CommandGamepad::FaceDown(wpi::EventLoop* loop) const { return Button(wpi::Gamepad::Button::SOUTH_FACE, loop); } -Trigger CommandGamepad::EastFace(wpi::EventLoop* loop) const { +Trigger CommandGamepad::FaceRight(wpi::EventLoop* loop) const { return Button(wpi::Gamepad::Button::EAST_FACE, loop); } -Trigger CommandGamepad::WestFace(wpi::EventLoop* loop) const { +Trigger CommandGamepad::FaceLeft(wpi::EventLoop* loop) const { return Button(wpi::Gamepad::Button::WEST_FACE, loop); } -Trigger CommandGamepad::NorthFace(wpi::EventLoop* loop) const { +Trigger CommandGamepad::FaceUp(wpi::EventLoop* loop) const { return Button(wpi::Gamepad::Button::NORTH_FACE, loop); } diff --git a/commandsv2/src/main/native/include/wpi/commands2/button/CommandGamepad.hpp b/commandsv2/src/main/native/include/wpi/commands2/button/CommandGamepad.hpp index 121a722433..c0e593eb3b 100644 --- a/commandsv2/src/main/native/include/wpi/commands2/button/CommandGamepad.hpp +++ b/commandsv2/src/main/native/include/wpi/commands2/button/CommandGamepad.hpp @@ -46,52 +46,52 @@ class CommandGamepad : public CommandGenericHID { .GetDefaultButtonLoop()) const; /** - * Constructs a Trigger instance around the South Face button's + * Constructs a Trigger instance around the Face Down button's * digital signal. * * @param loop the event loop instance to attach the event to. Defaults to the * CommandScheduler's default loop. - * @return a Trigger instance representing the South Face button's + * @return a Trigger instance representing the Face Down button's * digital signal attached to the given loop. */ - Trigger SouthFace(wpi::EventLoop* loop = CommandScheduler::GetInstance() - .GetDefaultButtonLoop()) const; - - /** - * Constructs a Trigger instance around the East Face button's - * digital signal. - * - * @param loop the event loop instance to attach the event to. Defaults to the - * CommandScheduler's default loop. - * @return a Trigger instance representing the East Face button's - * digital signal attached to the given loop. - */ - Trigger EastFace(wpi::EventLoop* loop = CommandScheduler::GetInstance() + Trigger FaceDown(wpi::EventLoop* loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const; /** - * Constructs a Trigger instance around the West Face button's + * Constructs a Trigger instance around the Face Right button's * digital signal. * * @param loop the event loop instance to attach the event to. Defaults to the * CommandScheduler's default loop. - * @return a Trigger instance representing the West Face button's + * @return a Trigger instance representing the Face Right button's * digital signal attached to the given loop. */ - Trigger WestFace(wpi::EventLoop* loop = CommandScheduler::GetInstance() + Trigger FaceRight(wpi::EventLoop* loop = CommandScheduler::GetInstance() + .GetDefaultButtonLoop()) const; + + /** + * Constructs a Trigger instance around the Face Left button's + * digital signal. + * + * @param loop the event loop instance to attach the event to. Defaults to the + * CommandScheduler's default loop. + * @return a Trigger instance representing the Face Left button's + * digital signal attached to the given loop. + */ + Trigger FaceLeft(wpi::EventLoop* loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const; /** - * Constructs a Trigger instance around the North Face button's + * Constructs a Trigger instance around the Face Up button's * digital signal. * * @param loop the event loop instance to attach the event to. Defaults to the * CommandScheduler's default loop. - * @return a Trigger instance representing the North Face button's + * @return a Trigger instance representing the Face Up button's * digital signal attached to the given loop. */ - Trigger NorthFace(wpi::EventLoop* loop = CommandScheduler::GetInstance() - .GetDefaultButtonLoop()) const; + Trigger FaceUp(wpi::EventLoop* loop = CommandScheduler::GetInstance() + .GetDefaultButtonLoop()) const; /** * Constructs a Trigger instance around the Back button's diff --git a/commandsv3/src/main/java/org/wpilib/command3/Trigger.java b/commandsv3/src/main/java/org/wpilib/command3/Trigger.java index 4833df806b..2a3a99db1d 100644 --- a/commandsv3/src/main/java/org/wpilib/command3/Trigger.java +++ b/commandsv3/src/main/java/org/wpilib/command3/Trigger.java @@ -19,7 +19,7 @@ import org.wpilib.units.measure.Time; /** * Triggers allow users to specify conditions for when commands should run. Triggers can be set up * to read from joystick and controller buttons (eg {@link - * org.wpilib.command3.button.CommandGamepad#southFace()}) or be customized to read sensor values or + * org.wpilib.command3.button.CommandGamepad#faceDown()}) or be customized to read sensor values or * any other arbitrary true/false condition. * *

It is very easy to link a button to a command. For instance, you could link the trigger button diff --git a/commandsv3/src/main/java/org/wpilib/command3/button/CommandGamepad.java b/commandsv3/src/main/java/org/wpilib/command3/button/CommandGamepad.java index 2342710478..dc8f973cdb 100644 --- a/commandsv3/src/main/java/org/wpilib/command3/button/CommandGamepad.java +++ b/commandsv3/src/main/java/org/wpilib/command3/button/CommandGamepad.java @@ -50,98 +50,98 @@ public class CommandGamepad extends CommandGenericHID { } /** - * Constructs a Trigger instance around the South Face button's digital signal. + * Constructs a Trigger instance around the Face Down button's digital signal. * - * @return a Trigger instance representing the South Face button's digital signal attached to the + * @return a Trigger instance representing the Face Down button's digital signal attached to the * {@link Scheduler#getDefaultEventLoop() default scheduler event loop} on the scheduler * passed to the controller's constructor, or the {@link Scheduler#getDefault default * scheduler} if a scheduler was not explicitly provided. - * @see #southFace(EventLoop) + * @see #faceDown(EventLoop) */ - public Trigger southFace() { - return southFace(getScheduler().getDefaultEventLoop()); + public Trigger faceDown() { + return faceDown(getScheduler().getDefaultEventLoop()); } /** - * Constructs a Trigger instance around the South Face button's digital signal. + * Constructs a Trigger instance around the Face Down button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return a Trigger instance representing the South Face button's digital signal attached to the + * @return a Trigger instance representing the Face Down button's digital signal attached to the * given loop. */ - public Trigger southFace(EventLoop loop) { + public Trigger faceDown(EventLoop loop) { return button(Gamepad.Button.SOUTH_FACE.value, loop); } /** - * Constructs a Trigger instance around the East Face button's digital signal. + * Constructs a Trigger instance around the Face Right button's digital signal. * - * @return a Trigger instance representing the East Face button's digital signal attached to the + * @return a Trigger instance representing the Face Right button's digital signal attached to the * {@link Scheduler#getDefaultEventLoop() default scheduler event loop} on the scheduler * passed to the controller's constructor, or the {@link Scheduler#getDefault default * scheduler} if a scheduler was not explicitly provided. - * @see #eastFace(EventLoop) + * @see #faceRight(EventLoop) */ - public Trigger eastFace() { - return eastFace(getScheduler().getDefaultEventLoop()); + public Trigger faceRight() { + return faceRight(getScheduler().getDefaultEventLoop()); } /** - * Constructs a Trigger instance around the East Face button's digital signal. + * Constructs a Trigger instance around the Face Right button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return a Trigger instance representing the East Face button's digital signal attached to the + * @return a Trigger instance representing the Face Right button's digital signal attached to the * given loop. */ - public Trigger eastFace(EventLoop loop) { + public Trigger faceRight(EventLoop loop) { return button(Gamepad.Button.EAST_FACE.value, loop); } /** - * Constructs a Trigger instance around the West Face button's digital signal. + * Constructs a Trigger instance around the Face Left button's digital signal. * - * @return a Trigger instance representing the West Face button's digital signal attached to the + * @return a Trigger instance representing the Face Left button's digital signal attached to the * {@link Scheduler#getDefaultEventLoop() default scheduler event loop} on the scheduler * passed to the controller's constructor, or the {@link Scheduler#getDefault default * scheduler} if a scheduler was not explicitly provided. - * @see #westFace(EventLoop) + * @see #faceLeft(EventLoop) */ - public Trigger westFace() { - return westFace(getScheduler().getDefaultEventLoop()); + public Trigger faceLeft() { + return faceLeft(getScheduler().getDefaultEventLoop()); } /** - * Constructs a Trigger instance around the West Face button's digital signal. + * Constructs a Trigger instance around the Face Left button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return a Trigger instance representing the West Face button's digital signal attached to the + * @return a Trigger instance representing the Face Left button's digital signal attached to the * given loop. */ - public Trigger westFace(EventLoop loop) { + public Trigger faceLeft(EventLoop loop) { return button(Gamepad.Button.WEST_FACE.value, loop); } /** - * Constructs a Trigger instance around the North Face button's digital signal. + * Constructs a Trigger instance around the Face Up button's digital signal. * - * @return a Trigger instance representing the North Face button's digital signal attached to the + * @return a Trigger instance representing the Face Up button's digital signal attached to the * {@link Scheduler#getDefaultEventLoop() default scheduler event loop} on the scheduler * passed to the controller's constructor, or the {@link Scheduler#getDefault default * scheduler} if a scheduler was not explicitly provided. - * @see #northFace(EventLoop) + * @see #faceUp(EventLoop) */ - public Trigger northFace() { - return northFace(getScheduler().getDefaultEventLoop()); + public Trigger faceUp() { + return faceUp(getScheduler().getDefaultEventLoop()); } /** - * Constructs a Trigger instance around the North Face button's digital signal. + * Constructs a Trigger instance around the Face Up button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return a Trigger instance representing the North Face button's digital signal attached to the + * @return a Trigger instance representing the Face Up button's digital signal attached to the * given loop. */ - public Trigger northFace(EventLoop loop) { + public Trigger faceUp(EventLoop loop) { return button(Gamepad.Button.NORTH_FACE.value, loop); } diff --git a/wpilibc/src/main/native/cpp/driverstation/Gamepad.cpp b/wpilibc/src/main/native/cpp/driverstation/Gamepad.cpp index 1653f2e71a..622d225ffc 100644 --- a/wpilibc/src/main/native/cpp/driverstation/Gamepad.cpp +++ b/wpilibc/src/main/native/cpp/driverstation/Gamepad.cpp @@ -70,7 +70,7 @@ bool Gamepad::GetSouthFaceButtonReleased() { return GetButtonReleased(Button::SOUTH_FACE); } -BooleanEvent Gamepad::SouthFace(EventLoop* loop) const { +BooleanEvent Gamepad::FaceDown(EventLoop* loop) const { return BooleanEvent(loop, [this]() { return this->GetSouthFaceButton(); }); } @@ -86,7 +86,7 @@ bool Gamepad::GetEastFaceButtonReleased() { return GetButtonReleased(Button::EAST_FACE); } -BooleanEvent Gamepad::EastFace(EventLoop* loop) const { +BooleanEvent Gamepad::FaceRight(EventLoop* loop) const { return BooleanEvent(loop, [this]() { return this->GetEastFaceButton(); }); } @@ -102,7 +102,7 @@ bool Gamepad::GetWestFaceButtonReleased() { return GetButtonReleased(Button::WEST_FACE); } -BooleanEvent Gamepad::WestFace(EventLoop* loop) const { +BooleanEvent Gamepad::FaceLeft(EventLoop* loop) const { return BooleanEvent(loop, [this]() { return this->GetWestFaceButton(); }); } @@ -118,7 +118,7 @@ bool Gamepad::GetNorthFaceButtonReleased() { return GetButtonReleased(Button::NORTH_FACE); } -BooleanEvent Gamepad::NorthFace(EventLoop* loop) const { +BooleanEvent Gamepad::FaceUp(EventLoop* loop) const { return BooleanEvent(loop, [this]() { return this->GetNorthFaceButton(); }); } diff --git a/wpilibc/src/main/native/include/wpi/driverstation/Gamepad.hpp b/wpilibc/src/main/native/include/wpi/driverstation/Gamepad.hpp index bbfe560502..e22197cca6 100644 --- a/wpilibc/src/main/native/include/wpi/driverstation/Gamepad.hpp +++ b/wpilibc/src/main/native/include/wpi/driverstation/Gamepad.hpp @@ -223,14 +223,14 @@ class Gamepad : public GenericHID, bool GetSouthFaceButtonReleased(); /** - * Constructs an event instance around the South Face button's + * Constructs an event instance around the Face Down button's * digital signal. * * @param loop the event loop instance to attach the event to. - * @return an event instance representing the South Face button's + * @return an event instance representing the Face Down button's * digital signal attached to the given loop. */ - BooleanEvent SouthFace(EventLoop* loop) const; + BooleanEvent FaceDown(EventLoop* loop) const; /** * Read the value of the East Face button on the controller. @@ -254,14 +254,14 @@ class Gamepad : public GenericHID, bool GetEastFaceButtonReleased(); /** - * Constructs an event instance around the East Face button's + * Constructs an event instance around the Face Right button's * digital signal. * * @param loop the event loop instance to attach the event to. - * @return an event instance representing the East Face button's + * @return an event instance representing the Face Right button's * digital signal attached to the given loop. */ - BooleanEvent EastFace(EventLoop* loop) const; + BooleanEvent FaceRight(EventLoop* loop) const; /** * Read the value of the West Face button on the controller. @@ -285,14 +285,14 @@ class Gamepad : public GenericHID, bool GetWestFaceButtonReleased(); /** - * Constructs an event instance around the West Face button's + * Constructs an event instance around the Face Left button's * digital signal. * * @param loop the event loop instance to attach the event to. - * @return an event instance representing the West Face button's + * @return an event instance representing the Face Left button's * digital signal attached to the given loop. */ - BooleanEvent WestFace(EventLoop* loop) const; + BooleanEvent FaceLeft(EventLoop* loop) const; /** * Read the value of the North Face button on the controller. @@ -316,14 +316,14 @@ class Gamepad : public GenericHID, bool GetNorthFaceButtonReleased(); /** - * Constructs an event instance around the North Face button's + * Constructs an event instance around the Face Up button's * digital signal. * * @param loop the event loop instance to attach the event to. - * @return an event instance representing the North Face button's + * @return an event instance representing the Face Up button's * digital signal attached to the given loop. */ - BooleanEvent NorthFace(EventLoop* loop) const; + BooleanEvent FaceUp(EventLoop* loop) const; /** * Read the value of the Back button on the controller. diff --git a/wpilibc/src/main/python/semiwrap/Gamepad.yml b/wpilibc/src/main/python/semiwrap/Gamepad.yml index b288c084dc..5c82596e19 100644 --- a/wpilibc/src/main/python/semiwrap/Gamepad.yml +++ b/wpilibc/src/main/python/semiwrap/Gamepad.yml @@ -24,19 +24,19 @@ classes: GetSouthFaceButton: GetSouthFaceButtonPressed: GetSouthFaceButtonReleased: - SouthFace: + FaceDown: GetEastFaceButton: GetEastFaceButtonPressed: GetEastFaceButtonReleased: - EastFace: + FaceRight: GetWestFaceButton: GetWestFaceButtonPressed: GetWestFaceButtonReleased: - WestFace: + FaceLeft: GetNorthFaceButton: GetNorthFaceButtonPressed: GetNorthFaceButtonReleased: - NorthFace: + FaceUp: GetBackButton: GetBackButtonPressed: GetBackButtonReleased: diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/RobotContainer.cpp index 0cbc94bc43..6eaa368411 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/RobotContainer.cpp @@ -29,14 +29,14 @@ void RobotContainer::ConfigureButtonBindings() { .OnTrue(driveHalfVelocity.get()) .OnFalse(driveFullVelocity.get()); - // Drive forward by 3 meters when the 'South Face' button is pressed, with a + // Drive forward by 3 meters when the 'Face Down' button is pressed, with a // timeout of 10 seconds - driverController.SouthFace().OnTrue( + driverController.FaceDown().OnTrue( drive.ProfiledDriveDistance(3_m).WithTimeout(10_s)); - // Do the same thing as above when the 'East Face' button is pressed, but + // Do the same thing as above when the 'Face Right' button is pressed, but // without resetting the encoders - driverController.EastFace().OnTrue( + driverController.FaceRight().OnTrue( drive.DynamicProfiledDriveDistance(3_m).WithTimeout(10_s)); } diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp index b79c16cecc..78cb72e379 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp @@ -35,10 +35,10 @@ RobotContainer::RobotContainer() { void RobotContainer::ConfigureButtonBindings() { // Configure your button bindings here - // Grab the hatch when the 'East Face' button is pressed. - driverController.EastFace().OnTrue(hatch.GrabHatchCommand()); - // Release the hatch when the 'West Face' button is pressed. - driverController.WestFace().OnTrue(hatch.ReleaseHatchCommand()); + // Grab the hatch when the 'Face Right' button is pressed. + driverController.FaceRight().OnTrue(hatch.GrabHatchCommand()); + // Release the hatch when the 'Face Left' button is pressed. + driverController.FaceLeft().OnTrue(hatch.ReleaseHatchCommand()); // While holding Right Bumper, drive at half velocity driverController.RightBumper() .OnTrue(wpi::cmd::RunOnce([this] { drive.SetMaxOutput(0.5); }, {})) diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/RapidReactCommandBot.cpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/RapidReactCommandBot.cpp index e3272a9e1e..22fc2ca2b9 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/RapidReactCommandBot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/RapidReactCommandBot.cpp @@ -24,13 +24,13 @@ void RapidReactCommandBot::ConfigureBindings() { [this] { return -driverController.GetLeftY(); }, [this] { return -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 Face Left button + driverController.FaceLeft().OnTrue(intake.IntakeCommand()); + // Retract the intake with the Face Up button + driverController.FaceUp().OnTrue(intake.RetractCommand()); - // Fire the shooter with the South Face button - driverController.SouthFace().OnTrue( + // Fire the shooter with the Face Down button + driverController.FaceDown().OnTrue( wpi::cmd::Parallel(shooter.ShootCommand(ShooterConstants::kShooterTarget), storage.RunCommand()) // Since we composed this inline we should give it a name diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp index a99edb6e53..8cbb1c4e87 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp @@ -17,27 +17,27 @@ void SysIdRoutineBot::ConfigureBindings() { // Using bumpers as a modifier and combining it with the buttons so that we // can have both sets of bindings at once - (driverController.SouthFace() && driverController.RightBumper()) + (driverController.FaceDown() && driverController.RightBumper()) .WhileTrue(drive.SysIdQuasistatic(wpi::cmd::sysid::Direction::kForward)); - (driverController.EastFace() && driverController.RightBumper()) + (driverController.FaceRight() && driverController.RightBumper()) .WhileTrue(drive.SysIdQuasistatic(wpi::cmd::sysid::Direction::kReverse)); - (driverController.WestFace() && driverController.RightBumper()) + (driverController.FaceLeft() && driverController.RightBumper()) .WhileTrue(drive.SysIdDynamic(wpi::cmd::sysid::Direction::kForward)); - (driverController.NorthFace() && driverController.RightBumper()) + (driverController.FaceUp() && driverController.RightBumper()) .WhileTrue(drive.SysIdDynamic(wpi::cmd::sysid::Direction::kReverse)); shooter.SetDefaultCommand(shooter.RunShooterCommand( [this] { return driverController.GetLeftTriggerAxis(); })); - (driverController.SouthFace() && driverController.LeftBumper()) + (driverController.FaceDown() && driverController.LeftBumper()) .WhileTrue( shooter.SysIdQuasistatic(wpi::cmd::sysid::Direction::kForward)); - (driverController.EastFace() && driverController.LeftBumper()) + (driverController.FaceRight() && driverController.LeftBumper()) .WhileTrue( shooter.SysIdQuasistatic(wpi::cmd::sysid::Direction::kReverse)); - (driverController.WestFace() && driverController.LeftBumper()) + (driverController.FaceLeft() && driverController.LeftBumper()) .WhileTrue(shooter.SysIdDynamic(wpi::cmd::sysid::Direction::kForward)); - (driverController.NorthFace() && driverController.LeftBumper()) + (driverController.FaceUp() && driverController.LeftBumper()) .WhileTrue(shooter.SysIdDynamic(wpi::cmd::sysid::Direction::kReverse)); } diff --git a/wpilibcExamples/src/main/cpp/templates/commandv2/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/templates/commandv2/cpp/RobotContainer.cpp index 81bee18aea..68ea9aa1c2 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandv2/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandv2/cpp/RobotContainer.cpp @@ -23,9 +23,9 @@ void RobotContainer::ConfigureBindings() { return subsystem.ExampleCondition(); }).OnTrue(ExampleCommand(&subsystem).ToPtr()); - // Schedule `ExampleMethodCommand` when the Gamepad's East Face button is + // Schedule `ExampleMethodCommand` when the Gamepad's Face Right button is // pressed, cancelling on release. - driverController.EastFace().WhileTrue(subsystem.ExampleMethodCommand()); + driverController.FaceRight().WhileTrue(subsystem.ExampleMethodCommand()); } wpi::cmd::CommandPtr RobotContainer::GetAutonomousCommand() { diff --git a/wpilibj/src/main/java/org/wpilib/driverstation/Gamepad.java b/wpilibj/src/main/java/org/wpilib/driverstation/Gamepad.java index 10c32e3d26..fc66fc468c 100644 --- a/wpilibj/src/main/java/org/wpilib/driverstation/Gamepad.java +++ b/wpilibj/src/main/java/org/wpilib/driverstation/Gamepad.java @@ -285,13 +285,13 @@ public class Gamepad extends GenericHID implements Sendable { } /** - * Constructs an event instance around the South Face button's digital signal. + * Constructs an event instance around the Face Down button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return an event instance representing the South Face button's digital signal attached to the + * @return an event instance representing the Face Down button's digital signal attached to the * given loop. */ - public BooleanEvent southFace(EventLoop loop) { + public BooleanEvent faceDown(EventLoop loop) { return button(Button.SOUTH_FACE, loop); } @@ -323,13 +323,13 @@ public class Gamepad extends GenericHID implements Sendable { } /** - * Constructs an event instance around the East Face button's digital signal. + * Constructs an event instance around the Face Right button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return an event instance representing the East Face button's digital signal attached to the + * @return an event instance representing the Face Right button's digital signal attached to the * given loop. */ - public BooleanEvent eastFace(EventLoop loop) { + public BooleanEvent faceRight(EventLoop loop) { return button(Button.EAST_FACE, loop); } @@ -361,13 +361,13 @@ public class Gamepad extends GenericHID implements Sendable { } /** - * Constructs an event instance around the West Face button's digital signal. + * Constructs an event instance around the Face Left button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return an event instance representing the West Face button's digital signal attached to the + * @return an event instance representing the Face Left button's digital signal attached to the * given loop. */ - public BooleanEvent westFace(EventLoop loop) { + public BooleanEvent faceLeft(EventLoop loop) { return button(Button.WEST_FACE, loop); } @@ -399,13 +399,13 @@ public class Gamepad extends GenericHID implements Sendable { } /** - * Constructs an event instance around the North Face button's digital signal. + * Constructs an event instance around the Face Up button's digital signal. * * @param loop the event loop instance to attach the event to. - * @return an event instance representing the North Face button's digital signal attached to the + * @return an event instance representing the Face Up button's digital signal attached to the * given loop. */ - public BooleanEvent northFace(EventLoop loop) { + public BooleanEvent faceUp(EventLoop loop) { return button(Button.NORTH_FACE, loop); } diff --git a/wpilibjExamples/src/main/java/org/wpilib/examples/drivedistanceoffboard/RobotContainer.java b/wpilibjExamples/src/main/java/org/wpilib/examples/drivedistanceoffboard/RobotContainer.java index 17f4344b2b..5189cf04b7 100644 --- a/wpilibjExamples/src/main/java/org/wpilib/examples/drivedistanceoffboard/RobotContainer.java +++ b/wpilibjExamples/src/main/java/org/wpilib/examples/drivedistanceoffboard/RobotContainer.java @@ -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)); } /** diff --git a/wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotcmdv3/RobotContainer.java b/wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotcmdv3/RobotContainer.java index de77349661..48f23ac9ef 100644 --- a/wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotcmdv3/RobotContainer.java +++ b/wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotcmdv3/RobotContainer.java @@ -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() diff --git a/wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotinlined/RobotContainer.java b/wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotinlined/RobotContainer.java index 27feae7617..a974c43159 100644 --- a/wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotinlined/RobotContainer.java +++ b/wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotinlined/RobotContainer.java @@ -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() diff --git a/wpilibjExamples/src/main/java/org/wpilib/examples/rapidreactcommandbot/RapidReactCommandBot.java b/wpilibjExamples/src/main/java/org/wpilib/examples/rapidreactcommandbot/RapidReactCommandBot.java index ce28a4f967..382076547e 100644 --- a/wpilibjExamples/src/main/java/org/wpilib/examples/rapidreactcommandbot/RapidReactCommandBot.java +++ b/wpilibjExamples/src/main/java/org/wpilib/examples/rapidreactcommandbot/RapidReactCommandBot.java @@ -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 diff --git a/wpilibjExamples/src/main/java/org/wpilib/examples/sysidroutine/SysIdRoutineBot.java b/wpilibjExamples/src/main/java/org/wpilib/examples/sysidroutine/SysIdRoutineBot.java index 4bd489ef21..d54aa64162 100644 --- a/wpilibjExamples/src/main/java/org/wpilib/examples/sysidroutine/SysIdRoutineBot.java +++ b/wpilibjExamples/src/main/java/org/wpilib/examples/sysidroutine/SysIdRoutineBot.java @@ -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)); } diff --git a/wpilibjExamples/src/main/java/org/wpilib/templates/commandv2/RobotContainer.java b/wpilibjExamples/src/main/java/org/wpilib/templates/commandv2/RobotContainer.java index 975ea2439f..2177e6d6a2 100644 --- a/wpilibjExamples/src/main/java/org/wpilib/templates/commandv2/RobotContainer.java +++ b/wpilibjExamples/src/main/java/org/wpilib/templates/commandv2/RobotContainer.java @@ -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()); } /**