unity-game-enginesteamvr

Get SteamVR device information for tracked devices in Unity


Dear SteamVR and Unity Community,

I have searched now a lot how I can receive information about tracked devices in Unity but it seems this is insufficiently documented or just not possible except of some exceptions like the device type.

I'm using SteamVR 2.6.1 and Unity 2019.4.8 and I would like to get either the name of my tracked device or in case it is a Lighthouse, I would like to get the channel on which the Lighthouse is working.

Is there any chance to get for example all the information that the SteamVR system report generates also via API?

Best.


Solution

  • At least I found a solution to get the device id which is unique and can be used for identification of a lighthouse:

    var id = new System.Text.StringBuilder(64);
    OpenVR.System.GetStringTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_RenderModelName_String, id, 64, ref error);
    Debug.Log(id);
    

    where i is the number of the tracked device.