mdcutone / psychxr

Python extension library for interacting with eXtended Reality displays, intended for research in neuroscience and psychology.
Other
39 stars 6 forks source link

Why limit yourself to ovr when OpenVR/SteamVR supports Oculus and many more headsets? #1

Open mdovgialo opened 5 years ago

mdovgialo commented 5 years ago

Hello, I just noticed that this project was created to support VR in Psychopy. But I have a question. Why there was a decision to limit yourselves to Oculus Rift platform? OpenVR/SteamVR supports Rift and many other headsets (HTC Vive, all Windows Mixed Reality sets, upcoming Pimax headsets and, with custom drivers, phone VR, PlayStationVR etc.) and already has great python bindings: https://github.com/cmbruns/pyopenvr

Are there plans to support OpenVR in the future? Or maybe Revive https://github.com/LibreVR/Revive (OpenVR / Oculus SDK wrapper library - allows to run Oculus SDK apps using OpenVR runtime on any OpenVR supported sets) be supported instead? This would require testing and maybe some little tweaks?

mdcutone commented 5 years ago

Thank you for your inquiry.

I'm currently exploring additional support for other platforms via OpenHMD and/or OpenVR. There is an effort underway to restructure PsychXR to accommodate these additional APIs neatly.

mdcutone commented 5 years ago

I started a feasibility study on including OpenVR into PsychXR. It's going to be a lot of work, but quite doable. I'll need to work on this when I have some downtime later this summer.

spektre1 commented 4 years ago

Hey, I'm working on a project to get PsychoPy to work with a Valve Index. I also have an oculus rift available to test with. If you have some work done on this already, I'd be very interesting in discussing how we could move forward.

mdcutone commented 4 years ago

Hey, I'm working on a project to get PsychoPy to work with a Valve Index. I also have an oculus rift available to test with. If you have some work done on this already, I'd be very interesting in discussing how we could move forward.

That's awesome! I'm very excited to see where you will take this.

I've haven't made a lot of progress on other drivers yet in PsychXR. Last summer I worked on getting both OpenHMD and OpenVR working, but I've decided that OpenXR is the way to go since it's a standard so I stopped working on those drivers. However, I haven't made much progress on that since I'm waiting for Oculus to provide full support on that front.

Contributing a driver plugin to PsychXR requires simply writing a wrapper in Cython around the VR library of your choice (eg. OpenVR for the Index). You can mix C/C++ and Cython as needed, but the software must follow a similar design pattern with the existing LibOVR interface (eg. uses numpy arrays for vectors) to be integrated as a backend into PsychoPy. I can provide guidance and resources at each stage from writing the driver interface to getting it integrated into PsychoPy.

We can discuss what steps you can take in more detail over email.

mdovgialo commented 4 years ago

OpenVR and OpenXR have Python bindings. I never tried OpenXR (I have SteamVR headset, which only last week or so started beta support of OpenXR), but OpenVR bindings work quite well.

In other news Valve are gonna treat OpenVR as legacy API and focus promoting/adding features to OpenXR. OpenXR is now supported (at least in beta) by all major "proper" VR hardware (Oculus, Windows Mixed Reality, SteamVR based headsets). https://steamcommunity.com/games/250820/announcements/detail/2522527900755718764 So, yes, supporting OpenXR should be the best way forward.

I wonder, maybe Oculus can use SteamVR OpenXR implementation too?

mdcutone commented 4 years ago

In other news Valve are gonna treat OpenVR as legacy API and focus promoting/adding features to OpenXR.

I wasn't aware of this, thanks.

I wonder, maybe Oculus can use SteamVR OpenXR implementation too?

I'm hoping that's how it will work.

mdovgialo commented 4 years ago

I mean, SteamVR has already OpenXR API implemented in the beta branch, and supposedly all headsets which have SteamVR drivers should be able to use OpenXR through SteamVR. I think you could actually can try it now, if Oculus OpenXR implementation is lacking. I can't say how feature complete SteamVRs OpenXR support is, but for example Blender VR mode works.

mdcutone commented 4 years ago

The main issue at this point is having the time at add another driver, it needs to be something that provides the greatest return in the long run which seems to be OpenXR. PsychXR was intended to support multiple drivers at one point as plugins. Where you can select which platform to install à la carte.

For now, the LibOVR driver works well enough and people are getting a lot of use out of it with PsychoPy. However, I'm mindful of the concerns that come about supporting a single driver and the limitations of Oculus HMDs over others on the market. The biggest problem I have with it is the inability to ship the Oculus SDK (header files and libraries) with the code due to licensing. This makes building PsychXR a pain for people on other Python versions, so something more open will help on this front.

I'm pretty invested into supporting PsychXR long term, so OpenXR is certain to find it's way into PsychXR once things settle down on my end or if another developer gets involved.

mdcutone commented 3 years ago

Presently working on adding support for OpenXR. Going to be a huge amount of work but I have the extension building and linked to the OpenXR loader. Checkout the openxr branch for developments on that front. If anyone wants to contribute, I'll help out as much as possible to get you up to speed with the process.