Tobii Pro SDK Python API
tobii_research Namespace Reference

All functionality is in this module. More...

Data Structures

class  CalibrationChangedData
 Provides data the EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED callback. More...
 
class  CalibrationEyeData
 Represents the calibration sample data collected for one eye. More...
 
class  CalibrationModeEnteredData
 Provides data the EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED callback. More...
 
class  CalibrationModeLeftData
 Provides data the EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT callback. More...
 
class  CalibrationPoint
 Represents the calibration point and its collected calibration samples. More...
 
class  CalibrationResult
 Represents the result of the calculated calibration. More...
 
class  CalibrationSample
 Represents the data collected for a calibration sample. More...
 
class  ConnectionLostData
 Provides data the EYETRACKER_NOTIFICATION_CONNECTION_LOST callback. More...
 
class  ConnectionRestoredData
 Provides data the EYETRACKER_NOTIFICATION_CONNECTION_RESTORED callback. More...
 
class  DeviceFaultsData
 Provides data the EYETRACKER_NOTIFICATION_DEVICE_FAULTS callback. More...
 
class  DeviceWarningsData
 Provides data the EYETRACKER_NOTIFICATION_DEVICE_WARNINGS callback. More...
 
class  DisplayArea
 Represents the corners in space of the active display area, and its size. More...
 
class  DisplayAreaChangedData
 Provides data the EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED callback. More...
 
class  ExternalSignalData
 Provides data for external signal. More...
 
class  EyeData
 Provides properties for the eye data. More...
 
class  EyeImageData
 Provides data for the eye image callback. More...
 
class  EyeTracker
 Provides methods and properties to manage and get data from an eye tracker. More...
 
class  EyeTrackerConnectionFailedError
 Is thrown when connection to an eye tracker is lost or could not be established. More...
 
class  EyeTrackerDisplayAreaNotValidError
 Is thrown if the display area isn't valid. More...
 
class  EyeTrackerFeatureNotSupportedError
 Is thrown when a feature is not supported for an eye tracker. More...
 
class  EyeTrackerInternalError
 Is thrown on internal errors in the API. More...
 
class  EyeTrackerInvalidOperationError
 Is thrown when the user tries to do an invalid operation. More...
 
class  EyeTrackerLicenseError
 Is thrown when there is an insufficient license level when using a restricted feature. More...
 
class  EyeTrackerOperationFailedError
 Is thrown when an eye tracker cannot execute a requested operation. More...
 
class  EyeTrackerSavedLicenseFailedToApplyError
 Is thrown if the eye tracker has a license saved, but it failed to apply. More...
 
class  EyeTrackerUnavailableError
 Is thrown if the eye tracker is unavailable. More...
 
class  EyeTrackingModeChangedData
 Provides data the EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED callback. More...
 
class  FailedLicense
 Represents a license that failed. More...
 
class  GazeData
 Provides data for gaze. More...
 
class  GazeOrigin
 Provides properties for the gaze origin. More...
 
class  GazeOutputFrequencyChangedData
 Provides data the EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED callback. More...
 
class  GazePoint
 Provides properties for the gaze point. More...
 
class  HMDBasedCalibration
 Represents the calibration data used by the eye tracker. More...
 
class  HMDCalibrationResult
 Represents the result of the HMD based calibration. More...
 
class  HMDEyeData
 Provides properties for the eye data when gotten from an HMD based device. More...
 
class  HMDGazeData
 Provides data for the HMD gaze. More...
 
class  HMDGazeDirection
 Provides properties for the HMD gaze direction. More...
 
class  HMDGazeOrigin
 Provides properties for the HMD gaze origin A HMDGazeOrigin object is used as value for HMDEyeData.gaze_origin. More...
 
class  HMDLensConfiguration
 Represents the lens configuration of the HMD device. More...
 
class  HMDPupilPosition
 Provides properties for the HMD pupil position. More...
 
class  LicenseKey
 Represents the eye tracker license key. More...
 
class  PupilData
 Provides properties for the pupil data. More...
 
class  ScreenBasedCalibration
 Provides methods and properties for managing calibrations for screen based eye trackers. More...
 
class  ScreenBasedMonocularCalibration
 Provides methods and properties for managing monocular and bi-monocular calibrations for screen based eye trackers. More...
 
class  StreamErrorData
 Provides information about a stream error. More...
 
class  TimeSynchronizationData
 Provides data for the time synchronization callback. More...
 
class  TrackBox
 Represents the eight corners in user coordinate system that together forms the track box. More...
 
class  TrackBoxChangedData
 Provides data the EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED callback. More...
 
class  UserPosition
 Provides properties for the user position. More...
 
class  UserPositionGuide
 Provides data for the user position guide. More...
 

Functions

def find_all_eyetrackers ()
 Finds eye trackers connected to the computer or the network. More...
 
def get_system_time_stamp ()
 Retrieves the time stamp from the system clock in microseconds. More...
 

Variables

string CALIBRATION_STATUS_FAILURE = "calibration_status_failure"
 Indicates that the calibration process failed. More...
 
string CALIBRATION_STATUS_SUCCESS = "calibration_status_success"
 Indicates that the calibration process succeeded for both eyes. More...
 
string CALIBRATION_STATUS_SUCCESS_LEFT_EYE = "calibration_status_success_left_eye"
 Indicates that the calibration process succeeded for the left eye. More...
 
string CALIBRATION_STATUS_SUCCESS_RIGHT_EYE = "calibration_status_success_right_eye"
 Indicates that the calibration process succeeded for the right eye. More...
 
string VALIDITY_INVALID_AND_NOT_USED = "validity_invalid_and_not_used"
 The eye tracking failed or the calibration eye data is invalid. More...
 
string VALIDITY_VALID_BUT_NOT_USED = "validity_valid_but_not_used"
 Eye tracking was successful, but the calibration eye data was not used in calibration e.g. More...
 
string VALIDITY_VALID_AND_USED = "validity_valid_and_used"
 The calibration eye data was valid and used in calibration. More...
 
string EXTERNAL_SIGNAL_CHANGE_TYPE_VALUE_CHANGED = "external_signal_change_type_value_changed"
 Indicates that the value sent to the eye tracker has changed. More...
 
string EXTERNAL_SIGNAL_CHANGE_TYPE_INITIAL_VALUE = "external_signal_change_type_initial_value"
 Indicates that the value is the initial value, and is received when starting a subscription. More...
 
string EXTERNAL_SIGNAL_CHANGE_TYPE_CONNECTION_RESTORED = "external_signal_change_type_connection_restored"
 Indicates that there has been a connection lost and now it is restored and the value is the current value. More...
 
string EYE_IMAGE_TYPE_FULL = "eye_image_type_full"
 Indicates that the eye tracker could not identify the eyes, and the image is the full image. More...
 
string EYE_IMAGE_TYPE_CROPPED = "eye_image_type_cropped"
 Indicates that the image is cropped and shows the eyes. More...
 
