Giter VIP home page Giter VIP logo

psvr-steamvr-openhmd's Introduction

SteamVR Plugin for OpenHMD Drivers

Modified version of https://github.com/ChristophHaag/SteamVR-OpenHMD

Updated openHMD and some pull requests for PSVR, otherwise building should be the same

use cmake3 rather than cmake on RH/CentOS builds, cmake defaults to version 2 and this uses version 3 which is a different command on RH/CentOS.

Status/TODO

  • controller buttons are currently unimplemented and pressing any button does nothing
  • controller models - OpenHMD doesn't provide a method (yet) to get rendermodels, so default (Steam Gamepad controller) is used
  • Controllers are not used by default because of those limitations. To change the default you can use the config file mechanism (on Linux) or change the default config in ohmd_config.h in the else branch (index 2 and 3 are controllers) before compiling

Possible improvements:

  • updating tracking data asynchronously in a separate thread might improve smoothness (if there is a problem)
  • feeding vector acceleration values to SteamVR? Would that improve tracking or make OpenHMD's tracking worse?

Before building: Use latest git OpenHMD (optional)

cd subprojects/openhmd
git pull origin master

Build with cmake:

git clone --recursive https://github.com/ChristophHaag/SteamVR-OpenHMD.git
cd SteamVR-OpenHMD
mkdir build
cd build
cmake ..
make

OpenHMD is included as a git submodule. An OpenHMD shared library will be built first and the steamvr plugin will link to the OpenHMD library built in build/external/openhmd/libopenhmd.so. If you want to package the SteamVR plugin, make sure you have libopenhmd.so in your library search path or package the openhmd library too and change the rpath.

If you use the Vive and want to use the (imperfect) values from OpenHMD/OpenHMD#90, go to external/openhmd and run git pull origin pull/90/head before the make step to merge the pull request locally.

Run (easy for linux):

Run ./register.sh.

This overwrites SteamVR's settings with a steamvr.vrsettings that disables all SteamVR hardware plugins that ship with SteamVR (Vive lighthouse, Oculus, etc). The current SteamVR config will be backed up to steamvr-config-backup/. Then it registers the current build directory as a SteamVR plugin.

To do the reverse, run ./unregister.sh.

Run (detailed for linux, adapt to your operating system)

First register the driver with SteamVR:

~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrpathreg adddriver ~/SteamVR-OpenHMD/build

The directory given to vrpathreg should contain driver.vrdrivermanifest, resources/ and bin/linux64/driver_openhmd.so.

If you use a HMD for which SteamVR already has a plugin (currently Vive and Oculus Rift), copy the steamvr.vrsettings file that disables those plugins into Steam's config directory.

cp ~/SteamVR-OpenHMD/steamvr.vrsettings ~/.local/share/Steam/config/steamvr.vrsettings

Don't forget to make a backup if you have special SteamVR settings.

Now run SteamVR and check ~/.local/share/Steam/logs/vrserver.txt for errors.

Build and run with docker:

git clone --recursive https://github.com/ChristophHaag/SteamVR-OpenHMD.git
cd SteamVR-OpenHMD
docker.sh

This will create a docker container running the same GCC as Steam uses, so the driver will be compatible with Steam runtime libstdc++ library. The script docker.sh will create the container, build the driver, register it with steam (using vrpathreg adddriver as described above) and, if the build is successful, it launches steamVR using STEAM_RUNTIME_PREFER_HOST_LIBRARIES=0 so Steam uses it's own runtime environment to run steamVR.

This method is simpler to build the driver and builds a driver fully compatible with the steam runtime, no matter the distro you're running. You just need to have Docker installed!

Configuration:

Upstream pull request to follow: OpenHMD/OpenHMD#8

For now. $HOME/.ohmd_config.txt is used.

Example content for a HMD 0, nolo HMD tracker 1, nolo controllers 2 and 3:

hmddisplay 0
hmdtracker 1
leftcontroller 2
rightcontroller 3

or a single HMD 0 with no controllers

hmddisplay 0
hmdtracker 0
leftcontroller -1
rightcontroller -1

This defines 4 openhmd devices.

  • hmdddisplay is opened for the display config. Choose this for the actual HMD like Vive, Oculus Rift, etc.
  • hmdtracker is opened for tracking the head. Choose a different index than the HMD if you have a NOLO tracker (or in the future a Vive tracker).
  • leftcontroller and rightcontroller are the indices for the controllers. There are no separate trackers for controllers for now but it's easy to hack in.

If the config file is not available (probably only works on linux), default values are used. Change them in ohmd_config.h.

psvr-steamvr-openhmd's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

psvr-steamvr-openhmd's Issues

Requirements for PSVR, partial success.

Found the project and attempted an install with partial success.

Initially driver was unable to connect to PSVR, until I installed the UDEV rules from:
https://gitlab.freedesktop.org/monado/utilities/xr-hardware/-/blob/master/70-xrhardware.rules

Now I can see the PSVR detail in the log (attached). SteamVR shows the presence of the device in its window, but no VR apps run and shortly after starting them the headset falls back to 'standby'.

I suspect I am missing some important GFX requirement... i am running Xubuntu 18.04.

vrserver.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.