Jump to content

Eye tracking returns only zero values


Recommended Posts

 

I have recently started working with unity, vive and the SR anipal. I followed the steps described in the anipal sdk, but for some reason all eye tracking values (pupil diameter, eye openness, eye position etc) are returned as zero. The runtime version of the SR anipal is 1.13, the eye camera version is 2.41 and unity is 2019.4 . I tested it with both version 1 and 2 of the SR anipal, and I extract the data in the following way:

public ViveSR.anipal.Eye.EyeData eyeData = new ViveSR.anipal.Eye.EyeData();

and within the update function: pupil_diameter = eyeData.verbose_data.left.pupil_diameter_mm; etc..

I have noticed that this topic was discussed here before (https://forum.vive.com/topic/6650-eye-expression-data/?ct=1613317767) and tried the solutions previously presented (enable eye and eye data callback in the SR anipal frame work object/ removing a Tobi sdk from the project ) but the result is the same- I get only zero values...

What am I missing 🙂?   

Any help would be greatly appreciated:)

Neomi

 

 

Link to comment
Share on other sites

Do you mean the sample scene of unity? -yes when I press play , the avatar eyes are moving according to my eyes, and the sranipal icon eyes are green.

This is my code:

using System.Collections; 

using System.Collections.Generic;

 using UnityEngine;

 using ViveSR.anipal.Eye;

public class save_eyes_tracking_v2 : MonoBehaviour

{

    public ViveSR.anipal.Eye.EyeData_v2 eyeData= new ViveSR.anipal.Eye.EyeData_v2();

  public float pupil_diameter;

    void Start()

    {

     }

    void Update()

    {

      pupil_diameter = eyeData.verbose_data.left.pupil_diameter_mm;

  Debug.Log(  pupil_diameter );
    }

}

Thanks! 

Link to comment
Share on other sites

Thanks for your help. I tried the code below but still only zero values are returned. Dose the code below implements your suggestion correctly? 

 

using ViveSR.anipal.Eye;


public class save_eyes_tracking_v2 : MonoBehaviour
{

public  VerboseData verboseData; 

public float pupil_diameter; 

  void Start()
    {  }

void Update()
    {
      SRanipal_Eye.GetVerboseData(out verboseData);
      pupil_diameter = verboseData.left.pupil_diameter_mm;

}

Link to comment
Share on other sites

Yes, that should work if you are using v1 data. If you are using v2 make sure to use 'SRanipal_Eye_v2'.

 

// make sure the framework status is WORKING
SRanipal_Eye_Framework.Status == SRanipal_Eye_Framework.FrameworkStatus.WORKING

// pass the verbose data
SRanipal_Eye.GetVerboseData(out verboseData); // v1
// SRanipal_Eye_v2.GetVerboseData(out verboseData); // v2

// read the necessary data
pupilDiameterLeft = verboseData.left.pupil_diameter_mm;
pupilDiameterRight = verboseData.right.pupil_diameter_mm;

 

Link to comment
Share on other sites

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...