Add Pico 4s/4 Ultra/A9210 interaction profile (non-breaking change)

This commit is contained in:
TheRainTrain
2025-02-23 14:05:12 +01:00
committed by xytovl
parent 058b345a82
commit f108c26dd5
10 changed files with 366 additions and 1 deletions
Binary file not shown.
+286
View File
@@ -0,0 +1,286 @@
{
"profileId": "pico-4s",
"fallbackProfileIds": [
"generic-trigger-squeeze-thumbstick"
],
"layouts": {
"left": {
"selectComponentId": "xr-standard-trigger",
"components": {
"xr-standard-trigger": {
"type": "trigger",
"gamepadIndices": {
"button": 0
},
"rootNodeName": "xr_standard_trigger",
"visualResponses": {
"xr_standard_trigger_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_trigger_pressed_value",
"minNodeName": "xr_standard_trigger_pressed_min",
"maxNodeName": "xr_standard_trigger_pressed_max"
}
}
},
"xr-standard-squeeze": {
"type": "squeeze",
"gamepadIndices": {
"button": 1
},
"rootNodeName": "xr_standard_squeeze",
"visualResponses": {
"xr_standard_squeeze_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_squeeze_pressed_value",
"minNodeName": "xr_standard_squeeze_pressed_min",
"maxNodeName": "xr_standard_squeeze_pressed_max"
}
}
},
"xr-standard-thumbstick": {
"type": "thumbstick",
"gamepadIndices": {
"button": 3,
"xAxis": 2,
"yAxis": 3
},
"rootNodeName": "xr_standard_thumbstick",
"visualResponses": {
"xr_standard_thumbstick_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_thumbstick_pressed_value",
"minNodeName": "xr_standard_thumbstick_pressed_min",
"maxNodeName": "xr_standard_thumbstick_pressed_max"
},
"xr_standard_thumbstick_xaxis_pressed": {
"componentProperty": "xAxis",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value",
"minNodeName": "xr_standard_thumbstick_xaxis_pressed_min",
"maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max"
},
"xr_standard_thumbstick_yaxis_pressed": {
"componentProperty": "yAxis",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value",
"minNodeName": "xr_standard_thumbstick_yaxis_pressed_min",
"maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max"
}
}
},
"x-button": {
"type": "button",
"gamepadIndices": {
"button": 4
},
"rootNodeName": "x_button",
"visualResponses": {
"x_button_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "x_button_pressed_value",
"minNodeName": "x_button_pressed_min",
"maxNodeName": "x_button_pressed_max"
}
}
},
"y-button": {
"type": "button",
"gamepadIndices": {
"button": 5
},
"rootNodeName": "y_button",
"visualResponses": {
"y_button_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "y_button_pressed_value",
"minNodeName": "y_button_pressed_min",
"maxNodeName": "y_button_pressed_max"
}
}
}
},
"gamepadMapping": "xr-standard",
"rootNodeName": "pico-4s-left",
"assetPath": "left.glb"
},
"right": {
"selectComponentId": "xr-standard-trigger",
"components": {
"xr-standard-trigger": {
"type": "trigger",
"gamepadIndices": {
"button": 0
},
"rootNodeName": "xr_standard_trigger",
"visualResponses": {
"xr_standard_trigger_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_trigger_pressed_value",
"minNodeName": "xr_standard_trigger_pressed_min",
"maxNodeName": "xr_standard_trigger_pressed_max"
}
}
},
"xr-standard-squeeze": {
"type": "squeeze",
"gamepadIndices": {
"button": 1
},
"rootNodeName": "xr_standard_squeeze",
"visualResponses": {
"xr_standard_squeeze_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_squeeze_pressed_value",
"minNodeName": "xr_standard_squeeze_pressed_min",
"maxNodeName": "xr_standard_squeeze_pressed_max"
}
}
},
"xr-standard-thumbstick": {
"type": "thumbstick",
"gamepadIndices": {
"button": 3,
"xAxis": 2,
"yAxis": 3
},
"rootNodeName": "xr_standard_thumbstick",
"visualResponses": {
"xr_standard_thumbstick_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_thumbstick_pressed_value",
"minNodeName": "xr_standard_thumbstick_pressed_min",
"maxNodeName": "xr_standard_thumbstick_pressed_max"
},
"xr_standard_thumbstick_xaxis_pressed": {
"componentProperty": "xAxis",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value",
"minNodeName": "xr_standard_thumbstick_xaxis_pressed_min",
"maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max"
},
"xr_standard_thumbstick_yaxis_pressed": {
"componentProperty": "yAxis",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value",
"minNodeName": "xr_standard_thumbstick_yaxis_pressed_min",
"maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max"
}
}
},
"a-button": {
"type": "button",
"gamepadIndices": {
"button": 4
},
"rootNodeName": "a_button",
"visualResponses": {
"a_button_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "a_button_pressed_value",
"minNodeName": "a_button_pressed_min",
"maxNodeName": "a_button_pressed_max"
}
}
},
"b-button": {
"type": "button",
"gamepadIndices": {
"button": 5
},
"rootNodeName": "b_button",
"visualResponses": {
"b_button_pressed": {
"componentProperty": "button",
"states": [
"default",
"touched",
"pressed"
],
"valueNodeProperty": "transform",
"valueNodeName": "b_button_pressed_value",
"minNodeName": "b_button_pressed_min",
"maxNodeName": "b_button_pressed_max"
}
}
}
},
"gamepadMapping": "xr-standard",
"rootNodeName": "pico-4s-right",
"assetPath": "right.glb"
}
}
}
Binary file not shown.
+42
View File
@@ -421,6 +421,48 @@ static std::vector<interaction_profile> interaction_profiles{
"/user/hand/right/input/squeeze/value",
}},
interaction_profile{
"/interaction_profiles/bytedance/pico4s_controller",
{"XR_BD_controller_interaction"},
{
"/user/hand/left/output/haptic",
"/user/hand/right/output/haptic",
"/user/hand/left/input/grip/pose",
"/user/hand/left/input/aim/pose",
"/user/hand/right/input/grip/pose",
"/user/hand/right/input/aim/pose",
"/user/hand/left/input/x/click",
"/user/hand/left/input/x/touch",
"/user/hand/left/input/y/click",
"/user/hand/left/input/y/touch",
"/user/hand/left/input/menu/click",
"/user/hand/left/input/system/click",
"/user/hand/left/input/trigger/click",
"/user/hand/left/input/trigger/value",
"/user/hand/left/input/trigger/touch",
"/user/hand/left/input/thumbstick",
"/user/hand/left/input/thumbstick/click",
"/user/hand/left/input/thumbstick/touch",
"/user/hand/left/input/squeeze/click",
"/user/hand/left/input/squeeze/value",
"/user/hand/right/input/a/click",
"/user/hand/right/input/a/touch",
"/user/hand/right/input/b/click",
"/user/hand/right/input/b/touch",
"/user/hand/right/input/system/click",
"/user/hand/right/input/trigger/click",
"/user/hand/right/input/trigger/value",
"/user/hand/right/input/trigger/touch",
"/user/hand/right/input/thumbstick",
"/user/hand/right/input/thumbstick/click",
"/user/hand/right/input/thumbstick/touch",
"/user/hand/right/input/squeeze/click",
"/user/hand/right/input/squeeze/value",
}},
interaction_profile{
"/interaction_profiles/htc/vive_focus3_controller",
{"XR_HTC_vive_focus3_controller_interaction"},
{
+10 -1
View File
@@ -74,6 +74,9 @@ static model guess_model_()
if (model == "Pico Neo 3")
return model::pico_neo_3;
if (model == "A9210")
return model::pico_4s;
spdlog::info("manufacturer={}, model={}, device={} assuming Pico 4", manufacturer, model, device);
return model::pico_4;
}
@@ -141,6 +144,7 @@ XrViewConfigurationView override_view(XrViewConfigurationView view, model m)
case model::pico_neo_3:
return scale_view(view, 1832);
case model::pico_4:
case model::pico_4s:
return scale_view(view, 2160);
case model::htc_vive_focus_3:
case model::htc_vive_focus_vision:
@@ -167,6 +171,7 @@ bool need_srgb_conversion(model m)
case model::meta_quest_3s:
case model::pico_neo_3:
case model::pico_4:
case model::pico_4s:
case model::htc_vive_focus_3:
case model::htc_vive_focus_vision:
case model::htc_vive_xr_elite:
@@ -195,6 +200,7 @@ const char * permission_name(feature f)
return "com.oculus.permission.EYE_TRACKING";
case model::pico_neo_3:
case model::pico_4:
case model::pico_4s:
return "com.picovr.permission.EYE_TRACKING";
case model::htc_vive_focus_3:
case model::htc_vive_focus_vision:
@@ -215,6 +221,7 @@ const char * permission_name(feature f)
return "com.oculus.permission.FACE_TRACKING";
case model::pico_neo_3:
case model::pico_4:
case model::pico_4s:
case model::htc_vive_focus_3:
case model::htc_vive_focus_vision:
case model::htc_vive_xr_elite:
@@ -250,6 +257,8 @@ std::string controller_name()
return "pico-neo3";
case model::pico_4:
return "pico-4";
case model::pico_4s:
return "pico-4s";
case model::htc_vive_focus_3:
case model::htc_vive_focus_vision:
case model::htc_vive_xr_elite:
@@ -322,7 +331,7 @@ std::pair<glm::vec3, glm::quat> controller_offset(std::string_view profile, xr::
default:
break;
}
else if (profile == "pico-4")
else if (profile == "pico-4" || profile == "pico-4s")
switch (space)
{
case xr::spaces::grip_left:
+1
View File
@@ -34,6 +34,7 @@ enum class model
meta_quest_3s,
pico_neo_3,
pico_4,
pico_4s,
htc_vive_focus_3,
htc_vive_xr_elite,
htc_vive_focus_vision,
+18
View File
@@ -1307,6 +1307,24 @@ scene::meta & scenes::lobby::get_meta_scene()
{"recenter_right", "/user/hand/right/input/a/click"},
},
},
suggested_binding{
"/interaction_profiles/bytedance/pico4s_controller",
{
{"left_aim", "/user/hand/left/input/aim/pose"},
{"left_trigger", "/user/hand/left/input/trigger/value"},
{"left_squeeze", "/user/hand/left/input/squeeze/value"},
{"left_scroll", "/user/hand/left/input/thumbstick"},
{"left_haptic", "/user/hand/left/output/haptic"},
{"right_aim", "/user/hand/right/input/aim/pose"},
{"right_trigger", "/user/hand/right/input/trigger/value"},
{"right_squeeze", "/user/hand/right/input/squeeze/value"},
{"right_scroll", "/user/hand/right/input/thumbstick"},
{"right_haptic", "/user/hand/right/output/haptic"},
{"recenter_left", "/user/hand/left/input/x/click"},
{"recenter_right", "/user/hand/right/input/a/click"},
},
},
suggested_binding{
"/interaction_profiles/htc/vive_focus3_controller",
{
+1
View File
@@ -490,6 +490,7 @@ void scenes::stream::on_interaction_profile_changed(const XrEventDataInteraction
DO_PROFILE(khr, simple_controller)
DO_PROFILE(bd, pico_neo3_controller)
DO_PROFILE(bd, pico4_controller)
DO_PROFILE(bd, pico4s_controller)
DO_PROFILE(bd, pico_g3_controller)
DO_PROFILE(google, daydream_controller)
DO_PROFILE(hp, mixed_reality_controller)
+7
View File
@@ -142,6 +142,13 @@ enum class interaction_profile : uint8_t
meta_touch_controller_quest_2,
samsung_odyssey_controller,
valve_index_controller,
// out-of-order to preserve enum ordinals
// otherwise this will force non-p4u users
// to update both their client and server
// for a feature they won't use
//
// TODO: order this correctly when the next major update comes around
bd_pico4s_controller,
};
enum video_codec
+1
View File
@@ -322,6 +322,7 @@ static xrt_device_name get_name(interaction_profile profile)
case interaction_profile::bd_pico_neo3_controller:
return XRT_DEVICE_PICO_NEO3_CONTROLLER;
case interaction_profile::bd_pico4_controller:
case interaction_profile::bd_pico4s_controller:
return XRT_DEVICE_PICO4_CONTROLLER;
case interaction_profile::bd_pico_g3_controller:
return XRT_DEVICE_PICO_G3_CONTROLLER;