Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SteamVR-OSVR always tells OpenVR to apply a head model #105

Open
0x1100 opened this issue Jan 10, 2017 · 5 comments
Open

SteamVR-OSVR always tells OpenVR to apply a head model #105

0x1100 opened this issue Jan 10, 2017 · 5 comments

Comments

@0x1100
Copy link

0x1100 commented Jan 10, 2017

It should not

The driver always tells OpenVR to apply a head model when supplying the tracked position.

  • When using the camera, the additional head model results in a wrong tracking.
  • When not using the camera, relying on OpenVR's head model implies we don't get one in OSVR apps/demos like the sample scene from the tray app.

Proposed solution

A head model can easily be applied in the OSVR server configuration file. We should never ask OpenVR to add one and, instead, do it ourselves in OSVR if we're not using the camera. This way, people would get the same result whether they're using a Steam app or an OSVR one.

diff --git a/src/OSVRTrackedDevice.cpp b/src/OSVRTrackedDevice.cpp
index b450f24..cfee739 100644
--- a/src/OSVRTrackedDevice.cpp
+++ b/src/OSVRTrackedDevice.cpp
@@ -882,7 +882,7 @@ void OSVRTrackedDevice::HmdTrackerCallback(void* userdata, const OSVR_TimeValue*
     pose.result = vr::TrackingResult_Running_OK;
     pose.poseIsValid = true;
     pose.willDriftInYaw = true;
-    pose.shouldApplyHeadModel = true;
+    pose.shouldApplyHeadModel = false;
     pose.deviceIsConnected = true;
 
     self->pose_ = pose;

The following alias adds a head model close to the one supplied by OpenVR.
A similar change will be done to the no-cam json files supplied by the AIO release.

"aliases": {
    "/headSpace": {
        "translate": [0.0, 0.10, -0.07],
        "child": "/com_osvr_Multiserver/OSVRHackerDevKit0/semantic/hmd"
    },
    "/me/head": "/headSpace"
}
@godbyk
Copy link
Contributor

godbyk commented Jan 12, 2017

Since this entails modifying the configuration files in the OSVR-Core repository, I would suggest posting a PR there first. Once that's been merged in, I can disable the SteamVR head model.

@0x1100
Copy link
Author

0x1100 commented Jan 12, 2017

No. It does not entails modifying the configuration files in the OSVR-Core repository since those that are complete all use the camera.

In any case, two wrongs don't make a right and both need to be fixed for the next release anyway so there is no good reason to make it drag on.

@godbyk
Copy link
Contributor

godbyk commented Jan 12, 2017

@0x1100 In your original post, you said:

A head model can easily be applied in the OSVR server configuration file.

So to clarify, is a head model is already applied in the OSVR server configuration files?

In any case, two wrongs don't make a right and both need to be fixed for the next release anyway so there is no good reason to make it drag on.

I'm trying to ensure the head model doesn't get removed entirely. I don't care whether it's applied on the OSVR server side or on the SteamVR side, but it must be one or the other, not both or neither.

@rpavlik
Copy link
Member

rpavlik commented Jan 12, 2017

There's not a head model in the default configurations in OSVR-Core nor in any config with just an IMU, though as you noted it is easy to add one.

The presence of such a transform will result in position data being reported for the interface (since rotations will result in translation as well). Thus, I suggest detecting whether or not there is such a configuration by opening an object for /me/head, waiting until it has orientation state, then checking to see if it has position state. If it does have position state, then don't apply a SteamVR head model.

@0x1100
Copy link
Author

0x1100 commented Jan 13, 2017

@rpavlik's solution is better but still sounds easy to implement.
How fast can you do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants