Eye Tracking Unity API

I'm using the Unity eye-tracking API to collect data. It is said that left/right pupil size could be returned by

eyesActions.Data.ReadValue<UnityEngine.InputSystem.XR.Eyes>().leftEyeOpenAmount

which is a float value between 0 and 1. May I ask what this value stands for exactly? Is it a proportion out of some kind of full-size, or is it a absolute value, that would be very different if measured on different individuals?

Thanks in advance!

Thank you for reporting this issue. The documentation is incorrect with eye open amount is measuring the eyelid separation. The value of 1 representing the most open. That said, we are working on integrating eye pupil size in future releases.

Do you mind sharing more information about your application and implementation so we can provide details to our voice of customer team?

Thanks for your reply! Right now we are collecting eye-tracking data only for research purpose. You are saying that, this OpenAmount variable is specifying the proportion of eye open? So that it's insensitive to people with different eye sizes?

I'm also wondering what and how can we alter the sampling rate of eye-tracking. The examples provided seem to be using Unity Update(), so are we supposed to change the Fixed TimeStep setting of Unity to make it, let's say, 90Hz?

Thanks in advance!

Yes, you are correct currently we only track the portion of the eye open. A value of 0 would indicate that they eye is closed. Regarding the sampling rate, We currently provide eye tracking information at 60hz which is the same as the target frame rate of Unity Applications.

So you are saying that this OpenAmount isn't really related with the pupil size? I'm confused about how this could be, since you already had such feature in Magic Leap 1. If not, when is this feature planned to be released?

On the other hand, is there a way to access the claimed 90Hz data? This is what I found, in Eye Tracking | MagicLeap Developer Documentation.

Eye tracking on Magic Leap 2 lets developers design natural and intuitive input and interaction scenarios. The Eye Tracking API provides information about what the user is looking at as a single eye-gaze ray (gaze origin and direction) at approximately 90 FPS (90 Hz). For eye tracking to work accurately, each user is required to go through an eye tracking user calibration.

If not, 60Hz data might also work in my case, but I'm still not sure if accessing data in the Update() method indicates that the sample interval will not be a constant. The app I'm developing needs to use the ML Camera to capture an image every 1.5 second, which seems to be causing delays in the app. I tried to put it in a background thread but the problem remains. I do want the data to be sampled at a constant interval. Please advise.

Thanks!

You are correct, the eye open amount is not related to the pupil size. Unfortunately we are not able to share a timeline for this feature at this time. But I will forward your request to our voice of customer team.

Regarding the Update interval. You can obtain the data in fixed update, however you may need to change the Update setting inside the Unity Input System Settings. Input settings | Input System | 1.1.1

Thanks for your reply. In that case, may I ask whether MLEyes.LeftEye.PupilSize on Magic Leap 1 is referring to the pupil size? I was looking at this webpage but seems that there's no detailed description. I can find some relevant output when I search for "pupil" (see figure below), but it clearly links to the wrong place.


Would you recommend switching to ML1 for pupil size readings?

Thanks!

I would not recommend switching to ML1 since the device is about to reach it's end of life date. I'm not familiar with the Magic Leap 1 but it looks like it was able to read the pupil diameter.

Hi,

I would like to know if there is any progress on the feature to read the pupil size? As far as I understand, this information was part of the Magic Leap One API. However, I have just discovered the following entry in the permissions in Unity: com.magicleap.permission.PUPIL_SIZE. What does this permission allow me to do?

Thanks for further information.

Hi @julien.villiger,

The pupil size is not available at the current moment. However, be on the lookout for future updates as this is something that we are currently working on.

Best,

El

Hi, I noticed that in the Release blog, the zero iteration lab support pupil diameters and IPD. Is that something similar to App simulation? Also, currently, we still can't directly access these data in unity with MLSDK right?

Hi @yanghouze,

Could you point me to the specific release blog that you are referring to?

Yes, this data is not accessible at the moment, but we are working on bringing access to this data in the future.

Best,

El

Hi,

This link in section Miscellaneous

Yes, this is referring to the zero iteration module that let's you test your program before building it to the ML2. The eye pupil size will not be able to be accessed from here just yet, though.