We're hiring!

Lighthouse positional tracking in Monado with libsurvive

Christoph Haag avatar

Christoph Haag
July 17, 2020

Share this post:

Reading time:

Many consumer VR headsets have been sufficiently reverse engineered to develop open source drivers. But the crucial feature of positional tracking ("6DOF" tracking) remains a problem for many. For Monado we began developing an extensible positional tracking framework with the comparably simple task of tracking the glowing sphere of a Playstation Move Controllers using a stereo camera like the Playstation 4 camera. The result of this work can be tried out by following the setup guide. As a next step we are expanding this tracking to the PSVR HMD, and have completed a prototype implementation.

We also wanted to provide a means for users with HTC Vive (Pro) or Valve Index hardware to experiment with positional tracking. For this purpose we implemented a driver using the libsurvive library developed by Charles Lohr, David Berger and many contributors.

The video below shows Monado with Libsurvive in action on the godot engine, running on a fully open source stack.

The lighthouse tracking system developed by Valve makes it possible to locate the position of a device with several infrared sensors by using nothing but laser sweeps that are produced by one or two basestations. As demonstrated by Oliver Kreylos this system produces very accurate positions with very small jitter usually only found in much more expensive systems. This has also drawn interest from the robotics community.

A visualization of this system can be seen in this video and a more in depth overview is given by one of the core developers of the system in the video Alan Yates on the Impossible Task of Making Valve's VR Work. However the exact algorithms for calculating the position have not been released publicly.

A short history of open source lighthouse tracking

Over the years many people have worked on reverse engineering and implementing open source drivers for the lighthouse tracking system.

Lighthouse Redox provided early reverse engineering documentation for the HTC Vive and the Lighthouse signals.

Several contributors to the OpenHMD project implemented a first 3DOF driver for the HTC Vive. Code for basic decoding of the lighthouse signals can be found in Philipp Zabel's ouvrt "playground", though the actual tracking algorithm was still missing.

On Collabora's initiative, Lubosz Sarnecki researched an algorithm to turn lighthouse signals into a pose, and implemented it in OSVR-Vive-Libre and recorded a video, demonstrating the proof of concept. This work has been paused in favor of other projects. Recently, we have been looking into continuing this work, especially with libsurvive as a new reference implementation.

Meanwhile the libsurvive project was formed and picked up the research done in Vive-Libre and implemented a lighthouse tracking driver that worked well enough to attract interest from the robotics community: Compared to other tracking systems typically used for tracking robots indoors, the lighthouse systems with Vive Trackers provides good accuracy for a relatively low cost. Today libsurvive provides positional tracking algorithms for lighthouse 1.0 and lighthouse 2.0 for the HTC Vive, HTC Vive Pro, Valve Index, Vive Wand Controllers, Valve Index Controllers and Vive Trackers.

While Valve has not released lighthouse source code or hardware documentation (the SteamVR Tracking HDK contains some documentation under a proprietary license, so open source developers tend to avoid looking at it), Valve has been supportive of reverse engineering efforts like libsurvive by directly providing bits and pieces of information about the hardware and algorithms, as well as donating prototype hardware to libsurvive.

Building Monado with libsurvive

A simple libsurvive driver in Monado has been available early on in a branch when the OpenXR specification and Monado were first released and was used for one of the demo videos. We merged Monado's libsurvive driver to the master branch after implementing support for Vive Wand and Valve Index Controllers.

Libsurvive's tracking quality may be significantly less comfortable to use than Monado's built in 3DOF vive driver, therefore libsurvive is disabled by default and has to be enabled at build time.

To enable the libsurvive driver, first install the libsurvive library.

On Archlinux you can use the libsurvive-git AUR package.

On other distributions you will have to compile and install libsurvive yourself.

git clone https://github.com/cntools/libsurvive
cd libsurvive
cmake -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/usr
ninja -C build install

Then Monado's libsurvive driver can be enabled by compiling Monado with either cmake -DXRT_BUILD_DRIVER_SURVIVE=ON or meson -Ddrivers=auto,survive.

Otherwise compiling and Monado works just as described in the Getting Started documentation.

Running Monado with Libsurvive

When starting any application that uses libsurvive (in Monado's case that is monado-service), libsurvive searches for a directory calinfo and *config.json files for cached calibration. If no cached calibration is found, it runs calibration and stores calibration data in said files. Calibration should not take longer than 5-10 seconds during which the HMD and controllers should not be moved.

You can run monado-service directly and let it run calibration, but you can also run the calibration standalone with libsurvive's survive-cli tool until you see

Info: Position found for LH 0(d99e7eac)
Info: Position found for LH 1(fe0398ef)

printed to stdout. If anything goes wrong with the calibration or you move your lighthouse basestations, you can start over by simply deleting the calibration files: rm -rf calinfo *config.json.

For best results, during calibration place the HMD and the controllers on the floor since Monado does not come with a room setup configuration just yet. Make sure the distance to the lighthouse basestations is at least 0.5 - 1 meter.

Support for the Valve Index Controller Profile is implemented in the godot_openxr plugin.

An example project for this plugin is this fork of godot's "godot_openvr_fps" VR starter tutorial. This demo features some basic VR interactions with different weapons. and can be seen in action in the video at the beginning of this post.

Let us know if libsurvive works out for you or if you have any tricks for improving its tracking performance.

If you are in need of more precise and more reliable open source lighthouse tracking and want to support the development of our lighthouse driver, please contact us!


Comments (0)

Add a Comment

Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest News & Events

Blast from the past at Embedded World: Atari plays for Linux


Adhering to the fundamentals of open source, the Atari VCS OS is based on Debian using the Apertis infrastructure, and the graphics rely…

Up close and personal with STMicroelectronics' STM32MP2 at Embedded World


Using TensorFlow Lite models optimized for the STM3MP2 NPU along with an upstream-ready H.264 encoder (Video4Linux2), this demo showcases…

New unixfd plugin in GStreamer 1.24


GStreamer 1.24 was recently released, and with it came with a new plugin to help separate pipelines into different processes.

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2024. All rights reserved. Privacy Notice. Sitemap.