This is example 7. This example demonstrates the following:

  1. Starting the baseline procedure

  2. Starting the calibration procedure

  3. Starting the validation procedure

  4. Aborting a running procedure

This example is based on example 6. With additional calls for starting the baseline, calibration and validation procedures.

Unless you have your own eye-tracker user-interface from which you’re controlling participant setup, presenting targets etc., you can skip this page.

Normally you wouldn’t programmatically start a baseline, calibration or validation procedure since it is better done manually from the user-interface after having set-up the participant. However when running the eye-tracker in GUI-less mode then you have no choice but to start these procedures explicitly from your program.

To run the eye-tracker in GUI-less mode call eyevec_initialize() with the control parameter set to false (instead of the default true). Doing so means you have to provide an eye-tracker user-interface yourself, or at least handle calibration target presentation.

Source code

Source file: example7.c

processInput()

The following single character commands are implemented here:
q: quit
o: open/close device
u: show/hide control window
x: toggle show gui on setup mode
X: toggle show gui on data mode
i: enter idle mode
s: enter setup mode
z: enter data mode
b: start baseline procedure
B: drop baseline results
c: start calibration procedure
C: drop calibration results
v: start validation procedure
V: drop validation results
a: abort procedure
m: toggle show mode-change events

When you press b, c or v then eyevec_start_baseline(), eyevec_start_calibration() resp. eyevec_start_validation() will be called causing the eye-tracker to run the corresponding procedure. When you press a then eyevec_abort_procedure() will be called, which aborts the running procedure if applicable.

static int processInput(EyeVec* eyevec, ClientData* clientdata, int ch)
{
    .
    .
    .
    else if (ch == 'b') {
        bool ignore;
        err = eyevec_start_baseline(eyevec, &ignore); (1)
        printError("eyevec_start_baseline()", err);
    }
    else if (ch == 'B') {
        err = eyevec_drop_baseline(eyevec); (2)
        printError("eyevec_drop_baseline()", err);
    }
    else if (ch == 'c') {
        bool ignore;
        err = eyevec_start_calibration(eyevec, &ignore); (3)
        printError("eyevec_start_calibration()", err);
    }
    else if (ch == 'C') {
#if 1
        err = eyevec_drop_calibration(eyevec, true); (4)
#else
        err = eyevec_drop_calibration(eyevec, false);
#endif
        printError("eyevec_drop_calibration()", err);
    }
    else if (ch == 'v') {
        bool ignore;
        err = eyevec_start_validation(eyevec, &ignore, (5)
            false);
        printError("eyevec_start_validation()", err);
    }
    else if (ch == 'V') {
        err = eyevec_drop_validation(eyevec); (6)
        printError("eyevec_drop_validation()", err);
    }
    else if (ch == 'a') {
        err = eyevec_abort_procedure(eyevec); (7)
        printError("eyevec_abort_procedure()", err);
    }
    .
    .
    .
}
1 Start baseline procedure.
2 Drop latest baseline results.
3 Start calibration procedure.
4 Drop latest calibration results.
5 Start validation procedure.
6 Drop latest validation results.
7 Abort running procedure, if applicable.

Running

For the purpose of explanation we assume you’ll be running the eye-tracker in GUI mode, not GUI-less mode. You can try the latter when you’ve created your own eye-tracker graphics.

After a succesful build run the program:

  1. Press x to call eyevec_set_show_gui_on_setup_mode(). This sets the show-gui-on-setup-mode flag.

  2. Press o to call eyevec_open(). Eye-tracker should go from off mode to idle mode.

  3. Press s to call eyevec_enter_setup_mode(). Eye-tracker should go from idle mode to setup mode and the user-interface should appear. At this time if necessary tweak the participant features in the user-interface as described in Checking participant features.

  4. Press b to call eyevec_start_baseline(). You might want to read Running the baseline procedure first. Eye-tracker should go from setup mode to baseline mode, run the baseline procedure, and then return to setup mode. Evaluate the baseline results and if not satisfied press B to call eyevec_drop_baseline() and then redo the baseline measurement.

  5. Press c to call eyevec_start_calibration(). You might want to read Running the calibration procedure first. Eye-tracker should go from setup mode to calibration mode, run the calibration procedure, and then return to setup mode. Evaluate the calibration results and if not satisfied press C to call eyevec_drop_calibration() and then redo the calibration.

  6. Press v to call eyevec_start_validation(). You might want to read Running the validation procedure first. Eye-tracker should go from setup mode to validation mode, run the validation procedure, and then return to setup mode. Evaluate the validation results and if not satisfied press V to call eyevec_drop_validation() and then redo the validation.

  7. In the user-interface press Esc or click Proceed make the eye-tracker go from setup mode to data mode (obviously calling eyevec_enter_data_mode() would also work). The user-interface should disappear.

  8. Press q to quit.

Output might look like this (empty lines added for clarity):

eyevec_create_thread(): OK
eyevec_initialize(): OK
Type q to quit, ? for help.

[x]
eyevec_set_show_gui_on_setup_mode(true): OK

[o]
onModeChange:
    eventtime:                  1750433145834565
    oldmode:                    TRACKER_MODE_OFF
    newmode:                    TRACKER_MODE_IDLE
eyevec_open(): OK

[s]
onModeChange:
    eventtime:                  1750433149972182
    oldmode:                    TRACKER_MODE_IDLE
    newmode:                    TRACKER_MODE_SETUP
eyevec_enter_setup_mode(): OK

[b]
onModeChange:
    eventtime:                  1750433163743438
    oldmode:                    TRACKER_MODE_SETUP
    newmode:                    TRACKER_MODE_SETUP_BASELINE
eyevec_start_baseline(): OK
onModeChange:
    eventtime:                  1750433166778379
    oldmode:                    TRACKER_MODE_SETUP_BASELINE
    newmode:                    TRACKER_MODE_SETUP

[c]
onModeChange:
    eventtime:                  1750433174214461
    oldmode:                    TRACKER_MODE_SETUP
    newmode:                    TRACKER_MODE_SETUP_CALIBRATION
eyevec_start_calibration(): OK
onModeChange:
    eventtime:                  1750433184802951
    oldmode:                    TRACKER_MODE_SETUP_CALIBRATION
    newmode:                    TRACKER_MODE_SETUP

[v]
onModeChange:
    eventtime:                  1750433194256964
    oldmode:                    TRACKER_MODE_SETUP
    newmode:                    TRACKER_MODE_SETUP_VALIDATION
eyevec_start_validation(): OK
onModeChange:
    eventtime:                  1750433205185028
    oldmode:                    TRACKER_MODE_SETUP_VALIDATION
    newmode:                    TRACKER_MODE_SETUP

onModeChange:
    eventtime:                  1750433224224371
    oldmode:                    TRACKER_MODE_SETUP
    newmode:                    TRACKER_MODE_DATA

[q]
eyevec_cleanup(): OK
eyevec_destroy_thread(): OK

Whether you followed the above commands to run the baseline, calibration and validation procedures or simply used the user-interface buttons, it should end with the eye-tracker switching from setup mode to data mode (see Eye-tracker modes). This means the eye-tracker is now ready to record eye-tracking data or run a drift-check.