Home Forums Software Development Headtracking on Tobii eye tracker 4C Reply To: Headtracking on Tobii eye tracker 4C

#7773
Chou
Participant

Hi, I have tried to use demo of Unity SDK;
but it still not work at head tracking,

I change the 3rd demo to this:

//———————————————————————–
// Copyright 2016 Tobii AB (publ). All rights reserved.
//———————————————————————–

using UnityEngine;
using Tobii.Gaming;
using UnityEngine.UI;

/// <summary>
/// Various settings and utilities to manage calibrations and the presence of the user
/// </summary>
/// <remarks>
/// Referenced in the Eye Tracking Settings and Configuration example scene.
/// </remarks>
public class EyeTrackerSettingsMenu : MonoBehaviour
{
public Text TextViewUserPresenceStatus;
public Text TextViewIsUserPresent;
public Text TextViewDeviceStatus;

void Update()
{
UpdateUserPresenceView();
}

/// <summary>
/// Print the User Presence status
/// </summary>
private void UpdateUserPresenceView()
{
var userPresence = TobiiAPI.GetUserPresence();
HeadPose headPose = TobiiAPI.GetHeadPose();
TextViewUserPresenceStatus.text = userPresence.ToString();

if (TobiiAPI.GetUserPresence().IsUserPresent())
{
TextViewIsUserPresent.text = headPose.Position.x + “, ” + headPose.Position.y + “, ” + headPose.Position.z;
}
else
{
TextViewIsUserPresent.text = “No”;
}
}
}`

User present is present, but value is NaN,NaN,NaN;
I didn’t work at Unity before, but I think what I change has already working.
But it didn’t return my head position.