a/bindings,xrt: Add Touch Plus controller

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2194>
This commit is contained in:
Christoph Haag 2024-03-14 15:04:56 +01:00 committed by Marge Bot
parent 73686b340b
commit b101db3705
6 changed files with 362 additions and 1 deletions

View file

@ -419,6 +419,9 @@ endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PRO)
set(XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PRO ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PLUS)
set(XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PLUS ON)
endif()
# Defaults for OpenXR layer support
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_DEPTH)

View file

@ -77,6 +77,7 @@ EXTENSIONS = (
['XR_FB_touch_controller_pro', 'XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PRO'],
['XR_FB_touch_controller_proximity', 'XRT_FEATURE_OPENXR_INTERACTION_FB_PROXIMITY'],
['XR_HTC_facial_tracking', 'XRT_FEATURE_OPENXR_FACIAL_TRACKING_HTC'],
['XR_META_touch_controller_plus', 'XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PLUS'],
['XR_ML_ml2_controller_interaction', 'XRT_FEATURE_OPENXR_INTERACTION_ML2'],
['XR_MND_headless', 'XRT_FEATURE_OPENXR_HEADLESS'],
['XR_MND_swapchain_usage_input_attachment_bit'],

View file

@ -2865,6 +2865,323 @@
}
}
}
},
"/interaction_profiles/facebook/touch_controller_plus": {
"title": "Meta Quest Touch Plus Controller",
"type": "tracked_controller",
"extension": "XR_META_touch_controller_plus",
"steamvr_controllertype": "oculus_touch",
"monado_device": "XRT_DEVICE_TOUCH_PLUS_CONTROLLER",
"extended_by": ["ext/palm_pose", "grip_surface", "ext/hand_interaction_poses"],
"subaction_paths": [
"/user/hand/left",
"/user/hand/right"
],
"subpaths": {
"/input/x": {
"type": "button",
"localized_name": "X",
"components": ["click", "touch"],
"side": "left",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_X_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_X_TOUCH"
}
},
"/input/y": {
"type": "button",
"localized_name": "Y",
"components": ["click", "touch"],
"side": "left",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_Y_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_Y_TOUCH"
}
},
"/input/menu": {
"type": "button",
"localized_name": "Menu",
"components": ["click"],
"side": "left",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_MENU_CLICK"
}
},
"/input/a": {
"type": "button",
"localized_name": "A",
"components": ["click", "touch"],
"side": "right",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_A_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_A_TOUCH"
}
},
"/input/b": {
"type": "button",
"localized_name": "B",
"components": ["click", "touch"],
"side": "right",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_B_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_B_TOUCH"
}
},
"/input/system": {
"type": "button",
"localized_name": "System",
"components": ["click"],
"side": "right",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_SYSTEM_CLICK"
}
},
"/input/squeeze": {
"type": "trigger",
"localized_name": "Squeeze",
"components": ["value"],
"monado_bindings": {
"value": "XRT_INPUT_TOUCH_PLUS_SQUEEZE_VALUE"
}
},
"/input/trigger": {
"type": "trigger",
"localized_name": "Trigger",
"components": ["touch", "value", "force", "curl_meta", "slide_meta", "proximity_meta"],
"monado_bindings": {
"touch": "XRT_INPUT_TOUCH_PLUS_TRIGGER_TOUCH",
"value": "XRT_INPUT_TOUCH_PLUS_TRIGGER_VALUE",
"force": "XRT_INPUT_TOUCH_PLUS_TRIGGER_FORCE",
"curl": "XRT_INPUT_TOUCH_PLUS_TRIGGER_CURL",
"slide": "XRT_INPUT_TOUCH_PLUS_TRIGGER_SLIDE",
"proximity": "XRT_INPUT_TOUCH_PLUS_TRIGGER_PROXIMITY"
}
},
"/input/thumbstick": {
"type": "joystick",
"localized_name": "Thumbstick",
"components": ["click", "touch", "position"],
"dpad_emulation": {
"position": "position",
"center": false
},
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_THUMBSTICK_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_THUMBSTICK_TOUCH",
"position": "XRT_INPUT_TOUCH_PLUS_THUMBSTICK"
}
},
"/input/thumbrest": {
"type": "button",
"localized_name": "Thumb Rest",
"components": ["touch"],
"monado_bindings": {
"touch": "XRT_INPUT_TOUCH_PLUS_THUMBREST_TOUCH"
}
},
"/input/thumb_meta": {
"type": "button",
"localized_name": "Thumb",
"components": ["proximity_meta"],
"monado_bindings": {
"force": "XRT_INPUT_TOUCH_PLUS_THUMB_PROXIMITY"
}
},
"/input/grip": {
"type": "pose",
"localized_name": "Grip",
"components": ["pose"],
"monado_bindings": {
"pose": "XRT_INPUT_TOUCH_PLUS_GRIP_POSE"
}
},
"/input/aim": {
"type": "pose",
"localized_name": "Aim",
"components": ["pose"],
"monado_bindings": {
"pose": "XRT_INPUT_TOUCH_PLUS_AIM_POSE"
}
},
"/output/haptic": {
"type": "vibration",
"localized_name": "Haptic",
"components": ["haptic"],
"monado_bindings": {
"haptic": "XRT_OUTPUT_NAME_TOUCH_PLUS_HAPTIC"
}
}
}
},
"/interaction_profiles/meta/touch_plus_controller": {
"title": "Meta Touch Plus Controller",
"type": "tracked_controller",
"openxr_version": {
"promoted": {
"major": "1",
"minor": "1"
}
},
"steamvr_controllertype": "oculus_touch",
"monado_device": "XRT_DEVICE_TOUCH_PLUS_CONTROLLER",
"extended_by": ["ext/palm_pose", "grip_surface", "ext/hand_interaction_poses"],
"subaction_paths": [
"/user/hand/left",
"/user/hand/right"
],
"subpaths": {
"/input/x": {
"type": "button",
"localized_name": "X",
"components": ["click", "touch"],
"side": "left",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_X_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_X_TOUCH"
}
},
"/input/y": {
"type": "button",
"localized_name": "Y",
"components": ["click", "touch"],
"side": "left",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_Y_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_Y_TOUCH"
}
},
"/input/menu": {
"type": "button",
"localized_name": "Menu",
"components": ["click"],
"side": "left",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_MENU_CLICK"
}
},
"/input/a": {
"type": "button",
"localized_name": "A",
"components": ["click", "touch"],
"side": "right",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_A_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_A_TOUCH"
}
},
"/input/b": {
"type": "button",
"localized_name": "B",
"components": ["click", "touch"],
"side": "right",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_B_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_B_TOUCH"
}
},
"/input/system": {
"type": "button",
"localized_name": "System",
"components": ["click"],
"side": "right",
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_SYSTEM_CLICK"
}
},
"/input/squeeze": {
"type": "trigger",
"localized_name": "Squeeze",
"components": ["value"],
"monado_bindings": {
"value": "XRT_INPUT_TOUCH_PLUS_SQUEEZE_VALUE"
}
},
"/input/trigger": {
"type": "trigger",
"localized_name": "Trigger",
"components": ["touch", "value", "force", "proximity"],
"monado_bindings": {
"touch": "XRT_INPUT_TOUCH_PLUS_TRIGGER_TOUCH",
"value": "XRT_INPUT_TOUCH_PLUS_TRIGGER_VALUE",
"force": "XRT_INPUT_TOUCH_PLUS_TRIGGER_FORCE",
"curl": "XRT_INPUT_TOUCH_PLUS_TRIGGER_CURL",
"slide": "XRT_INPUT_TOUCH_PLUS_TRIGGER_SLIDE",
"proximity": "XRT_INPUT_TOUCH_PLUS_TRIGGER_PROXIMITY"
}
},
"/input/trigger_curl": {
"type": "trigger",
"localized_name": "Trigger",
"components": ["value"],
"monado_bindings": {
"value": "XRT_INPUT_TOUCH_PLUS_TRIGGER_CURL"
}
},
"/input/trigger_slide": {
"type": "trigger",
"localized_name": "Trigger",
"components": ["value"],
"monado_bindings": {
"value": "XRT_INPUT_TOUCH_PLUS_TRIGGER_SLIDE"
}
},
"/input/thumbstick": {
"type": "joystick",
"localized_name": "Thumbstick",
"components": ["click", "touch", "position"],
"dpad_emulation": {
"position": "position",
"center": false
},
"monado_bindings": {
"click": "XRT_INPUT_TOUCH_PLUS_THUMBSTICK_CLICK",
"touch": "XRT_INPUT_TOUCH_PLUS_THUMBSTICK_TOUCH",
"position": "XRT_INPUT_TOUCH_PLUS_THUMBSTICK"
}
},
"/input/thumbrest": {
"type": "button",
"localized_name": "Thumb Rest",
"components": ["touch"],
"monado_bindings": {
"touch": "XRT_INPUT_TOUCH_PLUS_THUMBREST_TOUCH"
}
},
"/input/thumb_resting_surfaces": {
"type": "button",
"localized_name": "Thumb",
"components": ["proximity"],
"monado_bindings": {
"force": "XRT_INPUT_TOUCH_PLUS_THUMB_PROXIMITY"
}
},
"/input/grip": {
"type": "pose",
"localized_name": "Grip",
"components": ["pose"],
"monado_bindings": {
"pose": "XRT_INPUT_TOUCH_PLUS_GRIP_POSE"
}
},
"/input/aim": {
"type": "pose",
"localized_name": "Aim",
"components": ["pose"],
"monado_bindings": {
"pose": "XRT_INPUT_TOUCH_PLUS_AIM_POSE"
}
},
"/output/haptic": {
"type": "vibration",
"localized_name": "Haptic",
"components": ["haptic"],
"monado_bindings": {
"haptic": "XRT_OUTPUT_NAME_TOUCH_PLUS_HAPTIC"
}
}
}
}

