Description Usage Arguments Value Examples
This procedure detects highest differences between reference and input mocap recording. Analysis goes as follows:
Perform DTW on x1 and x2 from list at index 1. Plot DTW alignment This alignment will be used in aligning all other signals. Plot distance between x1 and x2 after alignment and find local maxima in this plot. In following analysis only maxima with relative value above threshold will be used.
perform DTW alignment for each other element from the data.configuration list, however use the alignment function from first step. Maxima are detected in the same procedure as above, however we take into account only those of them, that are close enough to maxima from first step of analysis.
1 2 | analyze.mocap(data.configuration, ref.d = NULL, in.d = NULL,
extremumthreshold = 0.66, smoothSize = 0.1)
|
data.configuration |
a list containing configuration for the algorithm. Each element of the list is a list with following elements (all elements are obligatory):
|
ref.d |
data frame with reference mocap data (default is ref.d=NULL). It is used to get joints relations while plotting RGL plot. |
in.d |
data frame with reference mocap data (default is in.d=NULL). It is used to get joints relations while plotting RGL plot. |
extremumthreshold |
threshold from range [0,1], that is used to remove local extreme, which relative value is below extremumthreshold (default value is extremumthreshold=0.66). |
smoothSize |
size of the Gaussian smoothing window. Default value is smoothSize = 0.1. |
a list containing data.configuration parameters plus algorihm results
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | ########################
#analyze upper body data
########################
data(right.arm.motion.1)
data(right.arm.motion.2)
refdata <- right.arm.motion.1$data.frame
inputdata <- right.arm.motion.2$data.frame
extremumthreshold <- 0.66
smoothSize <- 0.1
inputdataalignment <- rotatedata(inputdata, refdata, "LeftShoulder","RightShoulder")
inputdataalignmentkinematic <- calculate.kinematic(inputdataalignment, bodypartname = "LeftShoulder")
refdatakinematic <- calculate.kinematic(refdata, bodypartname = "LeftShoulder")
inputdataalignmentkinematic <- aligninputandrefdata(inputdataalignmentkinematic, refdatakinematic, limbname = "LeftShoulder")
data.configuration <- list()
data.configuration[[1]] <- list(x1 = vector.to.list(refdatakinematic, "RightHand"),
x2 = vector.to.list(inputdataalignmentkinematic, "RightHand"),
FUN = euc.dist,
ylab = "Distance [cm]",
legend = "RightHand",
plotRGL = "RightHand",
skeleton = right.arm.motion.1)
data.configuration[[2]] <- list(x1 = vector.to.angles.list(refdatakinematic, "RightShoulder", "RightArm", "RightForearm"),
x2 = vector.to.angles.list(inputdataalignmentkinematic, "RightShoulder", "RightArm", "RightForearm"),
FUN = euc.dist1d,
ylab = "Angle [rad]",
legend = "Right elbow",
plotRGL = NULL,
skeleton = NULL)
x1 <- vector.to.angles.frame.list(refdatakinematic, "RightArm", "RightForearm", "RightShoulder", "LeftShoulder")
x2 <- vector.to.angles.frame.list(inputdataalignmentkinematic, "RightArm", "RightForearm", "RightShoulder", "LeftShoulder")
data.configuration[[3]] <- list(x1 = x1[[1]],
x2 = x2[[1]],
FUN = euc.dist1d,
ylab = "Angle [rad]",
legend = "X angle between RightArm and RightForearm",
plotRGL = NULL,
skeleton = NULL)
data.configuration[[4]] <- list(x1 = x1[[2]],
x2 = x2[[2]],
FUN = euc.dist1d,
ylab = "Angle [rad]",
legend = "Y angle between RightArm and RightForearm",
plotRGL = NULL,
skeleton = NULL)
data.configuration[[5]] <- list(x1 = x1[[3]],
x2 = x2[[3]],
FUN = euc.dist1d,
ylab = "Angle [rad]",
legend = "Z angle between RightArm and RightForearm",
plotRGL = NULL,
skeleton = NULL)
res <- analyze.mocap(data.configuration,
refdatakinematic,
inputdataalignmentkinematic,
extremumthreshold,
smoothSize)
########################
#analyze lower body data
########################
data(mawashi.geri.left.1)
data(mawashi.geri.left.2)
refdata <- mawashi.geri.left.1$data.frame
inputdata <- mawashi.geri.left.2$data.frame
extremumthreshold <- 0.66
smoothSize <- 0.1
inputdataalignment <- rotatedata(inputdata, refdata, "LeftThigh","RightThigh")
inputdataalignmentkinematic <- calculate.kinematic(inputdataalignment, bodypartname = "RightFoot")
refdatakinematic <- calculate.kinematic(refdata, bodypartname = "RightFoot")
inputdataalignmentkinematic <- aligninputandrefdata(inputdataalignmentkinematic, refdatakinematic, limbname = "RightFoot")
data.configuration <- list()
data.configuration[[1]] <- list(x1 = vector.to.list(refdatakinematic, "LeftFoot"),
x2 = vector.to.list(inputdataalignmentkinematic, "LeftFoot"),
FUN = euc.dist,
ylab = "Distance [cm]",
legend = "LeftFoot",
plotRGL = "LeftFoot",
skeleton = mawashi.geri.left.1)
data.configuration[[2]] <- list(x1 = vector.to.angles.list(refdatakinematic, "LeftThigh", "LeftLeg", "LeftFoot"),
x2 = vector.to.angles.list(inputdataalignmentkinematic, "LeftThigh", "LeftLeg", "LeftFoot"),
FUN = euc.dist1d,
ylab = "Angle [rad]",
legend = "Left knee",
plotRGL = NULL)
x1 <- vector.to.angles.frame.list(refdatakinematic, "LeftThigh", "LeftLeg", "LeftThigh","RightThigh")
x2 <- vector.to.angles.frame.list(inputdataalignmentkinematic, "LeftThigh", "LeftLeg", "LeftThigh","RightThigh")
data.configuration[[3]] <- list(x1 = x1[[1]],
x2 = x2[[1]],
FUN = euc.dist1d,
ylab = "Angle [rad]",
legend = "X angle between LeftThigh and LeftLeg",
plotRGL = NULL)
data.configuration[[4]] <- list(x1 = x1[[2]],
x2 = x2[[2]],
FUN = euc.dist1d,
ylab = "Angle [rad]",
legend = "Y angle between LeftThigh and LeftLeg",
plotRGL = NULL)
data.configuration[[5]] <- list(x1 = x1[[3]],
x2 = x2[[3]],
FUN = euc.dist1d,
ylab = "Angle [rad]",
legend = "Z angle between LeftThigh and LeftLeg",
plotRGL = NULL)
res <- analyze.mocap(data.configuration,
refdatakinematic,
inputdataalignmentkinematic,
extremumthreshold,
smoothSize)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.