string EYE_IMAGE_TYPE_UNKNOWN = "eye_image_type_unknown"
 Indicates an unknown image type. More...
 
string CAPABILITY_CAN_SET_DISPLAY_AREA = "capability_can_set_display_area"
 Indicates that the device can have display areas set. More...
 
string CAPABILITY_HAS_EXTERNAL_SIGNAL = "capability_has_external_signal"
 Indicates that the device can deliver an external signal stream. More...
 
string CAPABILITY_HAS_EYE_IMAGES = "capability_has_eye_images"
 Indicates that the device can deliver an eye image stream. More...
 
string CAPABILITY_HAS_GAZE_DATA = "capability_has_gaze_data"
 Indicates that the device can deliver a gaze data stream. More...
 
string CAPABILITY_HAS_HMD_GAZE_DATA = "capability_has_hmd_gaze_data"
 Indicates that the device can deliver a HMD gaze data stream. More...
 
string CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION = "capability_can_do_screen_based_calibration"
 Indicates that screen based calibration can be performed on the device. More...
 
string CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION = "capability_can_do_hmd_based_calibration"
 Indicates that HMD based calibration can be performed on the device. More...
 
string CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION = "capability_can_do_monocular_calibration"
 Indicates that monocular calibration can be performed on the device. More...
 
string CAPABILITY_HAS_HMD_LENS_CONFIG = "capability_has_hmd_lens_config"
 Indicates that it's possible to get and set the HMD lens configuration on the device. More...
 
string EYETRACKER_EXTERNAL_SIGNAL = "eyetracker_external_signal"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for external signal. More...
 
string EYETRACKER_EYE_IMAGES = "eyetracker_eye_images"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for eye images. More...
 
string EYETRACKER_GAZE_DATA = "eyetracker_gaze_data"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for gaze data. More...
 
string EYETRACKER_USER_POSITION_GUIDE = "eyetracker_user_position_guide"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for gaze data. More...
 
string EYETRACKER_HMD_GAZE_DATA = "eyetracker_hmd_gaze_data"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for gaze data. More...
 
string EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED = "eyetracker_notification_calibration_mode_entered"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for calibration mode entered messages. More...
 
string EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT = "eyetracker_notification_calibration_mode_left"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for calibration mode left messages. More...
 
string EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED = "eyetracker_notification_calibration_changed"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for calibration changed messages. More...
 
string EYETRACKER_NOTIFICATION_CONNECTION_LOST = "eyetracker_notification_connection_lost"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for connection lost messages. More...
 
string EYETRACKER_NOTIFICATION_CONNECTION_RESTORED = "eyetracker_notification_connection_restored"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for connection restored messages. More...
 
string EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED = "eyetracker_notification_display_area_changed"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for display area changed messages. More...
 
string EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED = "eyetracker_notification_gaze_output_frequency_changed"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for gaze output frequency changed messages. More...
 
string EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED = "eyetracker_notification_track_box_changed"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for track box changed messages. More...
 
string EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED = "eyetracker_notification_eye_tracking_mode_changed"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for eyetracking mode changed messages. More...
 
string EYETRACKER_NOTIFICATION_DEVICE_FAULTS = "eyetracker_notification_device_faults"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for device faults messages. More...
 
string EYETRACKER_NOTIFICATION_DEVICE_WARNINGS = "eyetracker_notification_device_warnings"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for device warnings messages. More...
 
string EYETRACKER_STREAM_ERRORS = "eyetracker_stream_errors"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for stream errors. More...
 
string EYETRACKER_TIME_SYNCHRONIZATION_DATA = "eyetracker_time_synchronization_data"
 Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for time synchronization data. More...
 
string LICENSE_TAMPERED = "license_tampered"
 The license is tampered. More...
 
string LICENSE_INVALID_APPLICATION_SIGNATURE = "license_invalid_application_signature"
 The application signature is invalid. More...
 
string LICENSE_NONSIGNED_APPLICATION = "license_nonsigned_application"
 The application has not been signed. More...
 
string LICENSE_EXPIRED = "license_expired"
 The license has expired. More...
 
string LICENSE_PREMATURE = "license_premature"
 The license is not yet valid. More...
 
string LICENSE_INVALID_PROCESS_NAME = "license_invalid_process_name"
 The process name does not match the license. More...
 
string LICENSE_INVALID_SERIAL_NUMBER = "license_invalid_serial_number"
 The serial number does not match the license. More...
 
string LICENSE_INVALID_MODEL = "license_invalid_model"
 The model does not match the license. More...
 
string LICENSE_UNKNOWN_ERROR = "license_unknown_error"
 The license validation returned an unexpected result. More...
 
string SELECTED_EYE_LEFT = "selected_eye_left"
 Indicates that left eye was selected. More...
 
string SELECTED_EYE_RIGHT = "selected_eye_right"
 Indicates that right eye was selected. More...
 
string SELECTED_EYE_BOTH = "selected_eye_both"
 Indicates that both eyes were selected. More...
 

Detailed Description

All functionality is in this module.

Function Documentation

def tobii_research.find_all_eyetrackers ( )

Finds eye trackers connected to the computer or the network.

Please note that subsequent calls to find_all_eyetrackers() may return the eye trackers in a different order.

1 import tobii_research as tr
2 
3 eyetrackers = tr.find_all_eyetrackers()
4 
5 for eyetracker in eyetrackers:
6  print("Address: " + eyetracker.address)
7  print("Model: " + eyetracker.model)
8  print("Name (It's OK if this is empty): " + eyetracker.device_name)
9  print("Serial number: " + eyetracker.serial_number)
Exceptions
EyeTrackerInternalError
Returns
A tuple of EyeTracker objects found.
def tobii_research.get_system_time_stamp ( )

Retrieves the time stamp from the system clock in microseconds.

1 import tobii_research as tr
2 
3 system_time_stamp = tr.get_system_time_stamp()
4 
5 print("The system time stamp in microseconds is {0}.".format(system_time_stamp))
Exceptions
EyeTrackerInternalError

Variable Documentation

string tobii_research.CALIBRATION_STATUS_FAILURE = "calibration_status_failure"

Indicates that the calibration process failed.

Value for CalibrationResult.status and return value of collect_data

string tobii_research.CALIBRATION_STATUS_SUCCESS = "calibration_status_success"

Indicates that the calibration process succeeded for both eyes.

Value for CalibrationResult.status and return value of collect_data

string tobii_research.CALIBRATION_STATUS_SUCCESS_LEFT_EYE = "calibration_status_success_left_eye"

Indicates that the calibration process succeeded for the left eye.

Value for CalibrationResult.status and return value of collect_data

string tobii_research.CALIBRATION_STATUS_SUCCESS_RIGHT_EYE = "calibration_status_success_right_eye"

Indicates that the calibration process succeeded for the right eye.