View file

@ -48,6 +48,7 @@
#cmakedefine XRT_FEATURE_OPENXR_INTERACTION_VIVE_FOCUS3
#cmakedefine XRT_FEATURE_OPENXR_INTERACTION_FB_PROXIMITY
#cmakedefine XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PRO
#cmakedefine XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PLUS
#cmakedefine XRT_FEATURE_OPENXR_LAYER_COLOR_SCALE_BIAS
#cmakedefine XRT_FEATURE_OPENXR_LAYER_CUBE
#cmakedefine XRT_FEATURE_OPENXR_LAYER_CYLINDER

View file

@ -768,6 +768,7 @@ enum xrt_device_name
XRT_DEVICE_VIVE_FOCUS3_CONTROLLER,
XRT_DEVICE_TOUCH_PRO_CONTROLLER,
XRT_DEVICE_TOUCH_PLUS_CONTROLLER,
};
/*!
@ -1251,7 +1252,32 @@ enum xrt_input_type
_(XRT_INPUT_TOUCH_PRO_THUMB_PROXIMITY , XRT_INPUT_NAME(0x0D15, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PRO_TRIGGER_CURL , XRT_INPUT_NAME(0x0D16, VEC1_ZERO_TO_ONE)) \
_(XRT_INPUT_TOUCH_PRO_TRIGGER_SLIDE , XRT_INPUT_NAME(0x0D17, VEC1_ZERO_TO_ONE)) \
_(XRT_INPUT_TOUCH_PRO_STYLUS_FORCE , XRT_INPUT_NAME(0x0D18, VEC1_ZERO_TO_ONE))
_(XRT_INPUT_TOUCH_PRO_STYLUS_FORCE , XRT_INPUT_NAME(0x0D18, VEC1_ZERO_TO_ONE)) \
\
_(XRT_INPUT_TOUCH_PLUS_X_CLICK , XRT_INPUT_NAME(0x0E00, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_X_TOUCH , XRT_INPUT_NAME(0x0E01, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_Y_CLICK , XRT_INPUT_NAME(0x0E02, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_Y_TOUCH , XRT_INPUT_NAME(0x0E03, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_MENU_CLICK , XRT_INPUT_NAME(0x0E04, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_A_CLICK , XRT_INPUT_NAME(0x0E05, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_A_TOUCH , XRT_INPUT_NAME(0x0E06, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_B_CLICK , XRT_INPUT_NAME(0x0E07, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_B_TOUCH , XRT_INPUT_NAME(0x0E08, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_SYSTEM_CLICK , XRT_INPUT_NAME(0x0E09, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_SQUEEZE_VALUE , XRT_INPUT_NAME(0x0E0A, VEC1_ZERO_TO_ONE)) \
_(XRT_INPUT_TOUCH_PLUS_TRIGGER_TOUCH , XRT_INPUT_NAME(0x0E0B, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_TRIGGER_PROXIMITY , XRT_INPUT_NAME(0x0E0C, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_TRIGGER_VALUE , XRT_INPUT_NAME(0x0E0D, VEC1_ZERO_TO_ONE)) \
_(XRT_INPUT_TOUCH_PLUS_TRIGGER_FORCE , XRT_INPUT_NAME(0x0E0E, VEC1_ZERO_TO_ONE)) \
_(XRT_INPUT_TOUCH_PLUS_THUMBSTICK_CLICK , XRT_INPUT_NAME(0x0E0F, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_THUMBSTICK_TOUCH , XRT_INPUT_NAME(0x0E10, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_THUMBSTICK , XRT_INPUT_NAME(0x0E11, VEC2_MINUS_ONE_TO_ONE)) \
_(XRT_INPUT_TOUCH_PLUS_THUMBREST_TOUCH , XRT_INPUT_NAME(0x0E12, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_GRIP_POSE , XRT_INPUT_NAME(0x0E13, POSE)) \
_(XRT_INPUT_TOUCH_PLUS_AIM_POSE , XRT_INPUT_NAME(0x0E14, POSE)) \
_(XRT_INPUT_TOUCH_PLUS_THUMB_PROXIMITY , XRT_INPUT_NAME(0x0E15, BOOLEAN)) \
_(XRT_INPUT_TOUCH_PLUS_TRIGGER_CURL , XRT_INPUT_NAME(0x0E16, VEC1_ZERO_TO_ONE)) \
_(XRT_INPUT_TOUCH_PLUS_TRIGGER_SLIDE , XRT_INPUT_NAME(0x0E17, VEC1_ZERO_TO_ONE))
// clang-format on
@ -1697,6 +1723,7 @@ enum xrt_output_name
XRT_OUTPUT_NAME_TOUCH_PRO_HAPTIC = XRT_OUTPUT_NAME(0x0400, VIBRATION),
XRT_OUTPUT_NAME_TOUCH_PRO_HAPTIC_TRIGGER = XRT_OUTPUT_NAME(0x0500, VIBRATION),
XRT_OUTPUT_NAME_TOUCH_PRO_HAPTIC_THUMB = XRT_OUTPUT_NAME(0x0600, VIBRATION),
XRT_OUTPUT_NAME_TOUCH_PLUS_HAPTIC = XRT_OUTPUT_NAME(0x0700, VIBRATION)
// clang-format on
};

View file

@ -520,6 +520,17 @@
#endif
/*
* XR_META_touch_controller_plus
*/
#if defined(XR_META_touch_controller_plus) && defined(XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PLUS)
#define OXR_HAVE_META_touch_controller_plus
#define OXR_EXTENSION_SUPPORT_META_touch_controller_plus(_) _(META_touch_controller_plus, META_TOUCH_CONTROLLER_PLUS)
#else
#define OXR_EXTENSION_SUPPORT_META_touch_controller_plus(_)
#endif
/*
* XR_ML_ml2_controller_interaction
*/
@ -770,6 +781,7 @@
OXR_EXTENSION_SUPPORT_FB_touch_controller_pro(_) \
OXR_EXTENSION_SUPPORT_FB_touch_controller_proximity(_) \
OXR_EXTENSION_SUPPORT_HTC_facial_tracking(_) \
OXR_EXTENSION_SUPPORT_META_touch_controller_plus(_) \
OXR_EXTENSION_SUPPORT_ML_ml2_controller_interaction(_) \
OXR_EXTENSION_SUPPORT_MND_headless(_) \
OXR_EXTENSION_SUPPORT_MND_swapchain_usage_input_attachment_bit(_) \