Skip to main content

Python wrapper for Oculus VR SDK.

Project description

Cross-platform wrapper for the Oculus VR SDK C API

Actually, it’s not terribly cross-platform, yet. It’s only supported on windows because the current release of the SDK is only available for Windows. As soon as Linux and OSX becomes available, I’ll be updating it to support them.

Installation

pip install python-ovrsdk

Use

from ovrsdk import *

ovr_Initialize()
hmd = ovrHmd_Create(0)
hmdDesc = ovrHmdDesc()
ovrHmd_GetDesc(hmd, byref(hmdDesc))
print hmdDesc.ProductName
ovrHmd_StartSensor( \
    hmd, ovrHmdCap_Orientation | ovrHmdCap_YawCorrection |
    ovrHmdCap_Position | ovrHmdCap_LowPersistence,
    ovrHmdCap_Orientation
)

while True:
    ss = ovrHmd_GetSensorState(hmd, 0.0)
    pose = ss.Predicted.Pose
    print "%10f   %10f   %10f   %10f" % ( \
        pose.Orientation.w,
        pose.Orientation.x,
        pose.Orientation.y,
        pose.Orientation.z
    )

ovrHmd_Destroy(hmd)
ovr_Shutdown()

Output:

Oculus Rift DK1
  1.000000     0.000000     0.000000     0.000000
  0.992197     0.124599    -0.000122     0.004537
  0.992192     0.124621     0.000212     0.004909
  0.992168     0.124852     0.000430     0.003814
  0.992249     0.124183    -0.000085     0.004583
  0.992164     0.124768     0.000595     0.006597
  0.992263     0.124067    -0.000134     0.004630
  0.992276     0.123989     0.000412     0.003885
  0.992275     0.123943     0.000745     0.005242
  0.992168     0.124891     0.001882     0.001237
  0.992377     0.123240    -0.000291     0.000687
  0.992316     0.123698    -0.000632     0.002837
  0.991962     0.126352     0.000245     0.006768
...

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-ovrsdk-0.1.7.zip (161.2 kB view details)

Uploaded Source

File details

Details for the file python-ovrsdk-0.1.7.zip.

File metadata

  • Download URL: python-ovrsdk-0.1.7.zip
  • Upload date:
  • Size: 161.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-ovrsdk-0.1.7.zip
Algorithm Hash digest
SHA256 b05cda16f5b05d4c8fa880a05c1609007f0268c8c1e27c296a2953b91afa7c6d
MD5 b6e4189ce8333bb47498386e538ec4ce
BLAKE2b-256 9f6e090e032d23d214f4b835a9401d2a469f4f9c7f964381fa692b07d0ff6b8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page