diff --git a/src/xrt/auxiliary/bindings/bindings.json b/src/xrt/auxiliary/bindings/bindings.json index 0000fc189..36f6a2c1a 100644 --- a/src/xrt/auxiliary/bindings/bindings.json +++ b/src/xrt/auxiliary/bindings/bindings.json @@ -3,6 +3,7 @@ "/interaction_profiles/khr/simple_controller": { "title": "Khronos Simple Controller", "type": "tracked_controller", + "steamvr_controllertype": "khr_simple_controller", "monado_device": "XRT_DEVICE_SIMPLE_CONTROLLER", "subaction_paths": [ "/user/hand/left", @@ -106,6 +107,7 @@ "/interaction_profiles/htc/vive_controller": { "title": "HTC Vive Controller", "type": "tracked_controller", + "steamvr_controllertype": "vive_controller", "monado_device": "XRT_DEVICE_VIVE_WAND", "subaction_paths": [ "/user/hand/left", @@ -191,6 +193,7 @@ "/interaction_profiles/htc/vive_pro": { "title": "HTC Vive Pro", "type": "tracked_hmd", + "steamvr_controllertype": "vive_pro", "monado_device": "XRT_DEVICE_VIVE_PRO", "subaction_paths": [ "/user/head" @@ -234,6 +237,7 @@ "/interaction_profiles/microsoft/motion_controller": { "title": "Microsoft Mixed Reality Motion Controller", "type": "tracked_controller", + "steamvr_controllertype": "holographic_controller", "monado_device": "XRT_DEVICE_WMR_CONTROLLER", "subaction_paths": [ "/user/hand/left", @@ -322,6 +326,7 @@ "/interaction_profiles/microsoft/xbox_controller": { "title": "Microsoft Xbox Controller", "type": "untracked_controller", + "steamvr_controllertype": "gamepad", "monado_device": "XRT_DEVICE_XBOX_CONTROLLER", "subaction_paths": [ "/user/gamepad" @@ -570,6 +575,7 @@ "/interaction_profiles/oculus/touch_controller": { "title": "Oculus Touch Controller", "type": "tracked_controller", + "steamvr_controllertype": "oculus_touch", "monado_device": "XRT_DEVICE_TOUCH_CONTROLLER", "subaction_paths": [ "/user/hand/left", @@ -703,6 +709,7 @@ "/interaction_profiles/valve/index_controller": { "title": "Valve Index Controller", "type": "tracked_controller", + "steamvr_controllertype": "knuckles", "monado_device": "XRT_DEVICE_INDEX_CONTROLLER", "subaction_paths": [ "/user/hand/left", diff --git a/src/xrt/auxiliary/bindings/bindings.py b/src/xrt/auxiliary/bindings/bindings.py index e15b3e239..ff1309109 100755 --- a/src/xrt/auxiliary/bindings/bindings.py +++ b/src/xrt/auxiliary/bindings/bindings.py @@ -273,6 +273,10 @@ class Profile: self.validation_func_name = profile_name.replace("/interaction_profiles/", "").replace("/", "_") self.identifiers = Identifer.parse_identifiers(json_profile) + self.steamvr_controller_type = None + if "steamvr_controllertype" in json_profile: + self.steamvr_controller_type = json_profile["steamvr_controllertype"] + self.components = [] for identifier in self.identifiers: for component in identifier.components: diff --git a/src/xrt/auxiliary/bindings/steamvr_profiles.py b/src/xrt/auxiliary/bindings/steamvr_profiles.py index 373f09e6b..abcbfabe6 100644 --- a/src/xrt/auxiliary/bindings/steamvr_profiles.py +++ b/src/xrt/auxiliary/bindings/steamvr_profiles.py @@ -54,6 +54,9 @@ def main(): 'bindings', help='Bindings file to use') parser.add_argument( 'output', type=str, help='Output directory') + parser.add_argument( + '-s', '--steamvr', action='store_true', + help='Use SteamVR standard controller type names') args = parser.parse_args() bindings = Bindings.load_and_parse(args.bindings) @@ -69,6 +72,10 @@ def main(): profile_type, vendor_name, fname = names(p) + controller_type = "monado_" + vendor_name + "_" + profile_type + if args.steamvr == True and p.steamvr_controller_type is not None: + controller_type = p.steamvr_controller_type + input_source = {} component: Component @@ -86,7 +93,7 @@ def main(): j = { "json_id": "input_profile", - "controller_type": "monado_" + vendor_name + "_" + profile_type, + "controller_type": controller_type, "device_class": device_class, "resource_root": "steamvr-monado", "driver_name": "monado", diff --git a/src/xrt/targets/steamvr_drv/CMakeLists.txt b/src/xrt/targets/steamvr_drv/CMakeLists.txt index 8dca2dbdc..52d6f5c77 100644 --- a/src/xrt/targets/steamvr_drv/CMakeLists.txt +++ b/src/xrt/targets/steamvr_drv/CMakeLists.txt @@ -9,7 +9,7 @@ add_custom_command( OUTPUT "${INPUT_PROFILES_OUTPUT_DIR}" COMMAND ${PYTHON_EXECUTABLE} ${INPUT_PROFILES_INPUT_DIR}/steamvr_profiles.py - ${INPUT_PROFILES_INPUT_DIR}/bindings.json "${INPUT_PROFILES_OUTPUT_DIR}" + ${INPUT_PROFILES_INPUT_DIR}/bindings.json "${INPUT_PROFILES_OUTPUT_DIR}" "-s" DEPENDS ${INPUT_PROFILES_INPUT_DIR}/bindings.py ${INPUT_PROFILES_INPUT_DIR}/bindings.json COMMENT "Generating SteamVR input profiles to ${INPUT_PROFILES_OUTPUT_DIR}" )