HolographicSettings SetFocusPointForFrame seems to make things worse [HOLOLENS]

Hey all,

I’m having issues with hologram stability.

I’ve got an empty unity scene with a plane world anchored 2 metres from the camera.

When SetFocusPointForFrame is not set, the plane is stable from a distance and fairly stable at arm’s length.

When SetFocusPointForFrame is set, the plane oscillates at arm’s length (1m - 50cm range) and at a distance.

The code is below. Please let me know if I am missing something, but it appears that setting a focus point makes things worse, not better.

Unity version: 2017.3.0p3
Windows SDK: 10.0.16299.0

Many thanks,

Harrison

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HoloToolkit.Unity.InputModule;
using HoloToolkit.Unity;
using HoloToolkit.Unity.SpatialMapping;
using HoloLensXboxController;
using UnityEngine.XR.WSA.Input;
using UnityEngine.XR.WSA;
using UnityEngine.UI;

public class StabilisingTest : MonoBehaviour
{

    // Use this for initialization

    public GameObject plane;

    GestureRecognizer gr;
    GazeStabilizer gs;
    Transform CamTran;
    public Text Label;

    bool focusPointSet = false;

    void Start()
    {

        CamTran = Camera.main.transform;

        gs = new GazeStabilizer();

        gr = new GestureRecognizer();
        gr.SetRecognizableGestures(GestureSettings.Tap);
        gr.StartCapturingGestures();
        gr.Tapped += Gr_Tapped;

        plane.transform.position = CamTran.position + (CamTran.forward * 2f);
        WorldAnchorManager.Instance.AttachAnchor(plane);
        SpatialMappingManager.Instance.DrawVisualMeshes = false;
        SpatialMappingManager.Instance.StopObserver();

    }

    //https://docs.unity3d.com/550/Documentation/ScriptReference/VR.WSA.HolographicSettings.SetFocusPointForFrame.html
    void Update()
    {
        TappedEventArgs x = new TappedEventArgs();

        if (Input.GetKeyDown(KeyCode.T))
            Gr_Tapped(x);
     

        var normal = -Camera.main.transform.forward;     // Normally the normal is best set to be the opposite of the main camera's forward vector
                                                         // If the content is actually all on a plane (like text), set the normal to the normal of the plane
                                                         // and ensure the user does not pass through the plane
        var position = plane.transform.position;

        if(focusPointSet)
        {
            HolographicSettings.SetFocusPointForFrame(position, normal);
        }
    
     
    }

    private void Gr_Tapped(TappedEventArgs obj)
    {
        if (!focusPointSet)
        {
            Label.text = "Focus point set!";
            focusPointSet = true;
         
        }
        else
        {

            Label.text = "Focus point not set!";
            focusPointSet = false;

        }






    }
}

There is a bug currently with the focus frame which sounds similar to what you are seeing, can you send a screen shot?

Sorry, should have replied sooner. Have confirmed this is the same bug. Been told a fix is in the pipeline. Cheers!

Hi,
I’m having the same issue with hologram stability plane (using Unity 2017.3.0f3).
What version of Unity should I use which is not affected by this issue?

2017.2.0f3 should work for you, although it has some other bugs that could affect your project.