[Solved] Project building with several errors when using EyeXFramework

Home Forums Software Development [Solved] Project building with several errors when using EyeXFramework

Viewing 15 posts - 1 through 15 (of 30 total)
  • Author
    Posts
  • #1648
    Siddarth
    Participant

    Hello,

    I’m trying to use the MinimalGazeDataStream as a base to find eye positions and print them to the console over a period of time. Sounds quite simple. However, I have been struggling to build a project without facing hundreds of errors regarding imported dlls and projects. I followed the instructions of the Developer’s guide and added EyeXFramework to my project as well as the two required dlls. However, the most common errors say ‘Could not locate the assembly Tobii.EyeX.Client.Net20’ and ‘the type or namespace Tobii could not be found’ and several Tobii related words are red-underlined in my C# code on Visual Studio Express 2013. I don’t think the project has recognized EyeXFramework or the dlls for some reason. Does anyone have any guidance on how to move forward? Any help will be appreciated. Thank you!

    #1689
    Anders
    Participant

    Hi Siddarth,
    here is how I did it:
    1. create a brand new console c# project with a new solution.
    2. right-click the References node in the project and choose Add references. Browse to the SDK/source/EyeXFramework/bin/x86/Debug directory and select both the EyeXFramework dll and the Tobii.EyeX.Client.Net20 dll. (This of course assumes that you built the EyeX Framework before.)
    3. copy the code from the Main method in SDK/source/MinimalSamples/MinimalGazeDataStream/Program class into the Program class of the new project.
    4. place the cursor on the two types that cannot be resolve and press Ctrl-. to add the necessary using statements. At this point the code compiles, but you get a DllNotFoundException if you try to run it.
    5. the default platform for c# is Any CPU, but we need to change that to either x86 or x64, because otherwise we won’t know which bitness of the Tobii.EyeX.Client dll to load until runtime. Since we already chose the x86 assemblies in step 2, let’s stick to x86. Open the Build/Configuration manager dialog and add a solution platform for x86. (Re)build the app for the new platform.
    6. copy the Tobii.EyeX.Client dll from Sdk/lib/x86 into the output folder of your new project. Note that the output folder will now be bin/x86/Debug by default. Now the app should run and spit out a trail of gaze data!

    I hope this helps.

    #1706
    Siddarth
    Participant

    Hello Anders,

    Thanks so much for your help. I have followed your steps and have had difficulty in just Step 4. I am working on a tablet and the shortcuts for Smart Tags don’t seem to be working. I have done extensive research on the subject on Google to no avail. Can you please tell me which “using” statements are needed so that I can manually type them myself or if there is another way to accomplish this?

    Regards,
    Siddarth

    #1713
    Robert [Tobii]
    Participant

    Hi Siddarth,
    With these include statements you should be on the safe side:

    
        using EyeXFramework;
        using Tobii.EyeX.Client;
        using Tobii.EyeX.Framework;
    #1714
    Siddarth
    Participant

    Yes, those are the ones I tried, but the keywords are still red-underlined. Here is my code below. The keywords void, [], args, EyeXHost and GazePointDataStream are unresolved. If I remove the Main method statement to run it as a script (not even sure if that’s possible because I’ve never used C# before), EyeXHost and GazePointDataStream are still not resolved. Any ideas?

    using EyeXFramework;
    using System;
    using Tobii.EyeX.Client;
    using Tobii.EyeX.Framework;
    using System.Text;

    public static void Main(string[] args)
    {
    using (var eyeXHost = new EyeXHost())
    {
    eyeXHost.Start();

    // Create a data stream: lightly filtered gaze point data.

    using (var lightlyFilteredGazeDataStream = eyeXHost.CreateDataStream(new GazePointDataStream(GazePointDataMode.LightlyFiltered))

    // using (var stream = eyeXHost.CreateDataStream(new EyePositionDataStream(EyePositionDataMode.LightlyFiltered))

    {
    // Write the data to the console.

    lightlyFilteredGazeDataStream.Next += (s, e) => Console.WriteLine(“Gaze point at ({0:0.0}, {1:0.0}) @{2:0}”, e.X, e.Y, e.Timestamp);

    // stream.Next += (s,e) => Console.WriteLine(“Eye position at

    // Let it run until a key is pressed.

    Console.WriteLine(“Listening for gaze data, press any key to exit…”);
    Console.In.Read();
    }
    }
    }

    #1715
    Robert [Tobii]
    Participant

    In C# you need to put your main method inside a class. Try to add these lines before your Main

        public static class Program
        {
    #1716
    Siddarth
    Participant

    Thanks for that, it solved the problem of errors! However when I run the program, the console immediately displays “Listening for gaze data, press any key to exit” without printing any gaze data before that. Also, it doesn’t end the program when a key is pressed but continues to run, not outputting anything to the console. Do I need to edit the code somehow?

    #1718
    Anders
    Participant

    Hi Siddarth,
    it’s not an error that the console displays “Listening for gaze data” immediately, that’s how it is supposed to work. The main thread hangs on the next statement which is Console.In.Read() while the EyeX worker threads keep running and deliver gaze data events. But if you don’t receive any such events then something must be wrong.

    Do the samples work for you if you run them unmodified?
    Does the tracker light up when you run a sample?
    Does the EyeX icon show in the notification area (“system tray”)? And, if you open the settings panel, is tracking enabled?

    #1719
    Siddarth
    Participant

    I’m not sure what exactly you mean by sample. The tracker lights up when I connect it to the tablet, the EyeX icon shows in the System Tray, and tracking is turned on in the settings. What do you mean by running a sample (modified or unmodified)? I simply would like the tracker to register the gaze\eye position co-ordinates of my eyes and print them to the console real time.

    #1726
    Siddarth
    Participant

    Oh you mean the sample code! I haven’t modified them and am running exactly what was provided. The tracker is lit up too.

    #1740
    Anders
    Participant

    Hi Siddarth,
    it’s good to know that the tracker is lit up. That means that we can rule out several potential problem sources.

    If you launch the settings panel and check your calibration, is there a swarm of dots following your eye-gaze?

    And what about the eye indicator, the little black box at the bottom of the screen — does it follow your eyes, or does it display two crossed-out eyes?

    #1742
    Siddarth
    Participant

    Yes, the dots follow my eyes and are quite accurate too. And the eye indicator shows dots, not crosses. I think the tracker is working fine.

    #1745
    Siddarth
    Participant

    Hello!

    I managed to fix the issue – all I needed to do was download the new driver Tobii EyeX 0.10.0. Thanks so much for all your help!

    #1749
    Siddarth
    Participant

    Hey @anderstobii just one more thing. How can I edit this code to get the X, Y and Z coordinates of eye position instead of gaze point?

    #1751
    Anders
    Participant

    Hi Siddarth,
    it’s great to hear that you solved your problem!

    You can switch to using the eye positions data stream instead of the gaze data stream. That is, instead of eyeXHost.CreateGazePointDataStream, use eyeXHost.CreateEyePositionDataStream.

Viewing 15 posts - 1 through 15 (of 30 total)
  • You must be logged in to reply to this topic.