question

PadmashriSuresh-0666 avatar image
0 Votes"
PadmashriSuresh-0666 asked RobCaplan commented

UWP application is not able to set IsSupportedDevice for Hololens2

Sample reference : https://github.com/MicrosoftDocs/windows-topic-specific-samples/archive/uwp-gazeinput-basic.zip
Issue seen IsSupportedDevice is not getting set

/// Check if eye-tracking device is viable.

/// <param name="gazeDevice">Reference to eye-tracking device.</param>
/// <returns>True, if device is viable; otherwise, false.</returns>
private bool IsSupportedDevice(GazeDevicePreview gazeDevice)
{
TrackerState.Text = gazeDevice.ConfigurationState.ToString();
return (gazeDevice.CanTrackEyes &&
gazeDevice.ConfigurationState ==
GazeDeviceConfigurationStatePreview.Ready);
}

Ensured that gazeinput is enabled in the manifest file. Still the issue persist in the UWP application. please suggest what needs to be done.

windows-uwphololens-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RobCaplan avatar image
1 Vote"
RobCaplan answered RobCaplan commented

That is correct behavior. Mixed Reality Gaze (supported by HoloLens) and UWP Gaze Input (supported by GazeDevicePreview) are not directly related.

The GazeDevicePreview classes manage external eye trackers such as several by Tobii. See Eye control supports the following eye tracking devices.

The Note in Gaze interactions and eye tracking in Windows apps calls this out and points you to the Mixed Reality docs.

For gaze input in Windows Mixed Reality, see Gaze.

There are several types of Gaze tracking for Mixed Reality as some devices support eye tracking and some support head tracking. For HoloLens 2 Eye tracking see https://docs.microsoft.com/en-us/windows/mixed-reality/design/eye-tracking


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks. I have one more clarification, you have mentioned that in UWP it is gazedevicePreview, is Gaze device preview only for external eye tracking device and and the same cannot be used for UWP application running in Hololens 2.
Since our existing application running on Hololens is in UWP can you pl. let us know what approach should be followed to enable eye gaze operation.

0 Votes 0 ·

Also since GazeInput is not working used Eyepose. Is it ok to use EyePose for performing the eye tracking.
private async void GazeInput_IsDeviceAvailableChanged(object sender, object e)
{
var EyeStatus = EyesPose.RequestAccessAsync();

DeviceAvailable.Text = EyesPose.IsSupported()? "Eye Pose Supported" : "Eye Pose not Supported"; // this works but subsequent API’s are not working
//DeviceAvailable.Text = GazeInput.IsDeviceAvailable ? "Eye tracker device available" : "No eye tracker device available";
}

Since gazeInput is not working all the associated functionality related to dwell time, drawing boundaries for bounding box etc is not getting invoked for eg. GazeInputSourcePreview_GazeMoved and also the API’s to draw bounding box etc is not working.

We would like to clarify the following
a. For UWP application in hololens what is the API we need to use to perform eye gaze.
b. once the eye gaze is detected how we can how an bounding box to the user to visually know the area he is focusing.
c. how to involve operations on the gaze.

Any reference or samples on this will be very helpful.

0 Votes 0 ·
RobCaplan avatar image RobCaplan PadmashriSuresh-0666 ·

Assuming that you want to use the HoloLens' build-in eye tracking and not an external sensor, you'll need to use the HoloLens Gaze API and not the GazeInput API you are currently using. Since they have different use cases and goals they work differently.

For best practices on using gaze in your HoloLens app see https://docs.microsoft.com/en-us/windows/mixed-reality/design/eye-tracking

How you achieve specific high level effects will depend on what the app does and how it is written.

For Unity and Unreal apps you will find high level controls in the MRTK - see https://docs.microsoft.com/en-us/windows/mixed-reality/mrtk-unity/features/input/eye-tracking/eye-tracking-main?view=mrtkunity-2021-05

For DirectX apps, you'll need to build the high level interactions yourself based on the low level EyesPose information. See https://docs.microsoft.com/en-us/windows/mixed-reality/develop/native/gaze-in-directx#using-eye-gaze

For flat apps, the OS will convert Gaze to standard mouse input for you. You can get the low level EyesPose information, but there isn't a good way to map that into your window's coordinates.

Without knowing specifically what you are trying to achieve I can't provide more specific advice. You may be better off opening a support case where you can have a 1:1 conversation with a HoloLens development specialist about handling your specific scenario. To do so, go to https://aka.ms/hlsupport and choose Mixed Reality/HoloLens Devices/HoloLens App Development (HoloLens 2)/API/Gaze (Eye) (the first two levels will be pre-populated)





0 Votes 0 ·