RiftCat / vridge-api

VRidge API is a way to read and write all head and motion controller tracking data used by VRidge.
https://riftcat.com/vridge
MIT License
53 stars 15 forks source link

Quick description

VRidge API is a way to interact with VRidge in any language of your choice. We use ZeroMQ sockets as a low latency transport. It can work both locally and remotely through network.

VRidge API allows you to write full or partial head tracking data, read mobile tracking data and set offsets to correct drift or sync it to your coordinate system. You can also send controller states (buttons, triggers, touchpads), and transforms (motion controller orientation and position in 3D space).

Everything is loaded as single VRidge OpenVR driver. Some of the above things can be done through writing separate OpenVR drivers but VRidge API has benefits of two-way communications with an ability to mix coordinate systems in a more elastic way. It is also more stable than separate OpenVR drivers potentially providing conflicting data.

Getting started

General requirements

VRidge API is accessible over TCP, abstracted by ZeroMQ sockets. This allows you to use API any language that you choose. See ZeroMQ language bindings page and get library for language of your choice.

Requirements for this example

This repository contains example implementation of API client in .NET. You can use it in your .NET projects by simply building and referencing the APIClient project.

C# projects require:

Both are referenced as NuGet packages in .csproj and will be restored on pre-build.

API usage

Simple fire-and-forget access

If you don't want to manage connection state, you can use fire-and-forget access layer which manages the connection state for you. See VridgeRemote for more details.

Advanced usage

Control endpoint

This endpoint provides two functions:

See control channel wiki page for details.

Data endpoints

Data channels are used to interact with VRidge and send/receive actual data. Currently we have two endpoints. See pages below for details.

Controller API allows you to send VR motion controller state without writing a full OpenVR driver. This allows a more stable experience since only one driver is loaded in SteamVR.

See Controller API for protocol and details.

Head tracking endpoint allows you to control head tracking in a variety of modes. You can use it to provide positional, rotational or combined data. You can also read mobile sensor data and provide an offset. You can also modify phone tracking data in real time before it's used for rendering in VR.

See Head Tracking API for protocol and available modes

Broadcast endpoint carries one-way notifications. Currently only haptic pulses are propagated through broadcast channel. It is implemented as ZMQ PUB-SUB sockets.

See Listening to broadcasts.

Changelog

API v3.1 (VRidge 2.3+)

Additions

Changes

API v3 (VRidge 2.0+)

API v2 (VRidge 1.5)