More expensive, bulkier VR rigs use multiple cameras and sensors to provide an immersive VR experience. Google's Cardboard requires only a cardboard cutout and a smartphone, both of which are already accessible to a significant population, and doesn't ask that users purchase a device purpose-built for VR. Their libraries for cardboard lack certain features however, a critical one being the ability to track the position of the device in space. By providing this feature to developers to build compelling VR experiences on commodity hardware, we can make affordable VR more of a reality for a larger audience.

What it does

In addition to the angular tracking that Google already provides for Cardboard, we provide a Unity script that does the heavy lifting for determining and making the phone track the position of the cardboard device in virtual space.

How we built it

Using the standard Android libraries for accessing accelerometer and gyroscope data, we derived the movement of a phone and mapped it to a game object in Unity.

Challenges we ran into

In the process of solving for the position of the phone, we had to deal with the possibility of imperfect hardware, fractured standards and difficult math problems.

A natural effect of the intended audience of commodity hardware is that the sensor hardware provided with such phones is not necessarily the best that the manfacturer could have bought. We also had to contend with hooks from Unity, Android and other third parties that often disagreed on units and output formats. The math involved was appropriately complex for a project that dealt with sensor readings in three dimensional space, and our members had to learn some of the tools from scratch.

Accomplishments that we're proud of

We were able to produce a working prototype of the library that runs on an Android phone.

What we learned

We learned about the intricacies of Unity and Android development while applying that knowledge to making our project a reality.

What's next for the Google Cardboard Position Tracking Unity Package

Improved accuracy, reliability and code cleanup are top priorities for coming iterations. The goal is for the library to play a role as part of a greater whole in promoting the growth and reach of VR products among users who would not have otherwised purchased a dedicated VR device.

Share this project: