Home Forums Software Development Delay in GazeAwareComponent

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4872
    Bob
    Participant

    Hi!
    I’m testing out the GazeAwareComponent in unity with my tobii eyeX, but I was running into the issue that blinking would result in HasGaze returning false. The documentation says there is a built-in delay parametre, and checking GazeAwareComponent showed delayInMilliseconds. But no matter what I set it to, it didn’t seem to make any difference.

    I’ve pasted the code I was using, it is mostly just the default test code that came in the tobii unity development pdf combined with simple webcam code to display webcam input on a texture.
    Could someone tell me what I’m doing wrong here?

    
    public class Camera : MonoBehaviour {
    
    	private GazeAwareComponent _gazeAware;
    	private WebCamTexture webcamTexture;
    	private Renderer renderer;
    
    	// Use this for initialization
    	void Start () {
    		_gazeAware = GetComponent<GazeAwareComponent>();
    		webcamTexture = new WebCamTexture();
    		renderer = GetComponent<Renderer>();
    		_gazeAware.delayInMilliseconds = 10000;
    
    	}
    	
    	// Update is called once per frame
    	void Update () {
    		if (_gazeAware.HasGaze) {
    			if (!webcamTexture.isPlaying)
    				renderer.material.mainTexture = webcamTexture;
    				webcamTexture.Play ();
    		}
    		else {
    			if (webcamTexture.isPlaying)
    				webcamTexture.Stop ();							
    			}
    		}
    	}
    }
    
    #4891
    Bob
    Participant

    Just an update, I finally noticed “Delay in Milliseconds” in the inspector for GazeAware, but changing that doesn’t seem to help (in fact, putting it above zero just seems to make it take longer picking HasGaze the first time).
    As a secondary issue, I tried implementing the same thing for characters (have them turn towards the player if the player looks at them), but it doesn’t seem to work at all. Here is the code I used:

    
    	private GazeAwareComponent _gazeAware;
    	public Transform target;
    	// Use this for initialization
    	void Start () {
    		_gazeAware = GetComponent<GazeAwareComponent>();
    	}
    	
    	// Update is called once per frame
    	void Update () {
    		if (_gazeAware.HasGaze)
    		{
    			Vector3 relativePos = target.position - transform.position;
    			transform.rotation = Quaternion.LookRotation(relativePos);
    		}
    	
    	}
    

    If I comment out the if (_gazeAware.HasGaze) and just have the contents of that if block run directly, the characters are constantly turning to face the character, so I know that isn’t the issue, but instead it has something with how I’m probably incorrectly implementing the check. Help?

    #5094
    Jenny [Tobii]
    Participant

    Hi @babloyi,

    Sorry for the late response.

    Yes, the GazeAwareComponent will have HasGaze = false if there is a long enough blink. This is a tradeoff between responsiveness and robustness that ultimately has to be handled on the client side for the specific situation where the GazeAware behavior is used. For example if there is a visualization – use a soft animation to not have items blinking on off instantly as the HasGaze property changes between true and false.

    The delay time is like you already discovered just a delay how long the user must have looked at the item before it is considered to have gaze. In your case this just means that the “blink interruption” will be longer. In other situations it can help to get a more stable onset of the Gaze Aware HasGaze property.

    #5095
    Jenny [Tobii]
    Participant

    Ah, and then there was the second issue 🙂 For debugging you can check the “Show Projected Bounds” box in the Gaze Aware Component in the Inspector, which will draw a rectangle on the screen how the object is projected to the screen and “seen” by the EyeX Engine. This might give you a clue what is going wrong. You can also press Ctrl-Alt-Shift-F12 to toggle a visualization of your eye-gaze on screen on and off.

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