MimicMeasure
Measure for how well a simulation mimics data from predefined motion file.
The measure computes the mean squared error (MSE) between the simulated state and the states in a .sto file. Only variables are considered that are part of the model state, which includes DOFs, DOF velocities, muscle activation (*.activation), and muscle fiber length (*.fiber_length) Variables that are derived from the state are not included in the measure.
When using a Hyfydy model with OpenSim state data, make sure to add include_dofs_in_state = 1
to ModelHfd.Example:
# Measure for mimicking 2D gait MimicMeasure { name = Mimic weight = 10000 file = my_data_file.sto include_states = "*.pos.x;*.pos.y;*.ori.z;*.activation" stop_time = 2 threshold = 0.01 average_error_limit = 0.01 activation_error_weight = 0.25 }
Inherits from Measure.
Public Attributes
Parameter | Type | Description |
---|---|---|
file | xo::path | Filename of storage (sto). |
include_states | xo::pattern_matcher | States to include for comparison; default = *. |
exclude_states | xo::pattern_matcher | States to exclude for comparison; default = “”. |
use_best_match | bool | Use only best match instead of average match useful when data contains a single pose; default = false. |
average_error_limit | Real | Average error above which to terminate simulation early (if set to non-zero); default = 0. |
peak_error_limit | Real | Peak error above which to terminate simulation early (if set to non-zero); default = 2 * average_error_limit . |
time_offset | TimeInSeconds | Time in the .sto file to start measuring; default = 0. |
activation_error_weight | Real | weight applied to muscle activation error; default = 1. |
name | String | Name of the Measure, to be used in reporting; defaults to measure type. |
weight | Real | Weighting factor applied to the result of the measure; default = 1. |
threshold | Real | Threshold above / below which the measure becomes zero; default = 0. |
threshold_transition | Real | Transition range above threshold between which the measure linearly decreases to zero; default = 0. |
result_offset | Real | Offset added to measure result; default = 0. |
minimize | bool | Indicate whether this measure should be minimized; default value depends on the measure type (usually true). |
start_time | TimeInSeconds | Time [s] at which Controller becomes active; default = 0. |
stop_time | TimeInSeconds | Time [s] at which Controller becomes inactive; default = until simulation ends. |
signature_prefix | String | Prefix signature with custom string. Special tags: DATE_TIME, DATE_TIME_EXACT, SCONE_VERSION. |
signature_postfix | String | Append custom string to signature. Special tags: DATE_TIME, DATE_TIME_EXACT, SCONE_VERSION. |
signature | String | Set custom signature and omit the auto-generated signature. |
Converted from doxygen using dokugen