Description Usage Arguments Value Examples
This heuristic method is especially usable while dealing with data acquired by IMU (Inertial measurement unit) sensors. There are two possible calls of this method. The first one utilize acceleration data of body joints (.ax, .ay and .az columns). If this data is available method can calculate displacement of long motion, during which an actor uses both left and right leg. If this call is used, one should left bodypartname as NULL. The second call is used when we are dealing with data without acceleration data and actor has one stationary limb. In this case bodypartname should have value of the limb which does not translate during motion.
1 2 | calculate.kinematic(dd, LeftFoot = "LeftFoot", RightFoot = "RightFoot",
show.plot = FALSE, plot.title = "", bodypartname = NULL, dyEps = 5)
|
dd |
data frame with motion capture data. |
LeftFoot |
name of the column with data that holds coordinates of left foot (joint that touch the ground). Default value is LeftFoot = "LeftFoot". Used only for the first type of call. |
RightFoot |
name of the column with data that holds coordinates of right foot (joint that touch the ground). Default value is RightFoot = "RightFoot". Used only for the first type of call. |
show.plot |
if TRUE (default is show.plot = FALSE) plots results of an algorithm. |
plot.title |
part of the title over plots. |
bodypartname |
if not NULL value the stationary joint of the motion is column with bodypartname. Default value is bodypartname = NULL. |
dyEps |
Threshold value for translation calculation (used only for the first type of call). Default value is dyEps = 5. |
Data frame, which has Dxzy columns updated. All other columns are not updated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #This example uses acceleration data to calculates correct displacement.
#header of mocap file
data("header.mocap")
#data frame with displacements and acceleration data
data("heian.shodan")
heian.shodan.corrected <- calculate.kinematic(heian.shodan, show.plot = "TRUE", plot.title = "Heian Shodan")
original.bvh <- set.data.frame(header.mocap, heian.shodan)
corrected.bvh <- set.data.frame(header.mocap, heian.shodan.corrected)
#plot BVH, red is original data, green is corrected
plot(original.bvh, frames.fraction = 0.1, my.color = "red", alpha = 0.1, spheres = FALSE)
plot(corrected.bvh, frames.fraction = 0.1, my.color = "green", alpha = 0.1, spheres = FALSE, append = TRUE)
#writing BVH to disk
write.bvh(original.bvh, "original.bvh")
write.bvh(corrected.bvh, "corrected.bvh")
#This example uses single body joint which coordinates should be constant during motion
data(mawashi.geri.left.1)
plot(mawashi.geri.left.1, frames.fraction = 0.1, my.color = "red", alpha = 0.5, spheres = FALSE)
mawashi.geri.left.1$data.frame <- calculate.kinematic(mawashi.geri.left.1$data.frame, bodypartname = "RightFoot")
plot(mawashi.geri.left.1, frames.fraction = 0.1, my.color = "green", alpha = 0.5, spheres = FALSE, append = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.