qxxxb Posted December 29, 2020 Posted December 29, 2020 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: With the fix, the rays will appear in the correct eye like so: If someone could confirm whether this bug is valid, I would appreciate it. Thanks!
qxxxb Posted January 4, 2021 Author Posted January 4, 2021 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!
jboss Posted January 13, 2021 Posted January 13, 2021 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.
Corvus Posted January 15, 2021 Posted January 15, 2021 @qxxxb @jboss Thanks for reporting this bug. The team will look into it.
Hank_Li Posted March 2, 2021 Posted March 2, 2021 Hi @qxxxb: We will fix it in the next version. Thank you.
neomimiz Posted July 13, 2021 Posted July 13, 2021 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
tchiyab Posted March 24, 2022 Posted March 24, 2022 @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!
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