-
Notifications
You must be signed in to change notification settings - Fork 1
/
goodDataCheck.m
36 lines (32 loc) · 1.21 KB
/
goodDataCheck.m
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
function [dataGood] = goodDataCheck(trackerData, TCM_LED_IDs)
% function [dataGood] = goodDataCheck(trackerData, TCM_LED_IDs)
%
% Checks that data from motion trackers obtained through VzGetDat are
% (1) free of zero data and (2) that the tracker buffer has been fully
% updated since the previous call of this function. (goodDataCheck simply
% wraps zeroDataCheck and bufferUpdateCheck.)
%
% __Output__
%
% dataGood true if no zero data and buffer has been fully updated
% since last call, false otherwise.
%
% __Input__
%
% trackerData Marker position matrix obtained from motion trackers
% via vzGetDat.
%
% TCM_LED_IDs optional, default is to check all markers in trackerData.
% Else, n-by-2 matrix, where n is the number of markers,
% column 1 holds TCMIDs for the markers of interest, and
% column 2 holds their LEDIDs. Only those markers are
% checked.
%
% See also ZERODATACHECK, BUFFERUPDATECHECK
% by default check all markers, else use only desired ones
if nargin > 1
trackerData = ...
trackerData(markerIdsToRows(trackerData, TCM_LED_IDs), :);
end
dataGood = bufferUpdateCheck(trackerData) & zeroDataCheck(trackerData);
end