Running anygait fullbody

i’m using AnyBody version : 5. 3. 0. 3365 and i’v got some problems with the anygait fullbody. so here are my questions:

  1. How important are the anthropometric data? if i change 1 do i have to change all?

  2. How can i put new markers in. plug in gait is only valid for sagittal plan.

  3. i placed markers very precisely but especially at the wrist they are far away (blue and red) from where they should be.

  4. very often i get this error:

Macro command : RunMotionAndParameterOptimizationSequence(1:1)> run

1.0.0) Operation Sequence: (Operation: Main.Studies.ParameterIdentification.Analysis): Kinematics (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics): PreOperation (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics.PreOperation): InitialConditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.InitialConditions): …Design variables have been updated. …Load-time positions have been re-established.
Failed to resolve kinematic constraints. Newton relaxation too small. (final kin. error = 1.351528E-001)
Constraint no. 14 above error tolerance 0.001000, error = 0.003205.
Constraint no. 15 above error tolerance 0.001000, error = 0.005708.
Constraint no. 16 above error tolerance 0.001000, error = 0.002673.
Constraint no. 19 above error tolerance 0.001000, error = 0.001295.

and so on…

Constraint no. 583 above error tolerance 0.001000, error = 0.010714.
Constraint no. #4 in ‘Main.Studies.HumanModel.BodyModel.Right.ShoulderArm.Jnt.WristJointFlexion.Constraints’ above error tolerance 0.001000, error = 0.001668.
Constraint no. #0 in ‘Main.Studies.HumanModel.BodyModel.Left.ShoulderArm.Mus.ArtificialRake.LinCombDrv’ above error tolerance 0.001000, error = 0.025099.
Constraint no. #1 in ‘Main.Studies.HumanModel.BodyModel.Left.ShoulderArm.Mus.ArtificialRake.LinCombDrv’ above error tolerance 0.001000, error = 0.035954.
Constraint no. #2 in ‘Main.Studies.HumanModel.BodyModel.Left.ShoulderArm.Mus.ArtificialRake.LinCombDrv’ above error tolerance 0.001000, error = 0.002087.
Constraint no. #0 in ‘Main.Studies.HumanModel.BodyModel.Left.ShoulderArm.Jnt.ACLinCon’ above error tolerance 0.001000, error = 0.009843.

and so on…

Constraint no. #0 in ‘Main.Studies.KinematicStudyForParameterIdentification.ModelEnvironmentConnection.Drivers.SCDriverRight’ above error tolerance 0.000001, error = 0.000298.
ERROR(OBJ.MCH.KIN3) : F:/An…s/A…o/A…n/G…o/GaitFullBody.main.any : MotionOptimization.InitialConditions : Kinematic analysis failed in time step 0

how can i fix it?

  1. i read something about static trials. do i need them? and what for? i thought the optimization would run with the dynamic trial as well. i’m measuring with vicon…

  2. Can i run anygait fullbody if i measured the locomotion in an orthogonal direction to normal running direction?

I know these are lots of differt questions. I would be VERY happy if someone takes his time to answer them.

Best regards


Hi Johannes,

I assume you are talking about GaitFullBody, because there is no AnyGait FullBody. I recommend that you go through following Wiki page, it will/should explain a lot:

  1. Anthropometrics are a initial guess and will be optimized when Optimization “On” (see WIKI)

  2. In the marker.any (description see WIKI)

  3. you can change/adapt the sRel values in the markers (see WIKI)

  4. It might be the initial position that is not exact anough, and the model cannot place the body-model, in Trialspecific (see WIKI)

  5. Only for AnyGait; different model

  6. dont understand this one…

I hope that’s good enough for the start.

Thanks Amir that helped a lot.

For changing the rel position of the markers i do need to see the segment frames. where can i switch them ON in the gaitfullbody? Is there maybe a way i can just load the sceleton to check the marker position or do i always have to load the hole model?

Do i get the following right? marker optimization OFF is good for bony landmarks which i am sure about i place them right and optimization ON is for markers i placed on soft tissue?

Best regards,

Hi Johannes,

currently there is no easy swith to show the ref frames in AnyBody. Best thing in my opinion is to include following code into the segment section:

AnyDrawRefFrame DrawFrame = {
ScaleXYZ = 0.1*{1,1,1};
RGB ={0,0,1};

In order to find the sgement section open the model tree to the left and double click on the segment in the modelview. It will jump to the segment in the model tree. Right click there and choose locate in script. Ther might be a ref frame already defined but out-commented…

in principle you are right with the soft-tissue vs on-bones markers, but too many optimizations on will slow the model down and might make it difficult to solve. Another option is the weight function. If you are very sure about the position of the marker, you can increase the weight function (default 1 to 5); if it is difficult decrease it to 0.1!

Thanks for the quick response!!
Some trials are running realy smooth now, some (same person, same markerset, just another trial) fail at the first time step of the parameter optimization. earlier you wrote that problem could be due to the initial position. but the initial position an the beginning of different trials will always be a bit different (biological system, human movement). i have hundrets of running trials and can not always change the initial position in the model for each trial…that would be kind of ineffectiv. is there an option to calculate the initila position before and use it as an input for the model? of how would you solve this problem?

another question: is there an oportunity to use the gaitlowerextremity without sternum and clav? (i have c7 and both shoulders)

best regards

Hi Johannes,

what is the goal of your project? If you need only lower extremity results it is a lot quicker and easier for the model to solve. Arms make it much tougher for initial positioning and also to run inverse (time wise).

You can use GaitLowerExtr and then in/out-comment the markers that you have or not have. Str and C7 should work without any problem. Shoulders are attached to the arm, so you might have to change it to the thorax as well in the ModelSetup.any:



and adapt the position of sRel.

For the trouble wiht the initial positioning? How good is the quality of your C3D’s? Do you have markers dropping out?

Hi Amir,
thanks for your response. I’m working on different projects at the moment and i’m figuring out how helpfull anybody can be. In the meantime i got the lower extremity running, beside some scaling problems at the spine everything runs ok.

I still have bigger problems with my fullbody setup. i captured volleyball movements (arms over head) and that seems to be quiet difficult get to work smooth. sometimes i have problems with initial position, sometime the kinematic optimization stops just in the the middle of the trial. i have a good quality of vicon c3d-files and no marker dropping out. i checked everything double. should i change the max. kin error? and how? how would you solve the problem with the initial condition (obviously in 100 trials there will always be light differences). is the direction of movement in the measuring volume relevant for getting the optimization to run?

Best regards, and thanks alot for your help!

Hi Johannes,

Regarding your second question, I would suggest some opinions.

  1. In the ‘MotionAndParameterOptimizationModel’ process, the GaitFullBody model has three studies:
    ‘KinematicStudyForParameterIdentification’ , ‘ParameterIdentification’, ‘MotionOptimization’
    Usually you don’t need to touch the last MotionOptimization study.
    In the KinematicStudyForParameterIdentification, you can try to change some settings.
    For instance, you can try this:
nStep = floor(Main.TrialSpecificData.nStep/[b]3[/b]); 
InitialConditions.MaxIteration = [b]20000[/b];
Kinematics.MaxIteration = [b]20000[/b];

So compared to our original model in the repository, your model will use bigger nStep values.
And the next lines will make your AnyBodyStudy class to allow bigger tolerance and bigger maximum iteration steps. But please don’t use too big values for these ‘KinematicTol’ values because it does not make sense.
I’m not recommending you any specific values for these settings. But this may be able to change your model.

  1. As you pointed out, sometimes AMMR human model may have some issues if the arm locations are over head.
    In the ‘BodyPartsSetup2.any’ and ‘BodyPartsSetup.any’ files, you can enable the shoulder rhythm options like this:
#define LEFT_SHOULDER_RHYTHM [b]1[/b] 
#define RIGHT_SHOULDER_RHYTHM [b]1[/b]

Then you may have to disable the SCDrivers in the ‘ExtraDrivers.any’ file to reduce the number of constraints regarding the shoulder area.
Also, in the ‘ModelSetup.any’ file, you can adjust the weight factors of markers in the use of CreateMarker and CreateMarkerTD class templates.
I would try to use smaller values for the markers around the shoulder. Of course I’m not sure.

  1. Regarding the initial position, we usually change the initial position values in the ‘TrialSpecificData.any’ file.
    Then ‘Mannequin.any’ file will read those values.
    But if you see the ‘Mannequin.any’ file, the pelvis PosX, PosY and PosZ will be determined by markers.
    So if you can make your own code which determines the initial position values by markers like this,
    then you may not need to input the initial position values for all individual trials.

I hope that this suggestions may be helpful to you.
And also I hope that you might understand the contents of our wiki page already:

Best regards,

Thanks Moonki,
that help a lot. Got some trials running smoothly. Now i got another problem:
Some trials start the movement in negative x direction of the global coordinate system. Trials in positve direction run smooth but the ones in negative direction don’t. Startposition always looks weard. How would you solve this problem? The athlets participating in my study run in both directions. Befor i did not think that would be a problem.

Best regards


you can turn the body model around for the initial position by changing the

AnyVar PelvisRotZ = 0;
AnyVar PelvisRotY = 0;
AnyVar PelvisRotX = 0;

in the trialspecific file. depending on your Global Reference system make one value to 180.

Hey Amir,
worked out perfectly. Thank you very much. Sometimes it can be so simple…!

Best regards,