openvr icon indicating copy to clipboard operation
openvr copied to clipboard

Controller Priority Not Working

Open pili-zhangqiu opened this issue 2 years ago • 0 comments

Hi, I know this is a question asked previously, but I haven't been able to successfully set a desired order/hierarchy with the controller priority settings. Am I misunderstanding its use?

Issue: If my vive_trackers are assigned to the tracker role "held in hand", they will become the active left/right hand controllers. I would like for my custom_controllers (which we are developing a driver for) to take over this role as soon as they connect to SteamVR.

Question: Does openvr have the capability to unassign a device as the main left or right controller (e.g. vive_trackers with "held in hand" role), and then re-assign a new device (e.g. custom_controllers)?


Things that I tried but failed:

Attempt 1: Add hand_priority settings to the controller input profile (json): As suggested in issue #1663 , we changed the hand_priority setting in the input profiles for both the vive_trackers and custom_controllers. However, this didn't do anything.

  • vive_trackers are "active" controllers, but should have less priority: In file vive_tracker_handed_profile.json, there is an optional setting "hand_priority": -1,. I tried setting its value to -1 and 1.
  • custom_trackers should take over the "active" role when connected to SteamVR: In the controller input profile json file I tried adding the parameter: "hand_priority": 7002, and "hand_priority": 100,

Attempt 2: Set vr::Prop_ControllerHandSelectionPriority_Int32 in the driver:

  • From the openvr_driver.h file, I can see the following parameter: vr::ETrackedDeviceProperty::Prop_ControllerHandSelectionPriority_Int32 = 7002, // Allows hand assignments to prefer some controllers over others. High numbers are selected over low numbers_
  • I set my controllers to the maximum priority (i.e. 7002) in my custom driver, by adding the following line: vr::VRProperties()->SetInt32Property(m_props, vr::Prop_ControllerHandSelectionPriority_Int32, (int32_t)7002);

Am I misunderstanding what these settings do? Can I even re-assign the "active" controller role instantly during a SteamVR session, or do these parameters only work when booting?

Thanks in advance!

pili-zhangqiu avatar Sep 16 '22 11:09 pili-zhangqiu