From 5306610181eda4c97bd1a2850185e9ee40963f48 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Tue, 4 Feb 2025 16:25:08 +0100 Subject: [PATCH 1/3] Revert "[Pico] Workaround input profile selection in Pico4 Ultra" This reverts commit 231ce36ac54f30a7cd0a4e115f8000eb9ebedc10. --- app/src/openxr/cpp/OpenXRInputMappings.h | 3 +-- app/src/openxr/cpp/OpenXRInputSource.cpp | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/src/openxr/cpp/OpenXRInputMappings.h b/app/src/openxr/cpp/OpenXRInputMappings.h index 609fca70cb..537b953e3e 100644 --- a/app/src/openxr/cpp/OpenXRInputMappings.h +++ b/app/src/openxr/cpp/OpenXRInputMappings.h @@ -47,7 +47,6 @@ namespace crow { constexpr const char* kPathActionReady { "ready_ext" }; constexpr const char* kInteractionProfileHandInteraction { "/interaction_profiles/ext/hand_interaction_ext" }; constexpr const char* kInteractionProfileMSFTHandInteraction { "/interaction_profiles/microsoft/hand_interaction" }; - constexpr const char* kInteractionProfileKHRSimple { "/interaction_profiles/khr/simple_controller" }; // OpenXR Button List enum class OpenXRButtonType { @@ -461,7 +460,7 @@ namespace crow { // Default fallback: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/generic/generic-button.json const OpenXRInputMapping KHRSimple { - kInteractionProfileKHRSimple, + "/interaction_profiles/khr/simple_controller", "generic-trigger.obj", "generic-trigger.obj", device::UnknownType, diff --git a/app/src/openxr/cpp/OpenXRInputSource.cpp b/app/src/openxr/cpp/OpenXRInputSource.cpp index 19afff9eb8..e34aae9d31 100644 --- a/app/src/openxr/cpp/OpenXRInputSource.cpp +++ b/app/src/openxr/cpp/OpenXRInputSource.cpp @@ -81,12 +81,6 @@ XrResult OpenXRInputSource::Initialize() for (auto& mapping: OpenXRInputMappings) { // Always populate default/fall-back profiles if (mapping.controllerType == device::UnknownType) { -#if PICOXR - // Pico4U runtime incorrectly prioritize the Khronos simple controller over Pico's - // specific one. Workaround that bad behaviour by skipping the simple controller profile. - if (mDeviceType == device::Pico4U && !strcmp(mapping.path, kInteractionProfileKHRSimple)) - continue; -#endif mMappings.push_back(mapping); // Use the system's deviceType instead to ensure we get a valid VRController on WebXR sessions mMappings.back().controllerType = mDeviceType; From 6245f69b0849a91170245dc4d05f2551988da5d2 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Tue, 4 Feb 2025 16:43:47 +0100 Subject: [PATCH 2/3] [PicoXR] Use a different input profile for Pico4U Pico has defined a input profile for the Pico4U which is different to the ones for the Pico4 or the Pico4E. It is not in any OpenXR doc so we were not aware of it. We got that info from the Pico customer service. The problem was that the runtime was selecting the generic Khronos profile instead of the Pico4 profile because we were not suggesting the specific profile for the 4U but for the 4 (or 4E). Actually the runtime should probably select the Pico4 profile over the generic one but that's their decision anyway. --- app/src/openxr/cpp/OpenXRInputMappings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/openxr/cpp/OpenXRInputMappings.h b/app/src/openxr/cpp/OpenXRInputMappings.h index 537b953e3e..b43ef97359 100644 --- a/app/src/openxr/cpp/OpenXRInputMappings.h +++ b/app/src/openxr/cpp/OpenXRInputMappings.h @@ -289,7 +289,7 @@ namespace crow { }; const OpenXRInputMapping Pico4U { - "/interaction_profiles/bytedance/pico4_controller", + "/interaction_profiles/bytedance/pico4s_controller", "vr_controller_pico4u_left.obj", "vr_controller_pico4u_right.obj", device::Pico4U, From 2d7e9c66dd1d7596589040de93fc9dc0385a90c1 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Tue, 4 Feb 2025 16:44:24 +0100 Subject: [PATCH 3/3] [PicoXR] Remove the Pico4xOld interaction profile That interaction profile was used long time ago when the Pico4 device didn't have its own interaction profile. It's actually the profile designed for the Neo3. Recenctly Pico released an extension that provide a specific profile for the Pico4, so this should not be needed. Actually the code was not using it at all, so any device selecting it would be broken. --- app/src/openxr/cpp/OpenXRInputMappings.h | 29 ++---------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/app/src/openxr/cpp/OpenXRInputMappings.h b/app/src/openxr/cpp/OpenXRInputMappings.h index b43ef97359..79b990cbfe 100644 --- a/app/src/openxr/cpp/OpenXRInputMappings.h +++ b/app/src/openxr/cpp/OpenXRInputMappings.h @@ -239,31 +239,6 @@ namespace crow { }, }; - // Pico controller: this definition was created for the Pico 4, but the Neo 3 will likely also be compatible - const OpenXRInputMapping Pico4xOld { - "/interaction_profiles/pico/neo3_controller", - "vr_controller_pico4_left.obj", - "vr_controller_pico4_right.obj", - device::Pico4x, - std::vector { "pico-4", "generic-trigger-squeeze-thumbstick" }, - std::vector { - { OpenXRButtonType::Trigger, kPathTrigger, OpenXRButtonFlags::ValueTouch, OpenXRHandFlags::Both }, - { OpenXRButtonType::Squeeze, kPathSqueeze, OpenXRButtonFlags::Value, OpenXRHandFlags::Both }, - { OpenXRButtonType::Thumbstick, kPathThumbstick, OpenXRButtonFlags::ClickTouch, OpenXRHandFlags::Both }, - { OpenXRButtonType::ButtonX, kPathButtonX, OpenXRButtonFlags::ClickTouch, OpenXRHandFlags::Left }, - { OpenXRButtonType::ButtonY, kPathButtonY, OpenXRButtonFlags::ClickTouch, OpenXRHandFlags::Left, }, - { OpenXRButtonType::ButtonA, kPathButtonA, OpenXRButtonFlags::ClickTouch, OpenXRHandFlags::Right }, - { OpenXRButtonType::ButtonB, kPathButtonB, OpenXRButtonFlags::ClickTouch, OpenXRHandFlags::Right }, - { OpenXRButtonType::Back, kPathBack, OpenXRButtonFlags::Click, OpenXRHandFlags::Left, ControllerDelegate::Button::BUTTON_APP, true } - }, - std::vector { - { OpenXRAxisType::Thumbstick, kPathThumbstick, OpenXRHandFlags::Both }, - }, - std::vector { - { kPathHaptic, OpenXRHandFlags::Both }, - }, - }; - const OpenXRInputMapping Pico4x { "/interaction_profiles/bytedance/pico4_controller", "vr_controller_pico4_left.obj", @@ -475,8 +450,8 @@ namespace crow { }, }; - const std::array OpenXRInputMappings { - OculusTouch, OculusTouch2, MetaQuestTouchPro, Pico4U, Pico4x, Pico4xOld, PicoNeo3, Hvr6DOF, Hvr3DOF, LenovoVRX, MagicLeap2, MetaTouchPlus, HandInteraction, MSFTHandInteraction, KHRSimple + const std::array OpenXRInputMappings { + OculusTouch, OculusTouch2, MetaQuestTouchPro, Pico4U, Pico4x, PicoNeo3, Hvr6DOF, Hvr3DOF, LenovoVRX, MagicLeap2, MetaTouchPlus, HandInteraction, MSFTHandInteraction, KHRSimple }; } // namespace crow