-
Notifications
You must be signed in to change notification settings - Fork 4
Calculate Velocity
calculate_velocity R Documentation
Calculate the velocity of each gaze point (results required for I-VT fixation filter)
calculate_velocity(data, window_length = 20)
data
Data frame of the eye tracking data we want to process
window_length
Length of the window over which we want to calculate the velocity
Input data frame columns
gazeHasValue
: Logical (boolean) if there is valid gaze data
eyeDataRelativeTimestamp
: Timestamp of the data
gazeorigin_x
: X coordinates of the gaze origin
gazeorigin_y
: Y coordinates of the gaze origin
gazeorigin_z
: Z coordinates of the gaze origin
gazePoint_x
: X coordinates of the gaze point
gazePoint_y
: Y coordinates of the gaze point
gazePoint_z
: Z coordinates of the gaze point
This is an implementation of the velocity calculation as documented in the Tobii Pro I-VT fixation filter. It first calculates the window size (number of data points) over which the velocity should be calculated based on the specified window length (in ms) and the average time between data points of the first 100 samples. This accommodates data logs with non-uniform time between data points. Then it calculates the velocity for each gaze point by calculating the angle between the first and last gaze point in the current window with the origin of the gaze point in the middle of the window. This angle divided by the window length is saved as the velocity of the middle gaze point.
The default window length of 20ms and the eye tracker rate of the Microsoft HoloLens 2 of 30Hz results in a window size of two and therefore a calculation of the velocity between the previous and current gaze point.
The input data frame with the additional column velocity