Hi there,
I am working on a set of motion capture data which present some occasional gaps in the markers' coordinates, and I don't have any information on markers residuals.
I have the markers trajectories stored as csv files, and I am building my own c3d files in order to use the standard AnyMoCap workflow. For each marker in the c3d file, I'm setting the residual to 0 when the measurement is valid, and to -1 when the marker drops out.
I would like to understand more in details how the specific settings in AMS can deal with markers drop-outs and residuals.
-
In MOCAP_C3DSETTINGS "C3DSettings.any", I can set GapFillUsingResidualsOnOff = On/Off;
-
In the MOCAP_MARKER_PROTOCOL_FILE I can create specific drivers for each marker with the option UseC3DWeightResiduals = On/Off.
What's the intended use of these two parameters?
For GapFillUsingResidualsOnOff I couldn't find any documentation.
I tested it out for a few different c3d files, and if it's turned OFF, the marker tracking fails whenever there's any gap (short or long) at any point in any of the markers. The simulation will run successfully only if there are no gaps in the markers at all.
When it's turned ON, the simulations run even if there are certain gaps in the marker data, as long as they are not in the first frame of the trial.
From what I understood it fills the gaps already when reading the input (e.g. Main.ModelSetup.C3DFileData.Points.Markers.*.Pos)
But what kind of filling does it do exactly?
For UseC3DWeightResiduals I found some information in the AMMR changelog:
All MoCap model examples now use the option (UseC3DWeightResiduals=ON) in the marker protocols. This ensures that the marker weights are reduced to zero when a marker drops out
(i.e. when the residual value in the C3D file becomes negative).
If I leave UseC3DWeightResiduals=ON in my application, this causes some sudden accelerations of the foot segment when the heel marker drops out, leading to sudden peak in the predicted forces throughout the lower limb.
When I turn UseC3DWeightResiduals=OFF, the sudden accelerations of the foot and associate force errors do not occur.
My theory at the moment is that when the weight of the heel marker driver is suddenly set to zero, the tracking of the foot is driven only by the remaining markers on the hindfoot, which are generally less precise and were therefore manually assigned a lower weight until that time point. The lower weights on these markers meant that there was a larger tolerance between the virtual and the actual positions of these markers up until that point. In other words, when the heel marker drops out, the position of these markers is not perfectly consistent with the kinematic tracking that was done up to that point, and this causes a jump when the foot is suddenly being driven by this new set of markers.
In general, I would like to ask you what is the best approach for dealing with markers data.
I assume that filling short gaps prior to run the analysis in AMS is always advisable.
For any longer gaps, the issue is not so trivial.
On one hand we could just fill the gap anyway, and trust the fact that this artificial data points are realistic (very motion- and marker-dependent, not universally applicable);
or we could switch the markers drivers temporarily off with the weighing function, hoping that there are no kinematic inconsistencies in the transitions (but they can occur, as reported above);
or we could just exclude the specific markers from the whole trial, although this seems not ideal, as we would "waste" meaningful and accurate information for rest of the trial.
Is there any way we can make the best out of all the marker data we have, without excluding certain markers entirely and without causing these inconsistencies?
Did anyone ever tried a different function instead of AnyFunSquareWave to set up the markers' weights? I'm wondering if something smoother before and after the marker dropout would solve some of the kinematic inconsistencies, while preserving all the meaningful information away from the gap.
And re the residuals' values actually needed for this? Or is the CreateMarkerDriver class only checking if they are negative? This would confirm that I'm building my c3d files correctly.
Thanks for the help!
Enrico