Jump to content

eye sample and frames


Recommended Posts

I am trying to poll eyeData in a thread, and I am recording eyeData.timestamp and eyeData.frame_sequence.

- It seems that the timestamps are not received consecutively (there is a 7 or 8 difference between two timestamps).

- Also, the frameCounts have missing frames too. For example in the samples below, the frame number 3506, 3511, 3518 and etc are missing:

Frame #, eyeData.timestamp, eyeData.frame_sequence

0 599227 3500  
1 599235 3501  
2 599243 3502  
3 599251 3503  
4 599260 3504  
5 599268 3505  
6 599285 3507  
7 599293 3508  
8 599301 3509  
9 599310 3510  
10 599326 3512  
11 599335 3513  
12 599343 3514  
13 599351 3515  
14 599360 3516  
15 599368 3517  
16 599385 3519  
17 599393 3520  
18 599401 3521  
19 599410 3522  
20 599418 3523  
21 599435 3525  
22 599443 3526  
23 599451 3527  
24 599460 3528  
25 599468 3529  
26 599476 3530  
27 599493 3532  
28 599501 3533  
29 599510 3534  
30 599518 3535  
31 599535 3537  
32 599535 3537  
33 599551 3539  
34 599560 3540  
35 599568 3541  
36 599576 3542  
37 599593 3544  
38 599601 3545  
39 599610 3546  
40 599618 3547   

 

Edited by mrk88
Link to comment
Share on other sites

and this is the code I collect the data with:

 

   void QueryEyeData()
    {
        while (Abort == false)
        {
            SRanipal_Eye_API.GetEyeData(ref eyeData);
            ViveSR.Error error = SRanipal_Eye_API.GetEyeData(ref EyeData);
            if (error == ViveSR.Error.WORK)
            { 
                logResults(frameCount);
                logResults(eyeData.timestamp);
                logResults(eyeData.frame_sequence);
      		   frameCount++;
                logFile.WriteLine(" ");
                  if (frameCount % 120 == 0)
                      frameCount = 0;
            }
            Thread.Sleep(FrequencyControl);
        }
    }

 

Edited by mrk88
Link to comment
Share on other sites

Also, when collecting gaze data (Such as below), should we collect them in a thread (same as above)? or in the Unity's Update function?

 

				gazeOriginLeft = eyeData.verbose_data.left.gaze_origin_mm; //gaze origin 
                            gazeOriginRight = eyeData.verbose_data.right.gaze_origin_mm;
                            gazeDirectionLeft = eyeData.verbose_data.left.gaze_direction_normalized; //gaze direction
                            gazeDirectionRight = eyeData.verbose_data.right.gaze_direction_normalized;
                            pupilDiameterLeft = eyeData.verbose_data.left.pupil_diameter_mm; //pupil size
                            pupilDiameterRight = eyeData.verbose_data.right.pupil_diameter_mm;
                            pupilPositionLeft = eyeData.verbose_data.left.pupil_position_in_sensor_area;// pupil positions
                            pupilPositionRight = eyeData.verbose_data.right.pupil_position_in_sensor_area;
                            eyeOpenLeft = eyeData.verbose_data.left.eye_openness; // eye openness
                            eyeOpenRight = eyeData.verbose_data.right.eye_openness;

 

Link to comment
Share on other sites

10 minutes ago, alwyuyang said:

Could you upload the script how do you create the thread , read and write the eye data?  

ViveProEyeProducerThread.cs

 

Thanks. I attach this script to a GameObject in my scene. 

I am not able to collect any verbose data while using a thread. The verbose data I can only collect in Update function. and that is where I'm confused. If we can only collect verbose data in Update(), then we will be collecting them with 90Hz frequency not 120.

Link to comment
Share on other sites

15 hours ago, mrk88 said:

ViveProEyeProducerThread.cs 2.09 kB · 1 download

 

Thanks. I attach this script to a GameObject in my scene. 

I am not able to collect any verbose data while using a thread. The verbose data I can only collect in Update function. and that is where I'm confused. If we can only collect verbose data in Update(), then we will be collecting them with 90Hz frequency not 120.

Thanks for sharing the script which is the same to mine. Actually I have the same problem. I think we are looking for an equivalent "Update() function of Vive Eye" which can run automatically in 120 Hz, right? This is the problem we have no idea. 

 

 

@Daniel_Y @zzy @Corvus

Link to comment
Share on other sites

  • 3 months later...

I am currently having the same issue. Verbose data seems to be only collectable in the main thread and therefore in the update function. And that's not the stated 120Hz... hoping to find a solution for this though

Link to comment
Share on other sites

  • 2 weeks later...
On 5/15/2020 at 9:27 PM, fayre said:

I am currently having the same issue. Verbose data seems to be only collectable in the main thread and therefore in the update function. And that's not the stated 120Hz... hoping to find a solution for this though

Have you tried callback mode, referring to this thread How to get output from the eye-tracker faster than Update in Unity 

 

@fayre

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