The AnyMoCap Framework¶
The AnyMoCap model is an effort to create a simple and unified framework for doing any kind of MoCap analysis with the AnyBody Modeling System.

Making MoCap models the easier¶
Features¶
Adapts to any Mocap protocol
Optimization of marker locations and anthropometrics.
Support Marker based (C3D) and inertial based (BVH) input.
Support for standard force plates: (Types 1-4) plus more.
Easy setup with multiple trials and subjects
Over determinate kinematic analysis¶
Musculoskeletal models that use Motion capture data are different from other types of models found the AMMR. Most importantly, MoCap models usually require an over-determinate kinematic solver to handle the excess in information that the optical markers provide.
The over-determinate solver in AMS works great, but it can only find velocities and accelerations numerically. That has some performance issue when running inverse dynamics analysis. To overcome the problem, the MoCap analysis is split into a two-step procedure, as illustrated on the figure below:

Figure 1: The framework of the AnyMoCap model. Analysis is split into three steps. Parameter identification, Marker tracking, Inverse dynamic analysis.¶
The over determinate kinematic analysis solves the model for positions, and writes joint angles to a a set of files. These joint angles can then be used with the determinate kinematic solver in the inverse dynamic analysis.
See also
The AnyBody tutorials, and the lesson on using the AnyMoCap model
AnyMoCap examples¶
The following gallery shows different examples using the AnyMoCap framework.
Note
The Multi trial MoCap model is likely the best starting point when working with many trials/subjects from a MoCap experiment.
Get started¶
The easiest way to get started, is to adapt one the example application above.
A typical application using the AnyMoCap framework will look something like this:
1 2 3 4 5 6 7 8 | #include "../libdef.any" #path MOCAP_TRIAL_SPECIFIC_DATA "TrialSpecificData.any" #path MOCAP_SUBJECT_SPECIFIC_DATA "SubjectSpecificData.any" #path MOCAP_LAB_SPECIFIC_DATA "LabSpecificData.any" // Include the AnyMoCap Framwork #include "<ANYMOCAP_MODEL>" |
You can place this main file anywhere on your computer as long the
libdef.any
file points to model repository (AMMR) you want to use.
Caution
It is recommended not to place working models inside the AMMR folder. Copy the example elsewhere before using.
Model structure¶
When loading the AnyMoCap model the following layout shows up in the model tree:

Description of Model folders¶
Folder name |
Description |
---|---|
|
Contains contains all the machinery of the AnyMoCap Frame. |
|
Contain the Human model used. This is constructed automatically by the AnyMoCap framework. |
|
Contains the model parts which are not part of the Human model. (e.g. force plate and environment) |
|
Contains the three studies |
|
Contains visual and color settings for the model. |
|
Operation to run the Parameter Identification study and save the results. |
|
Operation to 1. load the optimized parameters (scaling and marker positions), 2. run marker tracking and finally 3. run inverse dynamics analysis, 4. save results to and HDF5 file for later replay. |
|
This loads any previously saved data and starts the replay operation. |
Options and settings¶
The Main.ModelSetup
folder contains the main machinery of the AnyMoCap
framework. It is controlled by a number of settings both #define
/#path
switches
and variables which can be set directly. For example:
#define MOCAP_INPUT_DATA_TYPE "C3D"
Main.ModelSetup.TrialSpecificData.LastFrame = 240;
The following two sections gives an overview of the settings available:
Paths settings and switches¶
Path settings and switches are usually prefixed by MOCAP_
to indicate that
they are specific to the AnyMoCap framework.
Settings |
Description |
Default |
---|---|---|
|
Path to a file with trial specific data. This file is include within the
|
None |
|
Path to a file with subject/session specific data. This file is include within the
|
None |
|
Path to a file with laboratory specific data (i.e. data common for the whole model or
experimental setup. This file is include within the |
None |
|
A file with setting for the C3D file. |
None |
|
A file with setting for the C3D file. |
None |
|
A file with user defined extra drivers. Additional drivers are useful/necessary
in some cases where the marker protocol doesn’t provide enough information
to specify all degrees of freedom. Hence, these drivers complement a
specific driver protocol. This file is included in |
None |
|
A file with the definition of the marker protocol.
This file is included in |
None |
|
A file with the body model configuration. |
None |
|
A file with the definition of the force plates. |
None |
|
Path to folder where C3D files are stored. |
Main file directory |
|
Path to the AnyMoCap framework. |
The AnyMoCap implementation in the AMMR |
|
Path to where output files are saved. |
The main file directory |
|
Path to where temporary files are saved (joint angles etc.) |
|
Setting |
Description |
Default value |
---|---|---|
|
Data type (“C3D”, “BVH”) used by the AnyMoCap application. |
“C3D” |
|
Setting for creating the |
ON |
|
Prefix added to all output files from the model. |
“” |
|
Prefix for the parameter identfication files. Can be usefull to set explicitly in special cases where subjects share a common parameter file. |
|
|
Switch to indicate that the model uses Ground Reaction Force (GRF) prediction. It will ensure that the AnyMoCap framework uses the appropriate settings. (e.g. recruited actuators as weak residuals on the pelvis. |
OFF |
|
Switch to enable extra low pass filtering of the output from the Marker tracking. Useful in some cases where other drivers (e.g. joint limits) cause high accelerations in the output from Marker tracking. |
OFF |
|
Switch hide the upper body (Thorax, neck, arms and skull). |
OFF |
|
The type of Human Ground residuals (Hand of God) used. Possible values are “Pelvis”, “Thorax”, “PelvisWeak”. “PelvisWeak” is default when using GRF prediction. |
“Pelvis” |
Configurable variables¶
The Main.ModelSetup
folder contains all the machinery of the AnyMoCap
framework. It has three important subfolder (TrialSpecificData
,
SubjectSpecificData
and LabSpecificData
).

These three folders contain variables specific to the application but also has a few variables which can be assigned directly by the user.¶
|
Description |
Default value |
---|---|---|
|
Name of the current trial. This is usually used for naming output files and locating the input c3d files (c3d filename without the extension) |
Name of the main-file directory |
|
List of trial names from which the scaling and optimized marker postions are loaded from. |
|
|
First frame of the C3D/BVH file to use as starting frame in the analysis |
First frame in the C3D/BVH file |
|
The last frame of the C3D/BVH file to use in the analysis |
Last frame in the C3D/BVH |
|
Specifies the start time of the analysis. Setting this overides |
Calculated based on |
|
Specifies the end time of the analysis. Setting this overides |
Calculated based on |
|
Number of time steps used in the analysis. (Note that the number of time-steps in the inverse dynamic analysis will be 4 less than this values) |
Calculate based on |
|
Description |
Default value |
---|---|---|
|
Specifies the gravity vector in global reference frame. |
|
|
Folder with filter settings used for markers and analog (force) data. |
|
|
The lowpass cutoff frequency used for the marker data. |
|
|
The filter order used when low pass filtering the marker data. Note: Since the filter is applied as a zero phase filter (filtfilt or forward/backward filter) the effective filter order is the double of this value. |
|
|
The lowpass cutoff frequency used for the force/analog data. |
|
|
The filter order used when low pass filtering the force/analog data. Note: Since the filter is applied as a zero phase filter (filtfilt or forward/backward filter) the effective filter order is the double of this value. |
|
More resources¶
This section contains further documentation on the AnyMoCap framework.