https://github.com/barakchamo/openvr-osc
A Python utility for sending OpenVR over OSC
https://github.com/barakchamo/openvr-osc
motion-tracking openvr osc python steamvr vr
Last synced: 12 months ago
JSON representation
A Python utility for sending OpenVR over OSC
- Host: GitHub
- URL: https://github.com/barakchamo/openvr-osc
- Owner: BarakChamo
- Created: 2018-04-03T08:05:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-03T12:57:17.000Z (about 8 years ago)
- Last Synced: 2025-06-28T11:04:22.363Z (12 months ago)
- Topics: motion-tracking, openvr, osc, python, steamvr, vr
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 25
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenVR OSC
> 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](https://github.com/TriadSemi/triad_openvr).
## Setup
### Requirements
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.).
### Installation
To install the project dependencies run `pip install -r requirements.txt`.
## How to use
To run OpenVR-OSC enter the following in your terminal:
`python3 openvr-osc.py`
### Tracked devices
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]`
### OSC message format
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.
### Configuration options
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 soon
pose mode (coming soon)
> coming soon
## Using SteamVR without a headset
To use the trackers and controllers without the need for a headset follow in the instructions in [this tutorial](http://help.triadsemi.com/steamvr-tracking/steamvr-tracking-without-an-hmd).
## Roadmap
- [ ] 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