LightHouse-UESTC/Code/triad_openvr
詹力 81da026de3 upload initial version. 2023-11-29 13:21:56 +08:00
..
images upload initial version. 2023-11-29 13:21:56 +08:00
.gitignore upload initial version. 2023-11-29 13:21:56 +08:00
README.md upload initial version. 2023-11-29 13:21:56 +08:00
config.json upload initial version. 2023-11-29 13:21:56 +08:00
controller_test.py upload initial version. 2023-11-29 13:21:56 +08:00
example_default.vrsettings upload initial version. 2023-11-29 13:21:56 +08:00
tracker_test.py upload initial version. 2023-11-29 13:21:56 +08:00
triad_openvr.py upload initial version. 2023-11-29 13:21:56 +08:00
udp_emitter.py upload initial version. 2023-11-29 13:21:56 +08:00
udp_receiver.cs upload initial version. 2023-11-29 13:21:56 +08:00

README.md

Triad OpenVR Python Wrapper

This is an enhanced wrapper for the already excellent pyopenvr library by cmbruns. The goal of this library is to create easy to use python functions for any SteamVR tracked system.

Getting Started

import triad_openvr as vr
import pylab as plt
v = vr.triad_openvr()
data = v.devices["controller_1"].sample(1000,250)
plt.plot(data.time,data.x)
plt.title('Controller X Coordinate')
plt.xlabel('Time (seconds)')
plt.ylabel('X Coordinate (meters)')

Example plot of captured data

Configuration file

The goal is to identify devices by serial, in order to keep the same name for the same physical device. for maing it work, you just have to change serials and names in the 'config.json' file. Here is an example of config file :

{
    "devices":[
        {
          "name": "hmd",
          "type": "HMD",
          "serial":"XXX-XXXXXXXX"
        },
        {
          "name": "tracking_reference_1",
          "type": "Tracking Reference",
          "serial":"LHB-XXXXXXXX"
        },
        {
          "name": "controller_1",
          "type": "Controller",
          "serial":"XXX-XXXXXXXX"
        },
        {
          "name": "tracker_1",
          "type": "Tracker",
          "serial":"LHR-XXXXXXXX"
        }
    ]
}