Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

[Oculus Go] Disable forced recenter after putting headset back on.

joeyvrowljoeyvrowl Posts: 3
NerveGear
edited May 2018 in Mobile Development

Hi all,


TL;DR Has anyone found a way to disable the forced recenter after putting the headset back on, or are there any plans to add such a feature?


I am a developer of a VR company that runs a lot of events, often with dozens or even hundreds of devices at once. Using the GearVR, users can pick up the headset and are immediately put back into any app that was running. However, the Oculus Go forces you to use the controller to recenter first, or use a volume button when in developer mode. This is a big problem for us, because most of our applications do not require user input so we would rather not have the controller there. Having hundreds of people who have never put on a VR headset press a small button right next to the power button that turns of the screen will surely result in chaos. The ability to turn this off in the settings (either device-wide or in our app) would solidify our use of the Oculus Go for pretty much every event going forward, but without it we are a bit hesitant.

Comments

  • ooBLANKAooooBLANKAoo Posts: 4
    NerveGear
    I'll add a +1 to this feature as well.  
    Also handy at events it the feature on daydream that disables the home button - you just add the program to the list.
    That way they can try as they may but can't exit the app they are supposed to be in.  (maybe a triple click to exit back to home)
  • oLEq00oLEq00 Posts: 10
    NerveGear
    Hi, bump to this post.
    It would be really handy to be able to disable the screen that asks you to hold oculus button on controller. Like said before, there are some use cases that are fine with GearVR cause it just pauses the app, and are impossible with GO since it needs user input.
    Any chance this will be possible through SDK?
  • TheSwanCollectiveTheSwanCollective Posts: 6
    NerveGear
    edited May 2018
    Please disable the forced user input. I'm using it in art exhibitions and there can't be any hassle with pushing buttons.
    It's very important this gets adjusted!
  • MintPotMintPot Posts: 23
    Brain Burst
    Please disable the forced user input. I'm using it in art exhibitions and there can't be any hassle with pushing buttons.
    It's very important this gets adjusted!
    how can i do? 
  • ooBLANKAooooBLANKAoo Posts: 4
    NerveGear
    Is there any update on these features?  I have an event coming up and im looking at purchasing more go's for it

  • icespace-devicespace-dev Posts: 2
    NerveGear
    +1
    We really need this feature as well. Being able to turn this off is necessary to make the Go viable for commercial events, where apps often do not require user input at all.
  • DevZukunDevZukun Posts: 2
    NerveGear
    +1 bump.  We are planning to use the Go in a public setting and really need this feature.  
  • HerpalismHerpalism Posts: 1
    NerveGear
    +1 Another bump as well. We've just recently ported our kiosk videoplayer app to the Oculus Go, and it's completely unusable with the forced controller input.
  • StudioRXStudioRX Posts: 2
    NerveGear
    edited October 2018

  • StudioRXStudioRX Posts: 2
    NerveGear
    We're running an Oculus GO Kiosk so we needed a way around this as well so here is my slightly hack solution:

    DoNotRecenter.cs
    using System.Collections;  
    using UnityEngine;  
    
    public class DoNotRecenter : MonoBehaviour {   private GameObject container;   public GameObject camera;   private List<float> rotations; private bool headsetOn = true;  
    void Start () {    container = this.gameObject;   OVRManager.HMDMounted += HMDon;   OVRManager.HMDUnmounted += HMDoff;   rotations = new List<float>();    } void Update() { if(!headsetOn) {   float currentRotation = Mathf.Rad2Deg * camera.transform.rotation.ToEulerAngles().y;   rotations.Add(currentRotation);   }   }  
    void HMDon() {    headsetOn = true;   float[] rotationArray = rotations.ToArray(); if(rotationArray.Length > 2) { float lastRotation = rotationArray[rotationArray.Length - 2];   container.transform.eulerAngles = new Vector3(0f, lastRotation , 0f);  }   rotations = new List<float>();   }  
    void HMDoff() {   headsetOn = false;   }   }  

    And here is where you would apply the script:


    Basically you need to wrap the OVRCameraRig in a Container thats angle is updated whenever the headset is replaced.

    I'm not a C# Developer so it'd be great if someone could improve upon this. The Array/List doesn't need to grow infinitely as we only need to hang on to a second or two of rotation data. This also creates a momentary "jump" where the Go is adjusting the angle, then the script adjust's it back, a simple dip-to-black that appears when the headset is removed and fades off when coming back into the app should cover that app just fine.
  • ryo_liveplanetryo_liveplanet Posts: 1
    NerveGear
    edited October 2018
    Hi StudioRX, thank you for the starting point!
    Your code worked perfectly and I really appreciate that you've shared it with all of us.
    Here's my tweak to your code and I hope someone finds this useful too:

    OculusGoHmdRecenteringCanceller.cs
    using System.Collections.Generic;
    using UnityEngine;

    /// <inheritdoc />
    /// <summary>
    /// Cancels out Oculus Go's default camera recentering behaviour when HMD is put back on.
    /// Attach this script to the parent object of OVRCameraRig and
    /// drag n drop the center camera to the "Camera" field in the inspector.
    /// The cancellation will happen one frame delayed to the recentering, so
    /// you should additionally implement some fading transition (noted in the code below).
    /// See original discussion and code by StudioRX:
    /// https://forums.oculusvr.com/developer/discussion/64728/oculus-go-disable-forced-recenter-after-putting-headset-back-on
    /// </summary>
    public class OculusGoHmdRecenteringCanceller : MonoBehaviour
    {
    [SerializeField]
    Transform _camera;

    Queue<float> _pastAngles;

    void Start()
    {
    _pastAngles = new Queue<float>();
    OVRManager.HMDMounted += () => OnHmdMounted();
    OVRManager.HMDUnmounted += () => OnHmdUnmounted();
    }

    void Update()
    {
    if (OVRPlugin.userPresent) return; // Pass if the HMD is on.

    // We will recover this angle when the HMD gets put back on.
    float currentAngle = _camera.eulerAngles.y;

    // Cache the current angle to recover it later.
    // It's safer to look one or two frames back because
    // we might happen to cache an angle AFTER the recentering has happened.
    _pastAngles.Enqueue(currentAngle);
    while (_pastAngles.Count > 2)
    {
    _pastAngles.Dequeue();
    }
    }

    void OnHmdMounted()
    {
    if (_pastAngles.Count == 0) return; // Pass if nothing is cached.

    // Do recover using the cache.
    float recoveryAngle = _pastAngles.Dequeue();
    transform.eulerAngles = new Vector3(0f, recoveryAngle, 0f);

    _pastAngles.Clear();

    // TODO "Fade in" here
    }

    void OnHmdUnmounted()
    {
    // TODO "Fade out" here
    }
    }
    I'm using a queue to better handle the buffering, also noted where the "fading" transition should be invoked.

    Thank you,
    Ryo

  • zerograssizerograssi Posts: 2
    NerveGear
    edited October 2018
    You guys are fantastic!
    I'm developing an app for a museum and re-calibration is a serious problem. Tomorrow morning I'll try your script.
    Oculus team: Can not create an app that runs in the background and simulates the calibration input when the viewer wakes up?  Or that puts the viewer in a sort of "presentation" mode that "overwrites" the calibration?

    Sorry if I said a trivial and thank again :)
  • zerograssizerograssi Posts: 2
    NerveGear
    unfortunately the script does not work with me. When the viewer wakes up, keep asking to recalibrate the controller :( 
    Some idea??
  • vergil_castelovergil_castelo Posts: 1
    NerveGear
    Although it's taxing on the battery, you can set "Auto-Sleep" to never in the companion phone app"s "Settings" > "More Settings" > "Power Management."  Since the device never sleeps it'll never wake up and never ask to re calibrate the center.
Sign In or Register to comment.