Home › Forums › Software Development › how to get the gaze coordinate?
Tagged: gaze coordinate
- This topic has 18 replies, 10 voices, and was last updated 7 years ago by Alex [Tobii].
- AuthorPosts
- 06/05/2015 at 19:48 #2940Na CuiParticipant
Hi,
I want to know how to get the real-time Eye Tracker’s gaze coordinate of X, Y.
I need implement a programming which can read the gaze coordinates.
I have no idea about how to start it.
Please give me some advice.
Thank you very much!
11/05/2015 at 19:35 #2957Dolores JoyaParticipantI was able to successfully get a Gaze coordinate data stream to successfully build with Microsoft Visual Studio Community 2013 after going through these:
These 2 tutorials got me started:
http://developer.tobii.com/walkthrough-setting-cc-project-eyex-c-api/
http://developer.tobii.com/c-sample-walk-minimalgazedatastream/The data steam from the MinimalGazeDataStream Visual Studio project output looks like this:
Gaze Data: (384.5, 161.9) timestamp 605378864 ms
Gaze Data: (385.1, 163.0) timestamp 605378880 ms
Gaze Data: (390.3, 182.0) timestamp 605378895 ms
Gaze Data: (392.9, 188.2) timestamp 605378927 ms
Gaze Data: (402.1, 198.5) timestamp 605378937 ms
Gaze Data: (404.4, 202.6) timestamp 605378954 ms
Gaze Data: (402.4, 186.8) timestamp 605378970 ms
Gaze Data: (402.6, 178.0) timestamp 605378981 ms
Gaze Data: (402.6, 164.8) timestamp 605378998 ms
Gaze Data: (401.6, 159.5) timestamp 605379013 msComing from:
/*
* Handles an event from the Gaze Point data stream.
*/
void OnGazeDataEvent(TX_HANDLE hGazeDataBehavior)
{
TX_GAZEPOINTDATAEVENTPARAMS eventParams;
if (txGetGazePointDataEventParams(hGazeDataBehavior, &eventParams) == TX_RESULT_OK) {
printf(“Gaze Data: (%.1f, %.1f) timestamp %.0f ms\n”, eventParams.X, eventParams.Y, eventParams.Timestamp);
} else {
printf(“Failed to interpret gaze data event packet.\n”);
}
}28/07/2015 at 18:58 #3259Tala Al BaharParticipantHello,
I’m using Visual Studio 2013. I ran the SDK projects for MinimalGazeDataStream and MinimalFixationDataStream but I still can’t see any output on the console including the printout of the coordinates and timestamps.
I’ve calibrated and tested the eye tracker and it works fine. Please let me know if you have any suggestions that could help. Thanks30/07/2015 at 10:18 #3261Patrik [Tobii]ParticipantHello Tala,
Does it say “Listening for gaze data, press any key to exit…” or is the console window blank?
/ Patrik
30/07/2015 at 14:59 #3269Tala Al BaharParticipantHello Patrik,
Actually, I am not even getting the console window at all. I changed the configuration to “Console (/SUBSYSTEM:CONSOLE)” for MinimalGazeDataStream project but I’m still not getting anything. I found out that whenever I run any of the sample projects of the SDK, the ActivatableButtons main function gets called, and I can’t change the configuration there to (/SUBSYSTEM:CONSOLE).
Do you have any idea what I might be missing?
(I tried writing to files from all the main functions and the only file that gets created/edited is from the ActivatableButtons project – and this happens every time I run any of the codes).Thanks!
01/08/2015 at 14:29 #3275Tala Al BaharParticipantSorry, I meant only the “ActivatableBoardGame” main function is being called in all cases
05/08/2015 at 16:06 #3283Patrik [Tobii]ParticipantHello Tala,
You need to right click on the project you want to run and select “Set as StartUp Project”.
When you press F5 (Start debugging) the correct project should run.Best regards
Patrik01/09/2015 at 07:37 #3379AEParticipantHello,
because of you
Data is displayed on the console.I want to write to text file.
I write (fopne) .(fputs) etc in [void OnGazeDataEvent]
But not work and error {(code 1120) Linker error….}No place to write is different ?
Writing ‘s the difference ?
And you wonder why good in trouble tooI am not sorry at rudimentary questions
The answer I wrote in want to be about hints ‘ s not
If there is a reply I’m glad .
Niigata,Japan AE
01/09/2015 at 07:45 #3380AEParticipantPostscript
Use environmentWindows7 TobiiEyeXSdk-Cpp-1.5.466
MinimalGazeDataStream in samplesNiigata,Japan AE
03/09/2015 at 13:23 #3393Jenny [Tobii]ParticipantHi AE,
Seems you have some unresolved externals. Check the link error preceding the 1120 error to see what externals cause the problem. Since the gaze data is displayed in the console it seems it is not a problem with the EyeX dlls.
Found this on MSDN: https://msdn.microsoft.com/en-us/library/z98k84c3.aspx
Please, also read through the EyeX license agreement. You should not store gaze data to file using EyeX.
05/04/2017 at 15:39 #6610AsiehParticipantHi Joya
I downloaded these codes. the game is successfully running. but the code you have mentioned to extract gaze data does not work for me.
could you please help me?06/04/2017 at 03:33 #6614Grant [Tobii]KeymasterHi @sadanas, this thread is somewhat old so I’m not sure @doloresjoya is necessarily checking this, but if you could kindly be more specific in the issue you are facing, perhaps someone else from the community can help you out.. thanks!
15/08/2017 at 20:58 #7281InesParticipantHello! I am new with Eye tracking and I am doing project for college and decided to make a game in Unity(version of a flappy bird) and use EyeX in the simplest possible way and that is to find out the coordinates of my game object and find out the coordinates where my eyes have looked while playing that game ,and basically to compare those two.
I have found the script in Assets/Tobii/DemoScenes/Scripts/Example01 -> PrintGazePosition. Maybe it is a silly question but I’m having trouble with that script, I added it to my player(main gameobject) and I don’t know where it is supposed to print those coordinates and should I add something to that script because it constantly reports error: Object reference not set to an instance of an object.
(Maybe you have other suggestion for my problem )P.S. Unity 5.5 3D project , but it is made as a 2D game 😉
Please,help I’m running out of time! 🙂
Greetings!16/08/2017 at 00:37 #7284Alex [Tobii]ParticipantHi!
Do the demo scenes work fine for you? Does it print the coordinates in demo scene1?
16/08/2017 at 17:18 #7294InesParticipantNo, it doesn’t 🙁 Maybe I am doing something wrong..
Is it possible to print the coordinates no matter what framework is it,I mean some tool just to see the coordinates where the eyes have looked on the screen? (Maybe in notepad or something like that)
- AuthorPosts
- You must be logged in to reply to this topic.