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.me for a more in-depth explanation.

Usage

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

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 abreviated 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?

  • first_last the projection will be created by using the first and the last frame of the recording.

  • first_dist the projection will use the first frame and the frame where the position of the subject is furthest away from the position of the subject in the first frame.

Value

A tibble containig 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 Feb. 1, 2024, 1:49 p.m.