Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing "gaze" Data #51

Closed
BerndtSam opened this issue Jul 23, 2018 · 1 comment
Closed

Accessing "gaze" Data #51

BerndtSam opened this issue Jul 23, 2018 · 1 comment

Comments

@BerndtSam
Copy link

I'm having trouble accessing the "gaze" data on my own unity application using the Pupil Labs Unity plugin.

For calibration I am using the pupil manager prefab with an added "WorldCamera" that starts as activated, is deactivated on calibration start up, then reactivated again after calibration is successful.

After the calibration procedure, I deactivate the calibration camera and activate the "WorldCamera." After doing such, I set the following lines of code:

PupilSettings.Instance.currentCamera = Camera.main; // I confirmed this is the camera I want it to be
PupilTools.IsGazing = true;
PupilTools.SubscribeTo("gaze");

After reading the documentation I expected the code in the function InitializeSubscriptionSocket of connection.cs to be called every time the hardware detects a gaze:

subscriptionSocketForTopic[topic].ReceiveReady += (s, a) => 
{
int i = 0;
NetMQMessage m = new NetMQMessage();
while(a.Socket.TryReceiveMultipartMessage(ref m)) {
...
switch(msgType) {
...
case "gaze":
case "pupil.0":
case "pupil.1":
	var dictionary = MessagePackSerializer.Deserialize<Dictionary<string,object>> (mStream);
...
        if (confidence > 0.6f && msgType == "gaze")
                                PupilTools.gazeDictionary = dictionary;
...

Such that when I call PupilData._2D.GazePosition or PupilData._3D.GazePosition I would receive meaningful data.

However, after the calibration function ends the subscriptionsocket is never called. I suspect this isn't just for the gaze subscription either.

My suspicion is that something got deactivated which makes the subsciptions void. However, I have yet to prove this.

Any suggestions?

@cboulay
Copy link

cboulay commented Aug 17, 2018

The following commit changed the pupil message topic from "gaze" to "gaze.2d.0" (or .1): pupil-labs/pupil@5b5a5c3

This was then changed again from .0/.1 etc to .0./.1. etc here: pupil-labs/pupil@9916335

Even since the first change in Dec 2017, hmd-eyes has not caught up and it still looks for the "gaze" topic here: https://github.com/pupil-labs/hmd-eyes/blob/master/unity_pupil_plugin_vr/Assets/pupil_plugin/Scripts/Networking/Connection.cs#L165

We've modified that code to also look for the new topics, and now we are catching events. Edit: Tracking was fine after we played with it some more (i.e. user error).

We will prepare a pull request with our small changes but it's possible that we missed something else that has changed in either the message format or the content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants