SteamVR Developer Hardware

SteamVR Developer Hardware

phr00t Mar 31, 2016 @ 6:45am
Get Headset ID String (e.g. "Vive", "Rift")?
I'm trying to use GetStringTrackedDeviceProperty to get the model ID. ETrackedDeviceProperty_Prop_AttachedDeviceId_String seems like the correct property to query, but when using the null driver, I get ETrackedPropertyError_TrackedProp_WrongDeviceClass. Querying for the model number does give me "Null Model Number", but I *think* I want the ID, which with the null driver would be "Null Driver". I presume this will be "HTC Vive" & "Oculus Rift" when those devices are plugged in, correct?

How should I be getting the names of the attached devices, and what are the possible results? Will it be "Oculus CV1", "CV1", "Rift", "Vive", "HTC Vive" etc.?
< >
Showing 1-6 of 6 comments
bendotcom  [developer] Mar 31, 2016 @ 9:29am 
If I remember correctly, the AttachedDeviceId is a (badly named) property that's mostly of internal interest to Valve. I think you want the "ModelNumber" string. If you run "vrcmd" with no arguments it will print all that stuff.

Most of the time you want to avoid looking that up and instead use an API that answers the question you really want the answer to. That way your code will keep working when an HMD you've never heard of is released. If you can't find the data you need, ask and we can figure out if it's there or if it should be added.
phr00t Mar 31, 2016 @ 9:39am 
The answer I'm looking for is: should the program default to "room scale" or seated? If an HTC Vive is detected, I probably should pick "room scale" -- otherwise, seated. Perhaps there is a better way to ask the API? Play area size threshold? Tracking system name?
bendotcom  [developer] Mar 31, 2016 @ 9:41am 
Have you looked at the IVRChaperone interface?
phr00t Mar 31, 2016 @ 9:46am 
Yes, and I see you can get the play area size. Not sure how to best go about translating those results into "this user probably wants room scale" vs "this player probably wants a seated experience". Play size under a certain number? Just seems more straight forward to just say "this person has a Rift, default to seated" (while still providing the option to change).
aaron.leiby  [developer] Mar 31, 2016 @ 3:22pm 
"Standing" returns 1x1 for play area size, otherwise you should assume room scale.
HoldenTB Mar 31, 2016 @ 4:44pm 
In Unity, SteamVR.instance.hmd_ModelNumber seems to be working well.

I believe it returns "Oculus Rift DK2" for DK2, and "Oculus Rift CV1" for CV1. Vive Pre is showing up as "Vive DVT." Don't know about the others.

You could use SteamVR.instance.hmd_ModelNumber.Contains("Oculus") to determine if you're on an Oculus headset, but it makes the assumption that future versions of Oculus headsets will also report back with "Oculus" in the name.
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Mar 31, 2016 @ 6:45am
Posts: 6