-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinittracker.m
More file actions
66 lines (59 loc) · 2.13 KB
/
inittracker.m
File metadata and controls
66 lines (59 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
function [ status, EThndl, trackerSettings ] = inittracker( bgColor, nPoint, varargin )
%inittracker Initilise SMI Eyetracker
% Default is running mode
% Status code
% 1 - could not be initialized
fprintf('\n\n');
fprintf('Initialising SMI Eyetracker...\n')
% add SMITE toolbox
addpath(genpath('SMITE'));
% default LPT is a running mode
dummymode = 0;
if nargin > 2
if strcmp(varargin{1}, 'dummy')
dummymode = 1;
end
end
% get setup struct, edit to change settings
trackerSettings = SMITE.getDefaults('RED250mobile');
trackerSettings.doAverageEyes = false;
trackerSettings.setup.startScreen = 1;
trackerSettings.cal.autoPace = 2;
trackerSettings.cal.bgColor = bgColor;
trackerSettings.cal.nPoint = nPoint;
trackerSettings.cal.rangeX = 1920 * .5;
trackerSettings.cal.rangeY = 1200 * .9;
trackerSettings.setup.geomProfile = 'Profile imat';
% custom calibration drawer
calViz = AnimatedCalibrationDisplay();
calViz.bgColor = trackerSettings.cal.bgColor;
trackerSettings.cal.drawFunction = @calViz.doDraw;
% init
EThndl = SMITE(trackerSettings);
if dummymode
EThndl = EThndl.setDummyMode();
EThndl.init();
fprintf('SMI eyetracker in a dummy mode...\n')
status = 0;
else
EThndl.init();
if EThndl.isConnected
fprintf('Eyetracker initialised...\n');
fprintf('Running experiment on %s at sampling rate %d\n', ...
EThndl.systemInfo.iV_ETDevice, EThndl.systemInfo.samplerate);
fprintf('iV version %d.%d.%d\n', ...
EThndl.systemInfo.iV_MajorVersion, ...
EThndl.systemInfo.iV_MinorVersion, ...
EThndl.systemInfo.iV_Buildnumber);
fprintf('API version %d.%d.%d\n', ...
EThndl.systemInfo.API_MajorVersion, ...
EThndl.systemInfo.API_MinorVersion, ...
EThndl.systemInfo.API_Buildnumber);
status = 0;
else
fprintf('Problem with the tracker...\n');
fprintf('%s \n', SMIErrCode2String(EThndl.isConnected));
status = 1;
end
end
end