Read motion-capture files with automatic format detection
Source:R/user-onboarding.R
readMoCapAuto.RdChooses a reader based on file extension and returns a PhysioExperiment.
This is designed for first-time users who want one entry point for common
MoCap formats.
Usage
readMoCapAuto(
path,
format = c("auto", "csv", "c3d", "trc", "bvh", "amc"),
sampling_rate = NULL,
sep = ",",
header_rows = 1L,
skip = 0L,
include_analog = FALSE,
asf = NULL,
fps = 120
)Arguments
- path
Path to a motion-capture file.
- format
Reader format.
"auto"detects from extension (.c3d,.trc,.csv,.tsv,.bvh,.amc).- sampling_rate
Sampling rate for CSV files when not inferable.
- sep
Delimiter used for CSV/TSV files.
- header_rows
Number of header rows for CSV/TSV.
- skip
Number of lines to skip before data for CSV/TSV.
- include_analog
Logical; passed to
readC3D().- asf
Optional ASF skeleton for AMC files. Either an
ASFSkeletonobject or a path to an.asffile.- fps
Frame rate for AMC files.
References
Winter DA (2009). "Biomechanics and Motor Control of Human Movement." 4th ed. John Wiley & Sons.
See also
readMoCapCSV() for CSV/TSV motion capture data,
readASF() and readAMC() for Acclaim skeleton and motion files,
assessMoCapReadiness() for data quality assessment.
Examples
trc_file <- system.file("testdata", "sample.trc", package = "PhysioMoCap")
if (nzchar(trc_file)) {
pe <- readMoCapAuto(trc_file)
pe
}
#> class: PhysioExperiment
#> dim: 5 x 2
#> assays(3): position_x, position_y, position_z
#> samplingRate: 120 Hz
#> channels(2): RASI, LASI
#> colData names(2): label, type