Why center eye rotation value never changes when performing snap turn using mockHMD

Hi everyone!

I am a newbie to Unity VR. Just created a XR project with XR Interaction Manager and XR Device Simulator enabled. I am able to use XR Rig Simulator Keyboard Shortcuts to control the game, make snap turn (Turn Amount was set to default 45) etc.

I have created a GameObject called InputTrackerChecker looks like following:

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;


public class InputTrackerChecker : MonoBehaviour
{
    private InputDevice targetDevice;
    private void Start()
    {
        var centerEyeDevices = new List<UnityEngine.XR.InputDevice>();
        UnityEngine.XR.InputDevices.GetDevicesAtXRNode(UnityEngine.XR.XRNode.CenterEye, centerEyeDevices);

        if (centerEyeDevices.Count == 1)
        {
            targetDevice = centerEyeDevices[0];
            Debug.Log(string.Format("Device name '{0}' with role '{1}'", targetDevice.name, targetDevice.role.ToString()));
        }
        else if (centerEyeDevices.Count > 1)
        {
            Debug.Log("Found more than one left hand!");
        }
    }

    private void Update()
    {
        targetDevice.TryGetFeatureValue(CommonUsages.centerEyeRotation, out Quaternion centerEyeRotationValue);
        Debug.Log("center eye rotation: " + centerEyeRotationValue);
    }
}

Although when play the scene and make snap turn using A, D keyboard shortcuts, the center eye rotation value is always: (0.00000, 0.00000, 1.00000)

I could not figure out why the value never changes, could someone give me a hint? Thanks!

What version of the input system package are you using? This should be working in 1.4.1+ if you can update to that version.

In previous versions the MockHMD and XR Device Simulator would compete to set these values so they wouldn’t be updated and instead set to the original value by the MockHMD.

Thanks for your reply. I didn’t use Input System in my VR project or TBH i wasn’t aware of using it yet. The current project has following packages in screenshot.

I followed VR locomotion tutorial and thought when making snap turn using A, D keyboard shortcuts provided by VR locomotion, it would respond to the center eye rotation value as if you are moving your head around?

Am I missing something here to get the actual data?

8420940--1114092--Screenshot 2022-09-07 at 10.50.28.png

I have now installed Input System Package 1.4.2, although the result stays the same. From what I can see, the Tracked Pose Driver (Input System) was set on Main Camera inside XR Origin, Both of Position and Rotation Input has Input Action specified as centerEyePosition[XR HMD]

I finally managed to get the rotation data. My first post was not the accurate way to capture the rotation data. Since in my VR project, there isn’t a character yet, when using A, D keyboard shortcuts provided by VR locomotion to make a snap turn, only the camera angle changes. Hence the accurate way to capture rotation data is actually fairly straightforward:

public class InputTrackerChecker : MonoBehaviour
{
    private Transform vcCamera;
    private Vector3 vrRot;
    private void Start()
    {
        vcCamera = Camera.main.transform;
    }

    private void Update()
    {
        vrRot = vcCamera.rotation.eulerAngles;
        Debug.Log("The rotation angle is: " + vrRot);
    }
}