This function extracts the resulting displacement from a movement tibble, either in the horizontal plane or in 3D

extract_displacement(
  df,
  min_time = min(df$time, na.rm = TRUE),
  max_time = max(df$time, na.rm = TRUE),
  dimension = "2D"
)

Arguments

df

A movement data frame. Expected columns are pos_x, pos_y, pos_z

min_time

minimum time in s (default: trial start)

max_time

maximum time in s (default: trial end)

dimension

"2D" (default, in horizontal plane only) or "3D"

Details

NOTE: to avoid an impact of tracker glitches, data are resampled at default rate of 10 Hz and median-smoothed over 3 data points (300 ms).