Python bindings for Valve's OpenVR virtual reality SDK
Clone or download
cmbruns Update to OpenVR 1.13
Incorporate untested fixes #42 & #44
Latest commit 7feab43 Mar 24, 2018

README.md

pyopenvr

Python bindings for Valve's OpenVR virtual reality SDK

Installation

Use

import sys
import time
import openvr

openvr.init(openvr.VRApplication_Scene)

poses_t = openvr.TrackedDevicePose_t * openvr.k_unMaxTrackedDeviceCount
poses = poses_t()

for i in range(100):
    openvr.VRCompositor().waitGetPoses(poses, len(poses), None, 0)
    hmd_pose = poses[openvr.k_unTrackedDeviceIndex_Hmd]
    print(hmd_pose.mDeviceToAbsoluteTracking)
    sys.stdout.flush()
    time.sleep(0.2)

openvr.shutdown()