project_single_joint_to_MP: project_single_joint_to_MP()

View source: R/projection_functions.R

project_single_joint_to_MPR Documentation

project_single_joint_to_MP()

Description

project_single_joint_to_MP() projects the global joint center positions of a single joint onto the movement planes (MP). MP is calculated by first creating a direction going from the position of the hip joint centers at the first frame to the position of the hip joint centers at the last frame.
Please see the GitHub README.md for a more in-depth explanation.

Usage

project_single_joint_to_MP(
  .data,
  Y,
  X,
  Z,
  New_Name = "New",
  .method = "first_last",
  distance_threshold = 2
)

Arguments

.data

A tibble containing the global 3D positions of the joint given in the parameters X, Y, Z and the 3D positions of both hip joints.

Y

The name of the global Y coordinate column (up direction) of the joint you wish to project to the movement plane

X

The name of the global X coordinate column of the joint you wish to project to the movement plane

Z

The name of the global Z coordinate column of the joint you wish to project to the movement plane

New_Name

The abbreviated name of the new joint, the name of the returned variables will start with the value given in New_Name

.method

Must be one of c("first_last", "first_dist").
What method shall be used to create the projection?

distance_threshold

Used only when .method = "first_last". If the distance between first and last frame is much shorter than the max distance from the first frame, a warning will be given. Default is 2.

Value

A tibble containing three columns with coordinates in the forward, up, and right direction. The variables are named '"New_Name"_MPF', '"New_Name"_MPU' and '"New_Name"_MPR'

Examples

df <- dplyr::filter(mocapr::mocapr_data, movement_nr == 1)
project_single_joint_to_MP(df, Y=LSY, X=LSX, Z=LSZ, New_Name = "LS")

steenharsted/mocapr documentation built on June 10, 2025, 11:55 a.m.