Immersive Visualization / IQ-Station Wiki

This site hosts information on virtual reality systems that are geared toward scientific visualization, and as such often toward VR on Linux-based systems. Thus, pages here cover various software (and sometimes hardware) technologies that enable virtual reality operation on Linux.

The original IQ-station effort was to create low-cost (for the time) VR systems making use of 3DTV displays to produce CAVE/Fishtank-style VR displays. That effort pre-dated the rise of the consumer HMD VR systems, however, the realm of midrange-cost large-fishtank systems is still important, and has transitioned from 3DTV-based systems to short-throw projectors.

LibSurvive

From IQ-Station Wiki
Jump to navigation Jump to search

The LibSurvive library is an open-source effort to provide 6-DOF tracking of Lighthouse-based position tracking hardware. It includes a library to access the calculated 6-dof positions as well as some tools for visualizing, recording, playing back and analyzing data from the tracked devices.

For Linux-users looking to access HTC Vive and Valve Index tracking, this is a good solution, and can be paired with the Monado OpenXR runtime for a fully functioning VR system on Linux. The purpose of this document is to provide the basics needed to do exactly that.

Building LibSurvive

LibSurvive is available via git clone as:

% git clone https://github.com/cntools/libsurvive.git

I set the CMAKE_BUILD_TYPE to Release or RelWithDebInfo, and also set CMAKE_INSTALL_PREFIX to a separate directory where I will have LibSurvive installed. I've also experimented with the DOWNLOAD_EIGEN parameter, and I think the library will build fine either way, but my current build is set to ON. (NOTE: I was initially concerned because doing the actual build generated lots of warning messages, but it seems these may all be innocuous.)

(I use the "Module" system, so I do not put installations in a mixed system directory, which makes it easier to work with multiple versions.)

Basic Testing

There are a handful of things to try at this point to confirm that the basics of the system are working.

(NOTE: One aspect of your system that this will quickly highlight is whether or not you have the appropriate access permissions to the USB ports connected to the Lighthouse devices. I.e. you will need to make sure you have the correct udev rules set such that logged-in users get read-write access to the ports.)

The simplest, and first thing I try, is to run the sensors-readout program.

% sensors-readout

Truth be told, I don't really know what the numbers mean, but if you move around the HMD and hand controllers, you should see a significant change in the amount of data being reported, which I take to be a good sign. The sensors-readout program has an extensive list of options, which I haven't really evaluated, but if people have options that produce interesting output, I'd be happy to include those here.

% sensors-readout -h

The other interesting test is to build and run the api_example program:

% gcc -o api_example api_example.c -lsurvive
% ./api_example

This program will then search for a Lighthouse system, and if found, report what 6-DOF tracking devices are available. Of course, as the name implies, it also demonstrates the basics of writing a tool that makes use of the LibSurvive library. NOTE: it takes two ^C interruptions to fully stop the program.)

Tracking visualization via Web interface

One nice tool that is provided with the LibSurvive library is a Three.js application that makes use of websocketd to send tracking data to the browser script. (NOTE: I tested with a pre-built websocket version 0.3.0.)

There is a script installed in the bin directory called survive-websocketd, but I found that that script has a bug! (The bug is that it uses the --passenv argument multiple times, and more importantly, doesn't pass the LD_LIBRARY_PATH environment variable, which is required by the tool (survive-cli) that it calls! This bug won't appear on systems where the library is installed in a system library directory, but many of us don't do that, and it's still a bug.)

In the end, that script isn't really needed if you just copy/paste the following command into a terminal shell:

% websocketd -port 8080 survive-cli --record-stdout --record-cal-imu --report-covariance 30

And then in a browser window on the local machine, browse to:

file:///local-path-to-libsurvive/tools/viz/index.html

The visualization will show the position of the Lighthouses and any tracked 6-DOF position trackers, and on the position tracker, each sensor is highlighed with a sphere colored by which Lighthouse(s) it sees.

[TODO: Add a picture here.]

Ready To Continue

At this point the LibSurvive library is ready-to-go, and the next step is to build a version of the Monado OpenXR Runtime with LibSurvive compiled in.