Value for CalibrationResult.status and return value of collect_data

string tobii_research.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION = "capability_can_do_hmd_based_calibration"

Indicates that HMD based calibration can be performed on the device.

Value in tuple EyeTracker.device_capabilities

1 import tobii_research as tr
2 
3 # address = "tet-tcp://12.13.14.15"
4 eyetracker = tr.EyeTracker(address)
5 
6 print("Address: " + eyetracker.address)
7 print("Model: " + eyetracker.model)
8 print("Name (It's OK if this is empty): " + eyetracker.device_name)
9 print("Serial number: " + eyetracker.serial_number)
10 
11 if tr.CAPABILITY_CAN_SET_DISPLAY_AREA in eyetracker.device_capabilities:
12  print("The display area can be set on the eye tracker.")
13 else:
14  print("The display area can not be set on the eye tracker.")
15 
16 if tr.CAPABILITY_HAS_EXTERNAL_SIGNAL in eyetracker.device_capabilities:
17  print("The eye tracker can deliver an external signal stream.")
18 else:
19  print("The eye tracker can not deliver an external signal stream.")
20 
21 if tr.CAPABILITY_HAS_EYE_IMAGES in eyetracker.device_capabilities:
22  print("The eye tracker can deliver an eye image stream.")
23 else:
24  print("The eye tracker can not deliver an eye image stream.")
25 
26 if tr.CAPABILITY_HAS_GAZE_DATA in eyetracker.device_capabilities:
27  print("The eye tracker can deliver a gaze data stream.")
28 else:
29  print("The eye tracker can not deliver a gaze data stream.")
30 
31 if tr.CAPABILITY_HAS_HMD_GAZE_DATA in eyetracker.device_capabilities:
32  print("The eye tracker can deliver a HMD gaze data stream.")
33 else:
34  print("The eye tracker can not deliver a HMD gaze data stream.")
35 
36 if tr.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION in eyetracker.device_capabilities:
37  print("The eye tracker can do a screen based calibration.")
38 else:
39  print("The eye tracker can not do a screen based calibration.")
40 
41 if tr.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION in eyetracker.device_capabilities:
42  print("The eye tracker can do a monocular calibration.")
43 else:
44  print("The eye tracker can not do a monocular calibration.")
45 
46 if tr.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION in eyetracker.device_capabilities:
47  print("The eye tracker can do a HMD screen based calibration.")
48 else:
49  print("The eye tracker can not do a HMD screen based calibration.")
50 
51 if tr.CAPABILITY_HAS_HMD_LENS_CONFIG in eyetracker.device_capabilities:
52  print("The eye tracker can get/set the HMD lens configuration.")
53 else:
54  print("The eye tracker can not get/set the HMD lens configuration.")
string tobii_research.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION = "capability_can_do_monocular_calibration"

Indicates that monocular calibration can be performed on the device.

Value in tuple EyeTracker.device_capabilities

1 import tobii_research as tr
2 
3 # address = "tet-tcp://12.13.14.15"
4 eyetracker = tr.EyeTracker(address)
5 
6 print("Address: " + eyetracker.address)
7 print("Model: " + eyetracker.model)
8 print("Name (It's OK if this is empty): " + eyetracker.device_name)
9 print("Serial number: " + eyetracker.serial_number)
10 
11 if tr.CAPABILITY_CAN_SET_DISPLAY_AREA in eyetracker.device_capabilities:
12  print("The display area can be set on the eye tracker.")
13 else:
14  print("The display area can not be set on the eye tracker.")
15 
16 if tr.CAPABILITY_HAS_EXTERNAL_SIGNAL in eyetracker.device_capabilities:
17  print("The eye tracker can deliver an external signal stream.")
18 else:
19  print("The eye tracker can not deliver an external signal stream.")
20 
21 if tr.CAPABILITY_HAS_EYE_IMAGES in eyetracker.device_capabilities:
22  print("The eye tracker can deliver an eye image stream.")
23 else:
24  print("The eye tracker can not deliver an eye image stream.")
25 
26 if tr.CAPABILITY_HAS_GAZE_DATA in eyetracker.device_capabilities:
27  print("The eye tracker can deliver a gaze data stream.")
28 else:
29  print("The eye tracker can not deliver a gaze data stream.")
30 
31 if tr.CAPABILITY_HAS_HMD_GAZE_DATA in eyetracker.device_capabilities:
32  print("The eye tracker can deliver a HMD gaze data stream.")
33 else:
34  print("The eye tracker can not deliver a HMD gaze data stream.")
35 
36 if tr.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION in eyetracker.device_capabilities:
37  print("The eye tracker can do a screen based calibration.")
38 else:
39  print("The eye tracker can not do a screen based calibration.")
40 
41 if tr.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION in eyetracker.device_capabilities:
42  print("The eye tracker can do a monocular calibration.")
43 else:
44  print("The eye tracker can not do a monocular calibration.")
45 
46 if tr.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION in eyetracker.device_capabilities:
47  print("The eye tracker can do a HMD screen based calibration.")
48 else:
49  print("The eye tracker can not do a HMD screen based calibration.")
50 
51 if tr.CAPABILITY_HAS_HMD_LENS_CONFIG in eyetracker.device_capabilities:
52  print("The eye tracker can get/set the HMD lens configuration.")
53 else:
54  print("The eye tracker can not get/set the HMD lens configuration.")
string tobii_research.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION = "capability_can_do_screen_based_calibration"

Indicates that screen based calibration can be performed on the device.

Value in tuple EyeTracker.device_capabilities

1 import tobii_research as tr
2 
3 # address = "tet-tcp://12.13.14.15"
4 eyetracker = tr.EyeTracker(address)
5 
6 print("Address: " + eyetracker.address)
7 print("Model: " + eyetracker.model)
8 print("Name (It's OK if this is empty): " + eyetracker.device_name)
9 print("Serial number: " + eyetracker.serial_number)
10 
11 if tr.CAPABILITY_CAN_SET_DISPLAY_AREA in eyetracker.device_capabilities:
12  print("The display area can be set on the eye tracker.")
13 else:
14  print("The display area can not be set on the eye tracker.")
15 
16 if tr.CAPABILITY_HAS_EXTERNAL_SIGNAL in eyetracker.device_capabilities:
17  print("The eye tracker can deliver an external signal stream.")
18 else:
19  print("The eye tracker can not deliver an external signal stream.")
20 
21 if tr.CAPABILITY_HAS_EYE_IMAGES in eyetracker.device_capabilities:
22  print("The eye tracker can deliver an eye image stream.")
23 else:
24  print("The eye tracker can not deliver an eye image stream.")
25 
26 if tr.CAPABILITY_HAS_GAZE_DATA in eyetracker.device_capabilities:
27  print("The eye tracker can deliver a gaze data stream.")
28 else:
29  print("The eye tracker can not deliver a gaze data stream.")
30 
31 if tr.CAPABILITY_HAS_HMD_GAZE_DATA in eyetracker.device_capabilities:
32  print("The eye tracker can deliver a HMD gaze data stream.")
33 else:
34  print("The eye tracker can not deliver a HMD gaze data stream.")
35 
36 if tr.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION in eyetracker.device_capabilities:
37  print("The eye tracker can do a screen based calibration.")
38 else:
39  print("The eye tracker can not do a screen based calibration.")
40 
41 if tr.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION in eyetracker.device_capabilities:
42  print("The eye tracker can do a monocular calibration.")
43 else:
44  print("The eye tracker can not do a monocular calibration.")
45 
46 if tr.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION in eyetracker.device_capabilities:
47  print("The eye tracker can do a HMD screen based calibration.")
48 else:
49  print("The eye tracker can not do a HMD screen based calibration.")
50 
51 if tr.CAPABILITY_HAS_HMD_LENS_CONFIG in eyetracker.device_capabilities:
52  print("The eye tracker can get/set the HMD lens configuration.")
53 else:
54  print("The eye tracker can not get/set the HMD lens configuration.")
string tobii_research.CAPABILITY_CAN_SET_DISPLAY_AREA = "capability_can_set_display_area"

