Skip to content

Calculate Velocity

Sebastian Kapp edited this page Feb 25, 2021 · 1 revision

calculate_velocity R Documentation


Calculate Velocity

Description

Calculate the velocity of each gaze point (results required for I-VT fixation filter)

Usage

calculate_velocity(data, window_length = 20)

Arguments


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


Format

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

Details

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.

Value

The input data frame with the additional column velocity