Skip to main content
New Participant
February 7, 2020

How to get angular velocity and acceleration of headset

Is there a way to get the angular velocity and acceleration of the VR user (the headset itself) in unity? I am only looking for angular velocity and acceleration because the user will be stationary while only moving around their head.
In the oculus developers documentation there is page titled 'get raw sensor data' but doesn't actually show how. 

Thanks!

1 reply

kojack
Honored Contributor
March 11, 2020
I haven't tried myself, but this might work:
OVRPlugin.Vector3f angularVel = OVRPlugin.GetNodeAngularVelocity(OVRPlugin.Node.Head, OVRPlugin.Step.Physics); OVRPlugin.Vector3f angularAcc = OVRPlugin.GetNodeAngularAcceleration(OVRPlugin.Node.Head, OVRPlugin.Step.Physics);
I'm not sure if the last parameter should be Physics or Render. I've seen Render used by someone on here in another thread.

Edit: I don't like posting things I haven't tried myself... so I just tested it.
The angular velocity part looks like it works correctly. The numbers seem reasonable.
The angular acceleration doesn't seem to work though, even with the headset sitting on a stable surface it has random values (positive and negative) on every axis.

Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3