Indicates that the device can have display areas set.

Value in tuple EyeTracker.device_capabilities

1 import tobii_research as tr
2 
3 # address = "tet-tcp://12.13.14.15"
4 eyetracker = tr.EyeTracker(address)
5 
6 print("Address: " + eyetracker.address)
7 print("Model: " + eyetracker.model)
8 print("Name (It's OK if this is empty): " + eyetracker.device_name)
9 print("Serial number: " + eyetracker.serial_number)
10 
11 if tr.CAPABILITY_CAN_SET_DISPLAY_AREA in eyetracker.device_capabilities:
12  print("The display area can be set on the eye tracker.")
13 else:
14  print("The display area can not be set on the eye tracker.")
15 
16 if tr.CAPABILITY_HAS_EXTERNAL_SIGNAL in eyetracker.device_capabilities:
17  print("The eye tracker can deliver an external signal stream.")
18 else:
19  print("The eye tracker can not deliver an external signal stream.")
20 
21 if tr.CAPABILITY_HAS_EYE_IMAGES in eyetracker.device_capabilities:
22  print("The eye tracker can deliver an eye image stream.")
23 else:
24  print("The eye tracker can not deliver an eye image stream.")
25 
26 if tr.CAPABILITY_HAS_GAZE_DATA in eyetracker.device_capabilities:
27  print("The eye tracker can deliver a gaze data stream.")
28 else:
29  print("The eye tracker can not deliver a gaze data stream.")
30 
31 if tr.CAPABILITY_HAS_HMD_GAZE_DATA in eyetracker.device_capabilities:
32  print("The eye tracker can deliver a HMD gaze data stream.")
33 else:
34  print("The eye tracker can not deliver a HMD gaze data stream.")
35 
36 if tr.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION in eyetracker.device_capabilities:
37  print("The eye tracker can do a screen based calibration.")
38 else:
39  print("The eye tracker can not do a screen based calibration.")
40 
41 if tr.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION in eyetracker.device_capabilities:
42  print("The eye tracker can do a monocular calibration.")
43 else:
44  print("The eye tracker can not do a monocular calibration.")
45 
46 if tr.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION in eyetracker.device_capabilities:
47  print("The eye tracker can do a HMD screen based calibration.")
48 else:
49  print("The eye tracker can not do a HMD screen based calibration.")
50 
51 if tr.CAPABILITY_HAS_HMD_LENS_CONFIG in eyetracker.device_capabilities:
52  print("The eye tracker can get/set the HMD lens configuration.")
53 else:
54  print("The eye tracker can not get/set the HMD lens configuration.")
string tobii_research.CAPABILITY_HAS_EXTERNAL_SIGNAL = "capability_has_external_signal"

Indicates that the device can deliver an external signal stream.

Value in tuple EyeTracker.device_capabilities

1 import tobii_research as tr
2 
3 # address = "tet-tcp://12.13.14.15"
4 eyetracker = tr.EyeTracker(address)
5 
6 print("Address: " + eyetracker.address)
7 print("Model: " + eyetracker.model)
8 print("Name (It's OK if this is empty): " + eyetracker.device_name)
9 print("Serial number: " + eyetracker.serial_number)
10 
11 if tr.CAPABILITY_CAN_SET_DISPLAY_AREA in eyetracker.device_capabilities:
12  print("The display area can be set on the eye tracker.")
13 else:
14  print("The display area can not be set on the eye tracker.")
15 
16 if tr.CAPABILITY_HAS_EXTERNAL_SIGNAL in eyetracker.device_capabilities:
17  print("The eye tracker can deliver an external signal stream.")
18 else:
19  print("The eye tracker can not deliver an external signal stream.")
20 
21 if tr.CAPABILITY_HAS_EYE_IMAGES in eyetracker.device_capabilities:
22  print("The eye tracker can deliver an eye image stream.")
23 else:
24  print("The eye tracker can not deliver an eye image stream.")
25 
26 if tr.CAPABILITY_HAS_GAZE_DATA in eyetracker.device_capabilities:
27  print("The eye tracker can deliver a gaze data stream.")
28 else:
29  print("The eye tracker can not deliver a gaze data stream.")
30 
31 if tr.CAPABILITY_HAS_HMD_GAZE_DATA in eyetracker.device_capabilities:
32  print("The eye tracker can deliver a HMD gaze data stream.")
33 else:
34  print("The eye tracker can not deliver a HMD gaze data stream.")
35 
36 if tr.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION in eyetracker.device_capabilities:
37  print("The eye tracker can do a screen based calibration.")
38 else:
39  print("The eye tracker can not do a screen based calibration.")
40 
41 if tr.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION in eyetracker.device_capabilities:
42  print("The eye tracker can do a monocular calibration.")
43 else:
44  print("The eye tracker can not do a monocular calibration.")
45 
46 if tr.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION in eyetracker.device_capabilities:
47  print("The eye tracker can do a HMD screen based calibration.")
48 else:
49  print("The eye tracker can not do a HMD screen based calibration.")
50 
51 if tr.CAPABILITY_HAS_HMD_LENS_CONFIG in eyetracker.device_capabilities:
52  print("The eye tracker can get/set the HMD lens configuration.")
53 else:
54  print("The eye tracker can not get/set the HMD lens configuration.")
string tobii_research.CAPABILITY_HAS_EYE_IMAGES = "capability_has_eye_images"

Indicates that the device can deliver an eye image stream.

Value in tuple EyeTracker.device_capabilities

