ViveInputUtility-Unity icon indicating copy to clipboard operation
ViveInputUtility-Unity copied to clipboard

Vive controller on Index headset returns by device ID that it is an Index controller

Open wirelessdreamer opened this issue 5 years ago • 6 comments

// The controller we want to look up the type on uint deviceIndex = GetComponentInParent<ViveRoleSetter>().viveRole.GetDeviceIndex();

Debug.Log("Check controller type: " + VRModule.GetDeviceState(deviceIndex).deviceModel + " ID: " + deviceIndex);

Output: Check controller type: IndexControllerRight ID: 1

image

wirelessdreamer avatar Oct 09 '20 18:10 wirelessdreamer

@wirelessdreamer Currently, I do not have Index device to debug. Could you help to print out the log in this script (Assets\HTC.UnityPlugin\VRModule\Modules\SteamVRv2Module.cs)? Line 559, Help to print out deviceClass, serialNumber, modelNumber and renderModelName, thanks!

chengnay avatar Oct 12 '20 08:10 chengnay

That Ifdef isn't active, so I'd never hit the related section of code image

wirelessdreamer avatar Oct 12 '20 13:10 wirelessdreamer

Which SDK did you import for your project? Please list the versions of your Unity Editor, SDKs... etc Thanks!

chengnay avatar Oct 13 '20 02:10 chengnay

Unity 2019.4.8.f1 VIU 1.12 Oculus Integration 20.1

wirelessdreamer avatar Oct 13 '20 02:10 wirelessdreamer

@wirelessdreamer I found the root cause is that XRDevice.model will return "Index". With combination of Index HMD + VIVE controller, XRDevice.model will not return "VIVE" for controller. We are still working on how to resolve this issue.

chengnay avatar Oct 13 '20 06:10 chengnay

@wirelessdreamer Here is the solution, In Assets\HTC.UnityPlugin\VRModule\Modules\UnityEngineVRModule_2017_1.cs, Line 252, if (!XRDevice.model.Equals("None")) { currState.serialNumber = XRDevice.model + " " + m_nodeStateList[i].uniqueID.ToString("X8"); var model = Input.GetJoystickNames()[0]; if (string.IsNullOrEmpty(model)) { currState.modelNumber = XRDevice.model + " " + m_nodeStateList[i].nodeType; currState.renderModelName = XRDevice.model + " " + m_nodeStateList[i].nodeType; } else { currState.modelNumber = model; currState.renderModelName = model; } }

chengnay avatar Oct 13 '20 08:10 chengnay