Jump to content

Recommended Posts

Posted

We have a Unity VR environment running on Windows, and a HTC Vive XR Elite connected to PC. The headset also has the Full face tracker connected and tracking.

I need to just log the face tracking data (eye data in specific) from the headset to test.

I have the attached code snippet as a script added on the camera asset, to simply log the eye open/close data.

But I'm getting a "XR_ERROR_SESSION_LOST" when trying to access the data using GetFacialExpressions as shown in the code snippet below. And the log data always prints 0s for both eye and lip tracking data.

What could be the issue here? I'm new to Unity so it could also be the way I'm adding the script to the camera asset.

Using VIVE OpenXR Plugin for Unity (2022.3.44f1), with Facial Tracking feature enabled in the project settings > OpenXR.

spacer.png

Code:

public class FacialTrackingScript : MonoBehaviour
{
    private static float[] eyeExps = new float[(int)XrEyeExpressionHTC.XR_EYE_EXPRESSION_MAX_ENUM_HTC];
    private static float[] lipExps = new float[(int)XrLipExpressionHTC.XR_LIP_EXPRESSION_MAX_ENUM_HTC];

    void Start()
    {
        Debug.Log("Script start running");
    }

    void Update()
    {
        Debug.Log("Script update running");
        var feature = OpenXRSettings.Instance.GetFeature<ViveFacialTracking>();
        if (feature != null)
        {
            {
//XR_ERROR_SESSION_LOST at the line below             

if (feature.GetFacialExpressions(XrFacialTrackingTypeHTC.XR_FACIAL_TRACKING_TYPE_EYE_DEFAULT_HTC, out float[] exps))
                {
                    eyeExps = exps;
                }
            }

            {
                if (feature.GetFacialExpressions(XrFacialTrackingTypeHTC.XR_FACIAL_TRACKING_TYPE_LIP_DEFAULT_HTC, out float[] exps))
                {
                    lipExps = exps;
                }
            }

            // How large is the user's mouth opening. 0 = closed, 1 = fully opened
            Debug.Log("Jaw Open: " + lipExps[(int)XrLipExpressionHTC.XR_LIP_EXPRESSION_JAW_OPEN_HTC]);

            // Is the user's left eye opening? 0 = opened, 1 = fully closed
            Debug.Log("Left Eye Blink: " + eyeExps[(int)XrEyeExpressionHTC.XR_EYE_EXPRESSION_LEFT_BLINK_HTC]);
        }
    }
}

 

Posted (edited)
On 11/10/2024 at 11:33 PM, VIVE_chengnay said:

Hi @Be Epic,

May I know which version of VIVE OpenXR Plugin and VIVE Hub did you install?

VIVE OpenXR Plugin: 2.4.2

VIVE Hub: 2.1.7

 

On 11/11/2024 at 1:36 AM, Tony PH Lin said:

We also replied same question on Discord.

Could you try to register OpenXR layers in VIVE Hub Settings as shown in attachment and try again?

VBS.webp.f9201f49b61fda836816635c999b3adb.webp

Nothing opens up after I clicked on register even though I tried both wearing/connected and shutdown/disconnected headset along with it.

Edited by Be Epic
Posted

Hi I encountered similar issue when trying to get pupil data. 

image.thumb.png.c36f8218596643a88948189d125b7c4d.png

I'm using 2.2 4a beta version of vive hub and 2.4.2 version of vive openxr plugin. I tried register for openxr extension in vive hub, but it seems that in SteamVR settings no openxr API layer is installed.image.png.fc4780609a876997b9f81cd5a3df6d04.png

Do you guys have any idea? Thanks 

Posted
On 11/12/2024 at 6:03 PM, VIVE_chengnay said:

Hi @Be Epic,

After clicking Register button, it won't open up any window.

It will modify OpenXR API Layers in SteamVR Settings.

Only those used by PC Streaming will be enabled.

image.png.f27809046507c2c2d065651dcc63a19d.png

I attached the settings that I see, and I think mine misses a few options that I see on yours. And yeah clicking on register does nothing and those SteamVR remain as shown in the image.

Screenshot 2024-11-19 at 3.18.36 PM.png

Posted
8 hours ago, Be Epic said:

And yeah clicking on register does nothing and those SteamVR remain as shown in the image

@Be EpicThis means that previously you already enabled the API Layer that supported by our Vive Streaming.

This is just to ensure there is no unsupported API Layer enabled.

You can test by enable "ViveVR OpenXR SRWorks" then click Register button again, you will see it will be switch to Off.

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...