1 import tobii_research as tr
2 
3 # address = "tet-tcp://12.13.14.15"
4 eyetracker = tr.EyeTracker(address)
5 
6 print("Address: " + eyetracker.address)
7 print("Model: " + eyetracker.model)
8 print("Name (It's OK if this is empty): " + eyetracker.device_name)
9 print("Serial number: " + eyetracker.serial_number)
10 
11 if tr.CAPABILITY_CAN_SET_DISPLAY_AREA in eyetracker.device_capabilities:
12  print("The display area can be set on the eye tracker.")
13 else:
14  print("The display area can not be set on the eye tracker.")
15 
16 if tr.CAPABILITY_HAS_EXTERNAL_SIGNAL in eyetracker.device_capabilities:
17  print("The eye tracker can deliver an external signal stream.")
18 else:
19  print("The eye tracker can not deliver an external signal stream.")
20 
21 if tr.CAPABILITY_HAS_EYE_IMAGES in eyetracker.device_capabilities:
22  print("The eye tracker can deliver an eye image stream.")
23 else:
24  print("The eye tracker can not deliver an eye image stream.")
25 
26 if tr.CAPABILITY_HAS_GAZE_DATA in eyetracker.device_capabilities:
27  print("The eye tracker can deliver a gaze data stream.")
28 else:
29  print("The eye tracker can not deliver a gaze data stream.")
30 
31 if tr.CAPABILITY_HAS_HMD_GAZE_DATA in eyetracker.device_capabilities:
32  print("The eye tracker can deliver a HMD gaze data stream.")
33 else:
34  print("The eye tracker can not deliver a HMD gaze data stream.")
35 
36 if tr.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION in eyetracker.device_capabilities:
37  print("The eye tracker can do a screen based calibration.")
38 else:
39  print("The eye tracker can not do a screen based calibration.")
40 
41 if tr.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION in eyetracker.device_capabilities:
42  print("The eye tracker can do a monocular calibration.")
43 else:
44  print("The eye tracker can not do a monocular calibration.")
45 
46 if tr.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION in eyetracker.device_capabilities:
47  print("The eye tracker can do a HMD screen based calibration.")
48 else:
49  print("The eye tracker can not do a HMD screen based calibration.")
50 
51 if tr.CAPABILITY_HAS_HMD_LENS_CONFIG in eyetracker.device_capabilities:
52  print("The eye tracker can get/set the HMD lens configuration.")
53 else:
54  print("The eye tracker can not get/set the HMD lens configuration.")
string tobii_research.CAPABILITY_HAS_GAZE_DATA = "capability_has_gaze_data"

Indicates that the device can deliver a gaze data stream.

Standard for all screen based eye trackers. Value in tuple EyeTracker.device_capabilities

1 import tobii_research as tr
2 
3 # address = "tet-tcp://12.13.14.15"
4 eyetracker = tr.EyeTracker(address)
5 
6 print("Address: " + eyetracker.address)
7 print("Model: " + eyetracker.model)
8 print("Name (It's OK if this is empty): " + eyetracker.device_name)
9 print("Serial number: " + eyetracker.serial_number)
10 
11 if tr.CAPABILITY_CAN_SET_DISPLAY_AREA in eyetracker.device_capabilities:
12  print("The display area can be set on the eye tracker.")
13 else:
14  print("The display area can not be set on the eye tracker.")
15 
16 if tr.CAPABILITY_HAS_EXTERNAL_SIGNAL in eyetracker.device_capabilities:
17  print("The eye tracker can deliver an external signal stream.")
18 else:
19  print("The eye tracker can not deliver an external signal stream.")
20 
21 if tr.CAPABILITY_HAS_EYE_IMAGES in eyetracker.device_capabilities:
22  print("The eye tracker can deliver an eye image stream.")
23 else:
24  print("The eye tracker can not deliver an eye image stream.")
25 
26 if tr.CAPABILITY_HAS_GAZE_DATA in eyetracker.device_capabilities:
27  print("The eye tracker can deliver a gaze data stream.")
28 else:
29  print("The eye tracker can not deliver a gaze data stream.")
30 
31 if tr.CAPABILITY_HAS_HMD_GAZE_DATA in eyetracker.device_capabilities:
32  print("The eye tracker can deliver a HMD gaze data stream.")
33 else:
34  print("The eye tracker can not deliver a HMD gaze data stream.")
35 
36 if tr.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION in eyetracker.device_capabilities:
37  print("The eye tracker can do a screen based calibration.")
38 else:
39  print("The eye tracker can not do a screen based calibration.")
40 
41 if tr.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION in eyetracker.device_capabilities:
42  print("The eye tracker can do a monocular calibration.")
43 else:
44  print("The eye tracker can not do a monocular calibration.")
45 
46 if tr.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION in eyetracker.device_capabilities:
47  print("The eye tracker can do a HMD screen based calibration.")
48 else:
49  print("The eye tracker can not do a HMD screen based calibration.")
50 
51 if tr.CAPABILITY_HAS_HMD_LENS_CONFIG in eyetracker.device_capabilities:
52  print("The eye tracker can get/set the HMD lens configuration.")
53 else:
54  print("The eye tracker can not get/set the HMD lens configuration.")
string tobii_research.CAPABILITY_HAS_HMD_GAZE_DATA = "capability_has_hmd_gaze_data"

Indicates that the device can deliver a HMD gaze data stream.

Value in tuple EyeTracker.device_capabilities

1 import tobii_research as tr
2 
3 # address = "tet-tcp://12.13.14.15"
4 eyetracker = tr.EyeTracker(address)
5 
6 print("Address: " + eyetracker.address)
7 print("Model: " + eyetracker.model)
8 print("Name (It's OK if this is empty): " + eyetracker.device_name)
9 print("Serial number: " + eyetracker.serial_number)
10 
11 if tr.CAPABILITY_CAN_SET_DISPLAY_AREA in eyetracker.device_capabilities:
12  print("The display area can be set on the eye tracker.")
13 else:
14  print("The display area can not be set on the eye tracker.")
15 
16 if tr.CAPABILITY_HAS_EXTERNAL_SIGNAL in eyetracker.device_capabilities:
17  print("The eye tracker can deliver an external signal stream.")
18 else:
19  print("The eye tracker can not deliver an external signal stream.")
20 
21 if tr.CAPABILITY_HAS_EYE_IMAGES in eyetracker.device_capabilities:
22  print("The eye tracker can deliver an eye image stream.")
23 else:
24  print("The eye tracker can not deliver an eye image stream.")
25 
26 if tr.CAPABILITY_HAS_GAZE_DATA in eyetracker.device_capabilities:
27  print("The eye tracker can deliver a gaze data stream.")
28 else:
29  print("The eye tracker can not deliver a gaze data stream.")
30 
31 if tr.CAPABILITY_HAS_HMD_GAZE_DATA in eyetracker.device_capabilities:
32  print("The eye tracker can deliver a HMD gaze data stream.")
33 else:
34  print("The eye tracker can not deliver a HMD gaze data stream.")
35 
36 if tr.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION in eyetracker.device_capabilities:
37  print("The eye tracker can do a screen based calibration.")
38 else:
39  print("The eye tracker can not do a screen based calibration.")
40 
41 if tr.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION in eyetracker.device_capabilities:
42  print("The eye tracker can do a monocular calibration.")
43 else:
44  print("The eye tracker can not do a monocular calibration.")
45 
46 if tr.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION in eyetracker.device_capabilities:
47  print("The eye tracker can do a HMD screen based calibration.")
48 else:
49  print("The eye tracker can not do a HMD screen based calibration.")
50 
51 if tr.CAPABILITY_HAS_HMD_LENS_CONFIG in eyetracker.device_capabilities:
52  print("The eye tracker can get/set the HMD lens configuration.")
53 else:
54  print("The eye tracker can not get/set the HMD lens configuration.")
string tobii_research.CAPABILITY_HAS_HMD_LENS_CONFIG = "capability_has_hmd_lens_config"

