Easily track pose data from OpenVR devices via OSC
OpenVR OSC is a compact Python utility for tracking OpenVR devices (HMDs, controllers, trackers) and getting their position and rotation values over OSC. It can be used in VR as well as AR and any other position-based project and fed to any OSC-capable client.
This project is inspired by and used Triad's Python OpenVR wrapper.
This project requires Python 3
to run as dependencies are incompatible with Python 2.7
.
It also required an existing OpenVR installation (SteamVR etc.) and compatible hardware (HTC Vive etc.).
To install the project dependencies run pip install -r requirements.txt
.
To run OpenVR-OSC enter the following in your terminal:
python3 openvr-osc.py
The following devices are tracked and sent via OSC:
- headsets (HMDs)
- controllers
- tracker units
The OSC messages sent are formated in as follows:
\{DEVICE_TYPE}\{DEVICE_ID} - [f,f,f,f,f,f]
Each message contains multiple float values in an order set by the pose mode
:
In Euler
mode:
- x position
- y position
- z position
- yaw
- pitch
- roll
In Quaternion
mode:
TBC
Each tracking cycle is sent as a bundle of individual messages, per device, that are time synced.
There are several configuration options to customize the OSC feed and the tracking
OSC server ip
Set the ip of the OSC server - `--ip 169.78.65.21` Defaults to `127.0.0.1 (localhost)`.OSC server port
Set the port of the OSC server - --port 5000
Defaults to 7000
.
tracked device type
By default all device types are tracked but that can lead to unnecesary OSC traffic. If you know which device type you'd like to track (HMD, controllers, trackers), you can limit the tracking:
--track=[hmd|controller|tracker]
tracking frequency (coming soon)
> coming soonpose mode (coming soon)
> coming soon
To use the trackers and controllers without the need for a headset follow in the instructions in this tutorial.
- period check for device state and new tracked devices
- adjustable tracking frequency
- adjustable pose tracking mode (euler/quaternion)
- unique tracked device ids
Made at ITP NYU