rotatedata: This function align two data frames that contains mocap data.

Description Usage Arguments Value Examples

Description

Both data frames need to have two common column groups with names ending Dx and Dz. This function calculates vector vv = v1-v2 for both data frames (vv.m for mydata and vv.ref for referencedata) and rotates mydata around Y axis in order to minimize euclidean distance between vv.m and vv.ref. Minimization is made with simplex method. After this procedure mydata face the same direction as referencdata. This procedure works correctly only if root joint of mocap is stationary.

Usage

1
rotatedata(mydata, referencedata, v1, v2)

Arguments

mydata

input data frame with mocap data to be algined to referencedata.

referencedata

reference data frame with mocap data.

v1

name of the first body joint.

v2

name of the second body joint.

Value

mydata rotated by Y axis so that mydata and referencedata faces same direction.

Examples

1
2
3
4
5
6
data(mawashi.geri.left.1)
data(mawashi.geri.left.2)
refdata <- mawashi.geri.left.1$data.frame
inputdata <- mawashi.geri.left.2$data.frame
#after following function inputdata and refdata are alignined towards vector LeftThigh - RightThigh
inputdataalignment <- rotatedata(inputdata, refdata, "LeftThigh","RightThigh")

browarsoftware/RMoCap documentation built on May 16, 2019, 7:28 a.m.