User Tools

Site Tools


Setting Up OpenVR

Author: Keitaro Nishimura Email: [email protected]
Date: Last modified on 05/05/17
Keywords: OpenVR, Tutorial, Setup

The photo above depicts the what the reader would see when running the “Hello World” demo for OpenVR. This tutorial shows you how to download and run the “Hello World' example for OpenVR.

Motivation and Audience

This tutorial's motivation is to teach readers how to get and use the OpenVR SDK for applications with the HTC Vive. Readers of this tutorial are assumed to have the following background and interests:

*Basic knowledge and experience with c++
*Interests in using the HTC Vive for research

The rest of this tutorial is presented as follows:

  • Parts lists and Sources
  • Downloading OpenVR
  • Running the “Hello World” code
  • Final Words

Parts Lists and Sources

-You will need all of the parts used in the tutorial before this and nothing more.

Part Name/Description Vendor Vendor URL Qty Notes
HTC Vive Kit Vive or Fry's or 1The kit will come with all the necessary hardware. 1 Vive HMD (head mounted display), 2 lighthouse base stations, 2 controllers, and the cables and power sources needed.
A computer with at least a GTX 1060 or equivalent Amazon reference the recommended computer specs for any computer the reader plans to use. The lab however already has a computer specifically for research with the vive.
Tripod mounts for lighthouse base stations Amazon or build in-house 2 Since the base stations have a standard camera mounting hole on the bottom any standard camera tripod should work. You can also use scrap pieces of 2×4 wood to create your own mount for them.

Downloading OpenVR

OpenVR is a github repository that is open for use on all platforms (Windows, OSX, Linux). For this tutorial, we will be doing everything within Windows 10. However, this does not mean that it isn't possible to use OpenVR with a different OS.
If you are using the lab HTC Vive dedicated computer shown in the last tutorial you can skip this section.

1. Once on the OpenVR Github page, click on the clone or download button on the right-hand side of the page and download the Zip file to your computer. While you are on the page locate the Issues and Wiki tab. These tabs hold all of the information you will need to use the SDK. The wiki tab has all of the documentation for the API while, the Issues tab is where people can ask developers or other users of the SDK solutions to issues that they run into.

2. Once you have downloaded the zip file extract it to a directory that is easy for your to access. You will be pointing to this folder when developing code later on so putting it in the “C:” or similar directory will make your life easier later on.

3. If you already have Microsoft Visual studios on your computer you can skip this step (the lab computer is setup already), unless you are using a 30-day trial. Follow this link and download Visual Studio Community. This may take a while. Once done, follow the installation instructions and before finalizing the installation do not ignore initializing your copy. All you need to do is use the Microsoft email (or create a throwaway one) and you will have that copy of visual studios for life.

Running the "Hello World" code

Now that you have visual studios and OpenVR on your computer you can finally run the hello world example.

1. Open the OpenVR folder and find the samples folder. This is the folder that has all of the example code.

2. Once in go into the hellovr_opengl folder. This is the hello world example of how to use OpenVR.

3. Now find the hellovr_opengl file (the file without extensions) and open it with visual studio.

4. If you aren't shown the main cpp code you can find it by expanding the project tree inside the solution explorer. If you haven't plugged in the HTC Vive into the computer yet please do so now. At the top of the IDE you will see a green play button labeled Local Windows Debugger, by clicking that button you will be able to run the hellovr project code. After clicking it you may be prompted to build the code first before running, build the code.

5. You will now see a matrix of cubes with the same picture on all 6 sides that you are able to walk through using the Vive.

Final words

This tutorial's objective was to teach the reader how to download and run the hello world example for the OpenVR SDK.

The reader can now move on to the next tutorial which will teach the reader how to set up a visual studio environment for development using the OpenVR SDK and how to use the Vive controllers to move a Dynamixel servo.

setting_up_openvr.txt · Last modified: 2017/05/05 12:33 by keitaronishimura