[wpilib,cmd] Cache HID wrappers (#8970)

Store DriverStation-owned GenericHID and Gamepad instances in Java and
C++, and expose the cached objects to Python bindings.

Move hand-written command gamepad and joystick wrappers to compose
cached CommandGenericHID instances plus typed HID wrappers, including a
Python CommandGamepad.

This will let us remove UserControls, while helping ensure that we don't
have state smashing between GenericHID objects.

Another bonus is without inheritance, intellisense will no longer show a
bunch of annoying methods, and instead just what actually exists.

---------

Co-authored-by: Peter Johnson <johnson.peter@gmail.com>
This commit is contained in:
Thad House
2026-06-11 09:42:39 -07:00
committed by GitHub
parent fe499ede4c
commit c647e67de0
105 changed files with 4210 additions and 1336 deletions

View File

@@ -1,12 +1,23 @@
extra_includes:
- wpi/util/sendable/SendableBuilder.hpp
- wpi/event/BooleanEvent.hpp
classes:
wpi::NiDsPS5Controller:
force_no_trampoline: true
ignored_bases:
- wpi::util::SendableHelper<NiDsPS5Controller>
methods:
NiDsPS5Controller:
overloads:
int:
GenericHID&:
GetHID:
overloads:
"":
return_value_policy: reference_internal
'[const]':
ignore: true
GetLeftX:
GetRightX:
GetLeftY:
@@ -69,6 +80,12 @@ classes:
GetTouchpadButton:
GetTouchpadButtonPressed:
GetTouchpadButtonReleased:
IsConnected:
GetGamepadType:
GetSupportedOutputs:
GetName:
GetPort:
SetRumble:
InitSendable:
wpi::NiDsPS5Controller::Button:
attributes: