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

OculusGO Controller position after camera.resetYaw() #2031

Open
mpolsz opened this issue Feb 26, 2019 · 8 comments
Open

OculusGO Controller position after camera.resetYaw() #2031

mpolsz opened this issue Feb 26, 2019 · 8 comments

Comments

@mpolsz
Copy link

mpolsz commented Feb 26, 2019

In our app we use mainScene.getMainCameraRig().resetYaw(); to recenter user view to known position. After resetYaw() camera is reseted properly (user looks in [0,0,-1] direction) but Oculus Go controller is pointing in semi random direction. You can reproduce this bug in my fork. Start application, turn head 90 degrees left or right and pull trigger on controller to call .resetYaw(). Scene will be in front of user but controller will point in wrong direction.

@liaxim
Copy link
Contributor

liaxim commented Feb 27, 2019

@mpolsz Couldn't reproduce with GearVR and the latest master. Will try Oculus Go tomorrow.

@liaxim
Copy link
Contributor

liaxim commented Feb 28, 2019

@mpolsz On Oculus Go it seems reasonable to me too. The controller points to where it pointed before in my tests, though one might expect the controller to be completely recentered (point to the center of the screen).

I am probably missing something so: how is the use of resetYaw different for you then long-pressing the Oculus home button which does the same thing semantically?

Attached a video of what I am seeing on Oculus Go.
video.zip

@mpolsz
Copy link
Author

mpolsz commented Feb 28, 2019

@liaxim My bad, I wrote about turning head 90 degrees and what I meant was head AND controller. On video you point controller in [0, 0, -1] direction so it does not go out of sync. I will try reproducing this bug and upload video tomorrow.

@liaxim liaxim added bug and removed question labels Feb 28, 2019
@liaxim
Copy link
Contributor

liaxim commented Feb 28, 2019

@mpolsz Ok, got it. Will look into it. Btw isn't long-pressing the home button on the controller doing what you want?

@liaxim
Copy link
Contributor

liaxim commented Feb 28, 2019

@mpolsz See #2032.

@mpolsz
Copy link
Author

mpolsz commented Mar 1, 2019

@liaxim I can confirm that using getGVRContext().recenterPose() instead of mainScene.getMainCameraRig().resetYaw() works as intended.
One more thing we found out is that framework uses resetYaw() internally in GVRViewManager::updateSensoredScene and it can sometimes mess with rotation.

@liaxim
Copy link
Contributor

liaxim commented Mar 1, 2019

@mpolsz Thanks for pointing updateSensoredScene out. Will look into that. Why wouldn't you rely on long pressing the home button on the controller to recenter?

I am unsure we can merge this change though. It is not likely easy to implement for Daydream. There is no similar API in Daydream that does what Oculus' vrapi_RecenterPose does. Daydream says this:
On the Daydream platform, recentering is handled automatically and should never be triggered programatically by applications..

@mpolsz
Copy link
Author

mpolsz commented Mar 1, 2019

In our app (Evryplace) we reset pose automatically every time user changes scene (our internal scene, not GVRf one). We do that, so after arriving in next scene user faces predefined direction independent of headset rotation.
What we do on scene change is basically:

  1. reset pose so user faces [0,0,-1]
  2. initialize all scene objects (with common root object)
  3. rotate common root with predefined rotation (only yaw)
    That way first thing user sees on scene change is whatever we define as arrival direction

@liaxim liaxim added enhancement and removed bug labels Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants