Hide/Modify a C3D marker trajectory


I try to run a Gait acquisition, but with a different set of markers than the plugin gait.
I have two internal markers (instead of external) for the knees and also two for the ankles.
My problem is that it works with the ankles makers, but the knees markers have many residuals values set to -1 (maybe the cameras lost signal).
I would like to know if it is possible with Anybody, to calculate the probable trajectory of the marker during this period, and to use it (in other words, to fill in the gaps)?
I would also know how to use the weight function ConstructWeightFunUsingResidualOnOff in such a model?

I attached the folder I’m trying to use, AMMRV1.4 , the 2 markers that are not working are LMNKE and RMNKE.

Thank you very much for your help!

Best regards,


Dear Claude,

In many gait labs the Medial Knee & Ankle markers are only used for a static trial to obtain knee & ankle axis. For the dynamic trial the medial markers are often recorded, but not used, because the subject hides those markers very often with his body. Or, these markers fall of the subject because they might touch during the motion. AnyBody cannot manipulate those trajectory lines. Vicon might actually be able to do that, but you now more about Vicon then us :wink:
In AnyBody, only using the weight function might help for short drop outs.

If you plot the trajectory lines, by turning

in the ModelSetup.any
you can see that the markers drop out (going to zero). It seems to me that those are dropping out for a lot and using the weight function might not work. However, there is a tutorial about using the weight function:

In your case, I suggest that you don’t use the medial markers. The model runs if you out-comment the medial markers in the ModelSetup.any. The model has kinematically enough constraints, even without those two markers.

Let me know if that works for you. I hope I could help.

Thank you for your response.
I tried to run the model with a file modified with vicon, and it indeed works, but I just wanted to know if it was possible to modify it with anybody (so now I have my answer).

In fact I already tried to use the weight function as explained in the tutorial, so I set ConstructWeightFunUsingResidualOnOff = On but, for the second part, I must find where the link between the C3D file and the model is defined, to write the WeightFun . This is my problem: I don’t know where to set it?

Many thanks for your help,


Hi Claude,

When you insert the AnyInputC3D template from the Class Tree you will have to change the following weight function to “ on” as described in the tutorial:

 ConstructWeightFunUsingResidualOnOff = [b]On[/b];

Then include the following command in the CreateMarkerClass.any, or change the existing weight function

   AnyKinDriverMarker Driver =    {

// WeightFun={&.WeightFun};

There is a CreateMarkerClass.any and a CreateMarkerClassTD.any depending on what model you use, you have to edit each (or both).

Thank you for your help!

Best regards,

This works fine, but how do I know which of the 3 CreateMarker*.any is used in the MoCap model?


//Class used for defining a marker
#include "<ANYBODY_PATH_TOOLBOX>/Mocap/CreateMarkerClass.any"
//Class used for defining a marker
#include "<ANYBODY_PATH_TOOLBOX>/Mocap/CreateMarkerClassTD.any"
#include "<ANYBODY_PATH_TOOLBOX>/Mocap/CreateMarkerDriverClass.any"

If I open one of them it says: “Not Loaded”, although the model is loaded.

For now I’ve included to all of them:

// WeightFun={&.WeightFun};

Thanks in advance


If you see the ‘MoCapModel\Input\Markers.any’ file, then you can see the following pieces of code:

[b]CreateMarkerDriver [/b]LPSI ( 
MarkerName= LPSI,
OptX="Off", OptY="Off", OptZ="On",
Model1=MotionAndParameterOptimizationModel, Model2= InverseDynamicModel,
) = {
  sRelOpt ={-0.06727544, -0.03, -0.045};

In the lastest MoCapModel, the class template CreateMarkerDriver is used for all markers.

Then you will be able to figure out which class template file you can try to modify.

I hope this may be helpful to you.

Best regards,