Fredz66 / PS-Move-Setup

A utility to co-register the PS Move/PS Eye with the Oculus DK2.
9 stars 4 forks source link

PS Move Setup

Introduction

PS Move Setup is a co-registration utility for the PS Move + PS Eye using the Oculus DK2 tracker as a reference.

The goal is to show the PS Move controller in the same space referential than the Oculus DK2 to support 1:1 hand tracking in virtual reality applications.

Video

PS Move Setup

Description

It's written for Unity 5 and cboulay version of the PS Move API, which features a new tracking algorithm and an updated implementation of the PS3EYEDriver driver for the PS Eye.

It's been developed for MS Windows but it should hopefully work on OS X. Linux support would probably require some code adaptation.

Previously the only driver available for MS Windows was the CL Eye driver but it was not free, unrealiable, it didn't support 64 bit applications and looked basically unmaintained.

Instructions to set up the PS Move and the PS Eye on MS Windows and OS X can be found here : https://github.com/cboulay/psmove-ue4/wiki

Download and build

Clone this repository locally then open it with Unity 5.1. Then build the project.

Strap the PSMove to the DK2 (e.g., using rubber bands) and place them both in view of their cameras. Run the exe file you built with Unity. When the application is running, move the headset-controller around their workspaces. After 300 samples are collected, the utility will update the position of the PSMove controller in the same coordinate space as the DK2.

Implementation

The utility reads several hundreds positions of the PS Move and the Oculus DK2 (strapped together with rubber bands), stores them in a list of correlated positions and computes the rotation, translation and scale between the two sets of 3D points.

It's known as the Wahba's problem and can be solved with the Kabsch algorithm.

~The implementation uses the Horn method which is based on quaternions and seems to be more robust, precise and numerically stable than the SVD method.~

EDIT: The initial implementation used the Horn method but it wasn't a solution to the problem. The current one uses the QR15 calibration algorithm published in 2012 by Floris Ernst. Here is the publication : https://www.rob.uni-luebeck.de/publikationen_downloads/ermm_12.pdf-b46951f770e1e17036ee6b18fe686a1b.pdf

There was an error in the original algorithm though, I described the correction here : https://forums.oculusvr.com/developer/discussion/comment/276423/#Comment_276423

A first step of outlier rejection is implemented using the absolute deviation around the median.

The Math.NET Numerics library is used for the implementation of the Horn method (eigendecomposition of a matrix).

Screenshots

PS Move Setup in Unity editor

PS Move Setup in Unity

PS Move Setup detail

Status

The utility is not complete yet. The registration code is functional and works correctly with test data, but the results are still unreliable when using the positions read from the PS Move. It's most probably because of noise or distortion in the tracking algorithm.

Future

The goal is to reliably compute the rotation and translation between the two space referentials, obtain the corresponding transformation matrix and store it in a file in the C:\Users\<Username>\AppData\Roaming\.psmoveapi directory so it can be used directly by VR applications and games.

Relevant discussions

Note: the Oculus Development Kit 2 3D model is from MannyLectro.