Jump to content

Recommended Posts

Posted

Hi, there seems to be a bug in the `GetGazeRay` function of the SRanipal Unity package (specifically, the function at line 265 in SRanipal_Eye.cs).

origin = eyesData[(int)gazeIndex].gaze_origin_mm * 0.001f;
direction = eyesData[(int)gazeIndex].gaze_direction_normalized;
origin.x *= -1; // Adding this line fixes the bug
direction.x *= -1;

This issue has been mentioned in this post as well.

Here is a demo script to illustrate the bug: GazeRays.cs

This will render a blue ray from the left eye and a red ray from the right eye. Without the fix, the rays will appear swapped like so:

no_fix.thumb.png.90bd8710f952e7021aedeef95394fbcf.png

With the fix, the rays will appear in the correct eye like so:

fix.thumb.png.700d24a73724f9b0886194665c113a16.png

If someone could confirm whether this bug is valid, I would appreciate it. Thanks!

Posted

Sorry to bump the topic, but if someone could evaluate the bug and see if the fix I mentioned resolves it, that's be great. Thanks!

  • 2 weeks later...
Posted

The same bug applies to the combined gazeray. When I move my gaze to the left the ray goes to the right and vice versa. Up/down is fine.

If gaze_orgin_C is the measured combined origin and gaze_direct_C the measured combined direction you need to do the below calculation to use it:

fixed_gaze_origin_C = new Vector3(gaze_origin_C.x*-1f, gaze_origin_C.y, gaze_origin_C.z)/1000f,
fixed_gaze_direction_C = new Vector3(gaze_direct_C.x*-1f, gaze_direct_C.y, gaze_direct_C.z),

Note the division by 1000, as I'm using version 2 of the eyetracking API and there the measured values are in mm and Unity units are meters.

  • 1 month later...
  • 4 months later...
Posted

Hi qxxb, 

First of all- thank you for sharing the fix to the bug and  your code (https://gist.github.com/qxxxb/d1357828c16d27873751280d7222ea25)- It helped me a lot in visualizing the gaze.

I have one question:  in your code you set the endpoint of the LineRender in the following way (line 133 ):

llr.SetPosition(1, gr.leftOrigin + gr.leftDir * 20);

My question is-why do you multiple the resulting eye direction by 20? 

When I convert gaze origin and direction to world coordinates as in your code -I receive world coordinates values which their direction seems a bit off to me. Am I missing a multipcation of the resulting direction? why is this multiplication needed?  What specify the multipcation value (why 20)?

Thank you so much in advance!
Neomi

 

 

 

 

 

  • 8 months later...
Posted

@Hank_Li @Corvus  Hi Hank, you mentioned above that the bug will be fixed in the next sdk version. I downloaded the 1_3_3 sdk and I want to be sure that the bug in the GetGazeray function was fixed. Was it fixed? Is it still necessary to multiple x values in minus 1? 

Waiting for your answer, Thanks! 

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