Indicates that it's possible to get and set the HMD lens configuration on the device.

Value in tuple EyeTracker.device_capabilities

1 import tobii_research as tr
2 
3 # address = "tet-tcp://12.13.14.15"
4 eyetracker = tr.EyeTracker(address)
5 
6 print("Address: " + eyetracker.address)
7 print("Model: " + eyetracker.model)
8 print("Name (It's OK if this is empty): " + eyetracker.device_name)
9 print("Serial number: " + eyetracker.serial_number)
10 
11 if tr.CAPABILITY_CAN_SET_DISPLAY_AREA in eyetracker.device_capabilities:
12  print("The display area can be set on the eye tracker.")
13 else:
14  print("The display area can not be set on the eye tracker.")
15 
16 if tr.CAPABILITY_HAS_EXTERNAL_SIGNAL in eyetracker.device_capabilities:
17  print("The eye tracker can deliver an external signal stream.")
18 else:
19  print("The eye tracker can not deliver an external signal stream.")
20 
21 if tr.CAPABILITY_HAS_EYE_IMAGES in eyetracker.device_capabilities:
22  print("The eye tracker can deliver an eye image stream.")
23 else:
24  print("The eye tracker can not deliver an eye image stream.")
25 
26 if tr.CAPABILITY_HAS_GAZE_DATA in eyetracker.device_capabilities:
27  print("The eye tracker can deliver a gaze data stream.")
28 else:
29  print("The eye tracker can not deliver a gaze data stream.")
30 
31 if tr.CAPABILITY_HAS_HMD_GAZE_DATA in eyetracker.device_capabilities:
32  print("The eye tracker can deliver a HMD gaze data stream.")
33 else:
34  print("The eye tracker can not deliver a HMD gaze data stream.")
35 
36 if tr.CAPABILITY_CAN_DO_SCREEN_BASED_CALIBRATION in eyetracker.device_capabilities:
37  print("The eye tracker can do a screen based calibration.")
38 else:
39  print("The eye tracker can not do a screen based calibration.")
40 
41 if tr.CAPABILITY_CAN_DO_MONOCULAR_CALIBRATION in eyetracker.device_capabilities:
42  print("The eye tracker can do a monocular calibration.")
43 else:
44  print("The eye tracker can not do a monocular calibration.")
45 
46 if tr.CAPABILITY_CAN_DO_HMD_BASED_CALIBRATION in eyetracker.device_capabilities:
47  print("The eye tracker can do a HMD screen based calibration.")
48 else:
49  print("The eye tracker can not do a HMD screen based calibration.")
50 
51 if tr.CAPABILITY_HAS_HMD_LENS_CONFIG in eyetracker.device_capabilities:
52  print("The eye tracker can get/set the HMD lens configuration.")
53 else:
54  print("The eye tracker can not get/set the HMD lens configuration.")
string tobii_research.EXTERNAL_SIGNAL_CHANGE_TYPE_CONNECTION_RESTORED = "external_signal_change_type_connection_restored"

Indicates that there has been a connection lost and now it is restored and the value is the current value.

Value for ExternalSignalData.change_type

string tobii_research.EXTERNAL_SIGNAL_CHANGE_TYPE_INITIAL_VALUE = "external_signal_change_type_initial_value"

Indicates that the value is the initial value, and is received when starting a subscription.

Value for ExternalSignalData.change_type

string tobii_research.EXTERNAL_SIGNAL_CHANGE_TYPE_VALUE_CHANGED = "external_signal_change_type_value_changed"

Indicates that the value sent to the eye tracker has changed.

Value for ExternalSignalData.change_type

string tobii_research.EYE_IMAGE_TYPE_CROPPED = "eye_image_type_cropped"

Indicates that the image is cropped and shows the eyes.

Value for EyeImageData.image_type

string tobii_research.EYE_IMAGE_TYPE_FULL = "eye_image_type_full"

Indicates that the eye tracker could not identify the eyes, and the image is the full image.

Value for EyeImageData.image_type

string tobii_research.EYE_IMAGE_TYPE_UNKNOWN = "eye_image_type_unknown"

Indicates an unknown image type.

Value for EyeImageData.image_type

string tobii_research.EYETRACKER_EXTERNAL_SIGNAL = "eyetracker_external_signal"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for external signal.

You will get a callback when the value of the external signal port (TTL input) on the eye tracker device changes. Not all eye trackers have an output trigger port. The output feature could be used to synchronize the eye tracker data with data from other devices. The output data contains a time reference that matches the time reference on the time synchronized gaze data. Callbacks will receive an ExternalSignalData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import time
2 import tobii_research as tr
3 
4 
5 def external_signal_callback(external_signal_data):
6  print(external_signal_data)
7 
8 
9 def external_signal(eyetracker):
10  print("Subscribing to external signal for eye tracker with serial number {0}.".format(eyetracker.serial_number))
11  eyetracker.subscribe_to(tr.EYETRACKER_EXTERNAL_SIGNAL, external_signal_callback, as_dictionary=True)
12 
13  # Wait for external signal.
14  time.sleep(2)
15 
16  eyetracker.unsubscribe_from(tr.EYETRACKER_EXTERNAL_SIGNAL, external_signal_callback)
17  print("Unsubscribed from external signal.")
string tobii_research.EYETRACKER_EYE_IMAGES = "eyetracker_eye_images"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for eye images.

You will get a callback when a new eye image is received, and the occurrence depends on the eye tracker model. Not all eye tracker models support this feature. If no one is listening to gaze data, the eye tracker will only deliver full images, otherwise either cropped or full images will be delivered depending on whether or not the eye tracker has detected eyes. Callbacks will receive an EyeImageData object or a dictionary with values if as_dictionary is True.

