neomimiz Posted February 17, 2021 Share Posted February 17, 2021 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 More sharing options...
Corvus Posted February 17, 2021 Share Posted February 17, 2021 @neomimiz Can you share the full code snippet? Is the demo application working properly for you? Link to comment Share on other sites More sharing options...
neomimiz Posted February 18, 2021 Author Share Posted February 18, 2021 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 More sharing options...
Corvus Posted February 18, 2021 Share Posted February 18, 2021 You need to update the eyeData with GetVerboseData(). Please check the sample code. Also can be helpful to check the framework status is working before updating the data. SRanipal_Eye.GetVerboseData(out verboseData); Link to comment Share on other sites More sharing options...
neomimiz Posted February 22, 2021 Author Share Posted February 22, 2021 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 More sharing options...
Corvus Posted February 23, 2021 Share Posted February 23, 2021 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 More sharing options...
neomimiz Posted February 23, 2021 Author Share Posted February 23, 2021 You are right I didn't update verbosedata with v2 ( SRanipal_Eye_v2.GetVerboseData(out verboseData); // v2) I get non zero values now. Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now