Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

How to get angular velocity and acceleration of headset

naomi_k123naomi_k123 Posts: 6
NerveGear
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!

Comments

  • kojackkojack Posts: 6,142 Volunteer Moderator
    edited March 11
    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.

Sign In or Register to comment.