1 import sys
2 import base64
3 import time
4 import tobii_research as tr
5 
6 if sys.version_info[0] == 3:
7  # Python 3
8  from tkinter import Tk, PhotoImage
9 else:
10  from Tkinter import Tk, PhotoImage
11 
12 
13 def eye_image_callback(eye_image_data):
14  print("System time: {0}, Device time {1}, Camera id {2}".format(eye_image_data['system_time_stamp'],
15  eye_image_data['device_time_stamp'],
16  eye_image_data['camera_id']))
17 
18  image = PhotoImage(data=base64.standard_b64encode(eye_image_data['image_data']))
19  print("{0} width {1}, height {2}".format(image, image.width(), image.height()))
20 
21 
22 def eye_images(eyetracker):
23  root = Tk()
24  print("Subscribing to eye images for eye tracker with serial number {0}.".format(eyetracker.serial_number))
25  eyetracker.subscribe_to(tr.EYETRACKER_EYE_IMAGES, eye_image_callback, as_dictionary=True)
26 
27  # Wait for eye images.
28  time.sleep(2)
29 
30  eyetracker.unsubscribe_from(tr.EYETRACKER_EYE_IMAGES, eye_image_callback)
31  print("Unsubscribed from eye images.")
32  root.destroy()
string tobii_research.EYETRACKER_GAZE_DATA = "eyetracker_gaze_data"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for gaze data.

You will get a callback when time synchronized gaze is received. Time synchronized gaze is not supported on all eye trackers, other eye trackers need additional license to activate this support. Callbacks will receive a GazeData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import time
2 import tobii_research as tr
3 
4 global_gaze_data = None
5 
6 
7 def gaze_data_callback(gaze_data):
8  global global_gaze_data
9  global_gaze_data = gaze_data
10 
11 
12 def gaze_data(eyetracker):
13  global global_gaze_data
14 
15  print("Subscribing to gaze data for eye tracker with serial number {0}.".format(eyetracker.serial_number))
16  eyetracker.subscribe_to(tr.EYETRACKER_GAZE_DATA, gaze_data_callback, as_dictionary=True)
17 
18  # Wait while some gaze data is collected.
19  time.sleep(2)
20 
21  eyetracker.unsubscribe_from(tr.EYETRACKER_GAZE_DATA, gaze_data_callback)
22  print("Unsubscribed from gaze data.")
23 
24  print("Last received gaze package:")
25  print(global_gaze_data)
string tobii_research.EYETRACKER_HMD_GAZE_DATA = "eyetracker_hmd_gaze_data"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for gaze data.

You will get a callback when time synchronized HMD gaze is received. Time synchronized HMD gaze is not supported on all eye trackers. Callbacks will receive a HMDGazeData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import time
2 import tobii_research as tr
3 
4 global_gaze_data = None
5 
6 
7 def gaze_data_callback(gaze_data):
8  global global_gaze_data
9  global_gaze_data = gaze_data
10 
11 
12 def gaze_data(eyetracker):
13  global global_gaze_data
14 
15  print("Subscribing to gaze data for eye tracker with serial number {0}.".format(eyetracker.serial_number))
16  eyetracker.subscribe_to(tr.EYETRACKER_GAZE_DATA, gaze_data_callback, as_dictionary=True)
17 
18  # Wait while some gaze data is collected.
19  time.sleep(2)
20 
21  eyetracker.unsubscribe_from(tr.EYETRACKER_GAZE_DATA, gaze_data_callback)
22  print("Unsubscribed from gaze data.")
23 
24  print("Last received gaze package:")
25  print(global_gaze_data)
string tobii_research.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED = "eyetracker_notification_calibration_changed"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for calibration changed messages.

You will get a callback when the calibration is changed. Callbacks will receive a CalibrationChangedData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED = "eyetracker_notification_calibration_mode_entered"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for calibration mode entered messages.

You will get a callback when calibration mode is entered. Callbacks will receive a CalibrationModeEnteredData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT = "eyetracker_notification_calibration_mode_left"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for calibration mode left messages.

You will get a callback when calibration mode is left. Callbacks will receive a CalibrationModeLeftData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_CONNECTION_LOST = "eyetracker_notification_connection_lost"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for connection lost messages.

You will get a callback when connection to the eye tracker is lost. Callbacks will receive a ConnectionLostData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED = "eyetracker_notification_connection_restored"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for connection restored messages.

You will get a callback when connection to the eye tracker is restored. Callbacks will receive a ConnectionRestoredData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_DEVICE_FAULTS = "eyetracker_notification_device_faults"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for device faults messages.

You will get a callback when new faults are received. Callbacks will receive a DeviceFaultsData object or a dictionary with values if as_dictionary is True. The faults information consists of a comma seprated string. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS = "eyetracker_notification_device_warnings"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for device warnings messages.

You will get a callback when new warnings are received. Callbacks will receive a DeviceWarningsData object or a dictionary with values if as_dictionary is True. The warnings information consists of a comma seprated string. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED = "eyetracker_notification_display_area_changed"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for display area changed messages.

You will get a callback when the display area is changed. Callbacks will receive a DisplayAreaChangedData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED = "eyetracker_notification_eye_tracking_mode_changed"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for eyetracking mode changed messages.

You will get a callback when the eyetracking mode is changed. Callbacks will receive a EyeTrackingModeChangedData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED = "eyetracker_notification_gaze_output_frequency_changed"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for gaze output frequency changed messages.

You will get a callback when the gaze output frequency is changed. Callbacks will receive a GazeOutputFrequencyChangedData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED = "eyetracker_notification_track_box_changed"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for track box changed messages.

You will get a callback when the track box is changed. Callbacks will receive a TrackBoxChangedData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import tobii_research as tr
2 
3 
4 def notification_callback(notification, data):
5  print("Notification {0} received at time stamp {1}.".format(notification, data.system_time_stamp))
6 
7 
8 def notifications(eyetracker):
9  all_notifications =\
10  (tr.EYETRACKER_NOTIFICATION_CONNECTION_LOST,
11  tr.EYETRACKER_NOTIFICATION_CONNECTION_RESTORED,
12  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_ENTERED,
13  tr.EYETRACKER_NOTIFICATION_CALIBRATION_MODE_LEFT,
14  tr.EYETRACKER_NOTIFICATION_CALIBRATION_CHANGED,
15  tr.EYETRACKER_NOTIFICATION_TRACK_BOX_CHANGED,
16  tr.EYETRACKER_NOTIFICATION_DISPLAY_AREA_CHANGED,
17  tr.EYETRACKER_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED,
18  tr.EYETRACKER_NOTIFICATION_EYE_TRACKING_MODE_CHANGED,
19  tr.EYETRACKER_NOTIFICATION_DEVICE_FAULTS,
20  tr.EYETRACKER_NOTIFICATION_DEVICE_WARNINGS)
21 
22  # Subscribe to all notifications.
23  for notification in all_notifications:
24  eyetracker.subscribe_to(notification,
25  lambda x, notification=notification: notification_callback(notification, x))
26  print("Subscribed to {0} for eye tracker with serial number {1}.".
27  format(notification, eyetracker.serial_number))
28 
29  # Trigger some notifications
30  calibration = tr.ScreenBasedCalibration(eyetracker)
31 
32  calibration.enter_calibration_mode()
33 
34  calibration.leave_calibration_mode()
35 
36  # Unsubscribe from notifications.
37  for notification in all_notifications:
38  eyetracker.unsubscribe_from(notification)
39  print("Unsubscribed from {0}.".format(notification))
string tobii_research.EYETRACKER_STREAM_ERRORS = "eyetracker_stream_errors"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for stream errors.

