Giter Site home page Giter Site logo

ebadier / vivetrackers Goto Github PK

View Code? Open in Web Editor NEW
33.0 1.0 9.0 6.29 MB

A simple library to use HTC Vive Tracker devices in Unity

License: MIT License

C# 100.00%
unity3d vive-trackers openvr csharp tracking htc-vive virtual-reality motion-capture steamvr

vivetrackers's Introduction

alt text

Use HTC Vive Tracker devices in Unity3D with the following benefits

  • Directly use OpenVR API for best performance
  • Current features include update of positions, rotations, and Pogo-Pins buttons
  • Small library, easy to integrate in any projects
  • A simulator, to develop without having a Vive tracking system connected
  • A complete test scene to understand the use of the library
  • Some documentation to setup Unity3D, SteamVR (with & without an HMD connected), and Windows to get the best tracking quality from your Vive Trackers

Getting Started

1. Open SteamVR, configure your tracking space, connect your Vive Trackers, and leave SteamVR running in the background.

2. Open the ViveTrackersTest scene in Unity and press Play.

3. Hotkeys used to control the application:

  • F1 : show/hide local reference frames of ViveTrackers.
  • F5 : refresh the list of currently connected ViveTrackers.
  • F8 : calibrate the ViveTrackers (make their local reference frames aligned with the Origin reference frame).
  • F6 : save the last calibration.
  • F7 : load the last calibration.

4. Understanding the code:

  • The update of all ViveTrackers (position, rotation, and optionally buttons) happens at the first line in ViveTrackersTest.Update(), see ViveTrackersManager.UpdateTrackers() for more details.
  • ViveTrackersManager contains a list of all connected ViveTrackers.
  • Optionally, ViveTrackersManager can create only a restricted set of ViveTrackers declared in the file ViveTrackers.csv (see documentation/"Keep Vive Trackers identification consistent during runtime").
  • To log your ViveTrackers serial numbers in the console, ensure ViveTrackersManager.logTrackersDetection is enabled in Unity editor.
  • You can access the last position/rotation of ViveTrackers using their transform.localPosition/localRotation.
  • You can also register to some actions to know if the pogo-pins corresponding to Grip/Trigger/TouchPad/Menu buttons are pressed or released.

System requirements

Unity 2017.4.35f1 and newer versions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.