Jump to content


Verified Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Asish

  • Rank
  1. @Daniel_Y, Link does not exist from previous post. Here is a similar question about gaze origin, https://community.viveport.com/t5/Vive-SRanipal-SDK/Vive-Pro-Eye-Finding-a-single-eye-origin-in-world-space/gpm-p/31592#M20.The diagram is updated. The gaze origin is with repect to System Origin. @iuilab, Did you get your answer? If so, Please let me know about gaze_origin_mm interms or left and right eye. If I take average of these two points, then does it mean the position of the object in the scene where user looked at? Thanks
  2. Hello, I solved my issues. Now I'm getting 120hz output frequency. Thanks
  3. Hello @Corvus, Thanks for your clarification. I recorded data by "Enable Eye Data Callback" and version 2. I modified the following code and recorded data. I got around 15k row for 70 seconds but it's supposed to record 8k (70 sec * 120 FPS = 8400 rows) row as output frequency is 120hz. Could you please tell me what's wrong with this? public class SRanipal_GazeRaySample_v2 : MonoBehaviour { public int LengthOfRay = 25; [SerializeField] private LineRenderer GazeRayRenderer; private static EyeData_v2 eyeData = new EyeData_v2(); private bool eye_callback_registered = false; private StringBuilder csv; string strFilePath = @"D:\Unity_workspace\eye_tracking2020\Tutorial4\Assets\Data.csv"; string strSeperator = ","; static StringBuilder sbOutput = new StringBuilder(); private void Start() { sbOutput = new StringBuilder(); if (!SRanipal_Eye_Framework.Instance.EnableEye) { enabled = false; return; } Assert.IsNotNull(GazeRayRenderer); } private void Update() { if (Input.GetKey("up")) { startRecord(); } if (Input.GetKey("down")) { stopRecord(); } } private void Release() { if (eye_callback_registered == true) { SRanipal_Eye_v2.WrapperUnRegisterEyeDataCallback(Marshal.GetFunctionPointerForDelegate((SRanipal_Eye_v2.CallbackBasic)EyeCallback)); eye_callback_registered = false; } } private void stopRecord() { File.WriteAllText(strFilePath, sbOutput.ToString()); File.AppendAllText(strFilePath, sbOutput.ToString()); } private void startRecord() { if (SRanipal_Eye_Framework.Status != SRanipal_Eye_Framework.FrameworkStatus.WORKING && SRanipal_Eye_Framework.Status != SRanipal_Eye_Framework.FrameworkStatus.NOT_SUPPORT) return; if (SRanipal_Eye_Framework.Instance.EnableEyeDataCallback == true && eye_callback_registered == false) { SRanipal_Eye_v2.WrapperRegisterEyeDataCallback(Marshal.GetFunctionPointerForDelegate((SRanipal_Eye_v2.CallbackBasic)EyeCallback)); eye_callback_registered = true; } else if (SRanipal_Eye_Framework.Instance.EnableEyeDataCallback == false && eye_callback_registered == true) { SRanipal_Eye_v2.WrapperUnRegisterEyeDataCallback(Marshal.GetFunctionPointerForDelegate((SRanipal_Eye_v2.CallbackBasic)EyeCallback)); eye_callback_registered = false; } Vector3 GazeOriginCombinedLocal, GazeDirectionCombinedLocal; if (eye_callback_registered) { if (SRanipal_Eye_v2.GetGazeRay(GazeIndex.COMBINE, out GazeOriginCombinedLocal, out GazeDirectionCombinedLocal, eyeData)) { } else if (SRanipal_Eye_v2.GetGazeRay(GazeIndex.LEFT, out GazeOriginCombinedLocal, out GazeDirectionCombinedLocal, eyeData)) { } else if (SRanipal_Eye_v2.GetGazeRay(GazeIndex.RIGHT, out GazeOriginCombinedLocal, out GazeDirectionCombinedLocal, eyeData)) { } else return; } else { if (SRanipal_Eye_v2.GetGazeRay(GazeIndex.COMBINE, out GazeOriginCombinedLocal, out GazeDirectionCombinedLocal)) { } else if (SRanipal_Eye_v2.GetGazeRay(GazeIndex.LEFT, out GazeOriginCombinedLocal, out GazeDirectionCombinedLocal)) { } else if (SRanipal_Eye_v2.GetGazeRay(GazeIndex.RIGHT, out GazeOriginCombinedLocal, out GazeDirectionCombinedLocal)) { } else return; } Vector3 GazeDirectionCombined = Camera.main.transform.TransformDirection(GazeDirectionCombinedLocal); GazeRayRenderer.SetPosition(0, Camera.main.transform.position - Camera.main.transform.up * 0.05f); GazeRayRenderer.SetPosition(1, Camera.main.transform.position + GazeDirectionCombined * LengthOfRay); } private static void EyeCallback(ref EyeData_v2 eye_data) { eyeData = eye_data; var L_dia = eyeData.verbose_data.left.pupil_diameter_mm; var l_openness = eyeData.verbose_data.left.eye_openness; var l_gaze_origin = eyeData.verbose_data.left.gaze_origin_mm; var l_gaze_dir_norm = eyeData.verbose_data.left.gaze_direction_normalized; var l_pupil_pos = eyeData.verbose_data.left.pupil_position_in_sensor_area; var R_dia = eyeData.verbose_data.right.pupil_diameter_mm; var R_openness = eyeData.verbose_data.right.eye_openness; var R_gaze_origin = eyeData.verbose_data.right.gaze_origin_mm; var R_gaze_dir_norm = eyeData.verbose_data.right.gaze_direction_normalized; var R_pupil_pos = eyeData.verbose_data.right.pupil_position_in_sensor_area; var newLine = string.Format("{0},{1},{2},{3},{4},{5},{6},{7}", L_dia, l_openness, l_gaze_origin, l_gaze_dir_norm, l_pupil_pos, R_dia, R_openness, R_gaze_origin, R_gaze_dir_norm, R_pupil_pos); sbOutput.AppendLine(newLine); } }
  4. Hi @Corvus, I'm using callback method. According to @Daniel_Y I enabled v2 and then used sample UI code to show FPS from http://wiki.unity3d.com/index.php?title=FramesPerSecond&_ga=2.258332745.253243703.1593390743-1664584608.1593097261&fbclid=IwAR2zAe7hOiiEzb822jA5lIFOlpDGXqUhf-W2WYlbf00-B4uo-Y1-IhDqYtQ I get 30 to 45 FPS. I checked my monitor frame rate is 60Hz. Please take a look at screenshot and let me know how can I get 120 FPS. Thanks in advance!
  5. Hello @imarin18 The callback function in version 2 does not give me the eye data at 120H. Unity stats shows variable FPS like 90 to 140 FPS. How can I get it exactly 120 FPS? @Daniel_Y
  6. I need to record 60 FPS or 120 FPS eye tracking data, How can I get it using vive pro sdk api? Any suggestions?
  • Create New...