You will get a callback when an error occurs on other streams. You can get errors when subscribing, when something happened to the connection in the stream pump or when an error was raised in a callback. Callbacks will receive a StreamErrorData object or a dictionary with values if as_dictionary is True.

1 import time
2 import tobii_research as tr
3 
4 
5 def stream_error_callback(stream_error_data):
6  print(stream_error_data)
7 
8 
9 def eye_image_callback(data):
10  pass
11 
12 
13 def stream_errors(eyetracker):
14  print("Subscribing to stream errors for eye tracker with serial number {0}.".format(eyetracker.serial_number))
15  eyetracker.subscribe_to(tr.EYETRACKER_STREAM_ERRORS, stream_error_callback, as_dictionary=True)
16 
17  # Trigger an error by subscribing to something not supported.
18  eyetracker.subscribe_to(tr.EYETRACKER_EYE_IMAGES, eye_image_callback)
19  time.sleep(1)
20  eyetracker.unsubscribe_from(tr.EYETRACKER_EYE_IMAGES, eye_image_callback)
21 
22  eyetracker.unsubscribe_from(tr.EYETRACKER_STREAM_ERRORS, stream_error_callback)
23  print("Unsubscribed from stream errors.")
string tobii_research.EYETRACKER_TIME_SYNCHRONIZATION_DATA = "eyetracker_time_synchronization_data"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for time synchronization data.

You will get a callback when the computer and the eye trackers clocks gets synchronized. To handle normal drifts between clocks the clocks are checked on regular basis, and this results in that the time stamps are adjusted for the drifts in the data streams. This drift handling is done in real time. The data received from this event could be used for an even more accurate drift adjustment in the post processing. Callbacks will receive a TimeSynchronizationData object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import time
2 import tobii_research as tr
3 
4 
5 def time_synchronization_data_callback(time_synchronization_data):
6  print(time_synchronization_data)
7 
8 
9 def time_synchronization_data(eyetracker):
10  print("Subscribing to time synchronization data for eye tracker with serial number {0}.".
11  format(eyetracker.serial_number))
12  eyetracker.subscribe_to(tr.EYETRACKER_TIME_SYNCHRONIZATION_DATA,
13  time_synchronization_data_callback, as_dictionary=True)
14 
15  # Wait while some time synchronization data is collected.
16  time.sleep(2)
17 
18  eyetracker.unsubscribe_from(tr.EYETRACKER_TIME_SYNCHRONIZATION_DATA,
19  time_synchronization_data_callback)
20  print("Unsubscribed from time synchronization data.")
string tobii_research.EYETRACKER_USER_POSITION_GUIDE = "eyetracker_user_position_guide"

Used in EyeTracker.subscribe_to and EyeTracker.unsubscribe_from for gaze data.

Callbacks will receive a UserPositionGuide, object or a dictionary with values if as_dictionary is True. See find_all_eyetrackers or EyeTracker.__init__ on how to create an EyeTracker object.

1 import time
2 import tobii_research as tr
3 
4 global_user_position_guide = None
5 
6 
7 def user_position_guide_callback(user_position_guide):
8  global global_user_position_guide
9  global_user_position_guide = user_position_guide
10 
11 
12 def user_position_guide(eyetracker):
13  global global_user_position_guide
14 
15  print("Subscribing to user position guide for eye tracker with serial number {0}.".format(eyetracker.serial_number))
16  eyetracker.subscribe_to(tr.EYETRACKER_USER_POSITION_GUIDE, user_position_guide_callback, as_dictionary=True)
17 
18  # Wait while some user position guide is collected.
19  time.sleep(2)
20 
21  eyetracker.unsubscribe_from(tr.EYETRACKER_USER_POSITION_GUIDE, user_position_guide_callback)
22  print("Unsubscribed from user position guide.")
23 
24  print("Last received user position guide package:")
25  print(global_user_position_guide)
string tobii_research.LICENSE_EXPIRED = "license_expired"

The license has expired.

Value for FailedLicense.validation_result

string tobii_research.LICENSE_INVALID_APPLICATION_SIGNATURE = "license_invalid_application_signature"

The application signature is invalid.

Value for FailedLicense.validation_result

string tobii_research.LICENSE_INVALID_MODEL = "license_invalid_model"

The model does not match the license.

Value for FailedLicense.validation_result

string tobii_research.LICENSE_INVALID_PROCESS_NAME = "license_invalid_process_name"

The process name does not match the license.

Value for FailedLicense.validation_result

string tobii_research.LICENSE_INVALID_SERIAL_NUMBER = "license_invalid_serial_number"

The serial number does not match the license.

Value for FailedLicense.validation_result

string tobii_research.LICENSE_NONSIGNED_APPLICATION = "license_nonsigned_application"

The application has not been signed.

Value for FailedLicense.validation_result

string tobii_research.LICENSE_PREMATURE = "license_premature"

The license is not yet valid.

Value for FailedLicense.validation_result

string tobii_research.LICENSE_TAMPERED = "license_tampered"

The license is tampered.

Value for FailedLicense.validation_result

string tobii_research.LICENSE_UNKNOWN_ERROR = "license_unknown_error"

The license validation returned an unexpected result.

Value for FailedLicense.validation_result

string tobii_research.SELECTED_EYE_BOTH = "selected_eye_both"

Indicates that both eyes were selected.

Value for the input of ScreenBasedMonocularCalibration methods

string tobii_research.SELECTED_EYE_LEFT = "selected_eye_left"

Indicates that left eye was selected.

Value for the input of ScreenBasedMonocularCalibration methods

string tobii_research.SELECTED_EYE_RIGHT = "selected_eye_right"

Indicates that right eye was selected.

Value for the input of ScreenBasedMonocularCalibration methods

string tobii_research.VALIDITY_INVALID_AND_NOT_USED = "validity_invalid_and_not_used"

The eye tracking failed or the calibration eye data is invalid.

Value for CalibrationEyeData.validity

string tobii_research.VALIDITY_VALID_AND_USED = "validity_valid_and_used"

The calibration eye data was valid and used in calibration.

Value for CalibrationEyeData.validity

string tobii_research.VALIDITY_VALID_BUT_NOT_USED = "validity_valid_but_not_used"

Eye tracking was successful, but the calibration eye data was not used in calibration e.g.

gaze was too far away. Value for CalibrationEyeData.validity