[wpilib] Rename GenericHID and Gamepad enums to all caps

GenericHID.getSupportedOutputs(): Return EnumSet
Gamepad: Add Button-taking accessors
This commit is contained in:
Peter Johnson
2026-03-17 17:19:58 -07:00
parent d86a745328
commit a57d658ef1
25 changed files with 1266 additions and 745 deletions

View File

@@ -8,7 +8,7 @@
#include "commands/GrabHatch.hpp"
#include "commands/HalveDriveVelocity.hpp"
#include "commands/ReleaseHatch.hpp"
#include "wpi/commands2/button/JoystickButton.hpp"
#include "wpi/commands2/button/GamepadButton.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
RobotContainer::RobotContainer() {
@@ -40,15 +40,14 @@ void RobotContainer::ConfigureButtonBindings() {
// the scheduler thus, no memory leaks!
// Grab the hatch when the 'South Face' button is pressed.
wpi::cmd::JoystickButton(&m_driverController,
wpi::Gamepad::Button::kSouthFace)
wpi::cmd::GamepadButton(&m_driverController, wpi::Gamepad::Button::SOUTH_FACE)
.OnTrue(GrabHatch(&m_hatch).ToPtr());
// Release the hatch when the 'East Face' button is pressed.
wpi::cmd::JoystickButton(&m_driverController, wpi::Gamepad::Button::kEastFace)
wpi::cmd::GamepadButton(&m_driverController, wpi::Gamepad::Button::EAST_FACE)
.OnTrue(ReleaseHatch(&m_hatch).ToPtr());
// While holding the bumper button, drive at half velocity
wpi::cmd::JoystickButton(&m_driverController,
wpi::Gamepad::Button::kRightBumper)
wpi::cmd::GamepadButton(&m_driverController,
wpi::Gamepad::Button::RIGHT_BUMPER)
.WhileTrue(HalveDriveVelocity(&m_drive).ToPtr());
}