[wpilib] Disambiguate HID Sendable names (#8081)

Fixes #7933
Add Axis to triggers sendable name
This commit is contained in:
sciencewhiz
2025-07-15 21:19:03 -07:00
committed by GitHub
parent 2fc86a155d
commit 2875fd7d7c
8 changed files with 14 additions and 14 deletions

View File

@@ -280,8 +280,8 @@ bool PS4Controller::GetTouchpadReleased() {
void PS4Controller::InitSendable(wpi::SendableBuilder& builder) {
builder.SetSmartDashboardType("HID");
builder.PublishConstString("ControllerType", "PS4");
builder.AddDoubleProperty("L2", [this] { return GetL2Axis(); }, nullptr);
builder.AddDoubleProperty("R2", [this] { return GetR2Axis(); }, nullptr);
builder.AddDoubleProperty("L2 Axis", [this] { return GetL2Axis(); }, nullptr);
builder.AddDoubleProperty("R2 Axis", [this] { return GetR2Axis(); }, nullptr);
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
builder.AddDoubleProperty("LeftY", [this] { return GetLeftY(); }, nullptr);
builder.AddDoubleProperty("RightX", [this] { return GetRightX(); }, nullptr);

View File

@@ -280,8 +280,8 @@ bool PS5Controller::GetTouchpadReleased() {
void PS5Controller::InitSendable(wpi::SendableBuilder& builder) {
builder.SetSmartDashboardType("HID");
builder.PublishConstString("ControllerType", "PS5");
builder.AddDoubleProperty("L2", [this] { return GetL2Axis(); }, nullptr);
builder.AddDoubleProperty("R2", [this] { return GetR2Axis(); }, nullptr);
builder.AddDoubleProperty("L2 Axis", [this] { return GetL2Axis(); }, nullptr);
builder.AddDoubleProperty("R2 Axis", [this] { return GetR2Axis(); }, nullptr);
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
builder.AddDoubleProperty("LeftY", [this] { return GetLeftY(); }, nullptr);
builder.AddDoubleProperty("RightX", [this] { return GetRightX(); }, nullptr);

View File

@@ -244,8 +244,8 @@ bool XboxController::GetRightBumperReleased() {
void XboxController::InitSendable(wpi::SendableBuilder& builder) {
builder.SetSmartDashboardType("HID");
builder.PublishConstString("ControllerType", "Xbox");
builder.AddDoubleProperty("LeftTrigger", [this] { return GetLeftTriggerAxis(); }, nullptr);
builder.AddDoubleProperty("RightTrigger", [this] { return GetRightTriggerAxis(); }, nullptr);
builder.AddDoubleProperty("LeftTrigger Axis", [this] { return GetLeftTriggerAxis(); }, nullptr);
builder.AddDoubleProperty("RightTrigger Axis", [this] { return GetRightTriggerAxis(); }, nullptr);
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
builder.AddDoubleProperty("RightX", [this] { return GetRightX(); }, nullptr);
builder.AddDoubleProperty("LeftY", [this] { return GetLeftY(); }, nullptr);