Failed to solve kinematic optimality conditions and hard constraints

Hi,
I am trying the BVH mocap example with my own bvh file and full body model, and I get:

0.1.0) Kinematic analysis...
Progressing to solve kinematic optimality conditions and hard constraints.
Progressing to solve kinematic optimality conditions and hard constraints.
Progressing to solve kinematic optimality conditions and hard constraints.
Progressing to solve kinematic optimality conditions and hard constraints.
Failed to solve kinematic optimality conditions and hard constraints after 5 fallback attemps.
Constraint violations for study 'Main.Studies.MarkerTracking' : 
Constraint #96 is above tolerance 1e-06, error = 0.000002, constr. #3 in 'Main.HumanModel.BodyModel.Right.ShoulderArm.Jnt.HumeroUlnarJoint.Constraints'.
Constraint #394 is above tolerance 1e-06, error = 0.000001, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsThorax.ThoraxSeg'.
Constraint #402 is above tolerance 1e-06, error = 0.000001, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsCervicalSpine.C7Seg'.
Constraint #403 is above tolerance 1e-06, error = 0.000002, segment constr. 'Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Clavicula'.
Constraint #404 is above tolerance 1e-06, error = 0.000002, segment constr. 'Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Scapula'.
Constraint #405 is above tolerance 1e-06, error = 0.000004, segment constr. 'Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Humerus'.
Constraint #406 is above tolerance 1e-06, error = 0.000004, segment constr. 'Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Ulna'.
Constraint #407 is above tolerance 1e-06, error = 0.000001, segment constr. 'Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Radius'.
ERROR(OBJ.MCH.KIN3) :   AnyMocapModel.any(41)  :   MarkerTracking.Kinematics  :  Kinematic analysis failed in time step 23 : Position analysis is not completed

Since it can go through first 22 steps, may be the joints has some limit to perform this movement?
I have searched the forum and didn't find a valid solution.

1. changing the tolerance: already 1e-5,

\AnyBody.7.4.x\AMMR.v2.4.1-Demo\Tools\AnyMoCap\InverseDynamicSettings.any(4) :  Kinematics.KinematicTol=1e-5; 

and I tried to change the 1e-6 config found in "all loaded model files", not working either.

\AnyBody.7.4.x\AMMR.v2.4.1-Demo\Body\AAUHuman\Arm\Muscle.any(55) :     RelTol = 1e-6;
\AnyBody.7.4.x\AMMR.v2.4.1-Demo\Body\AAUHuman\Arm\Muscle.any(1965) :   SPLine.AbsTol=1e-6;

...files does not seem like a config

2. check the movement itself:
How does the 'Constraint' work? I assume they are joint rotation degrees, is there a way to see these limit values and joint real time value (like output pathes)?

Thanks!

/querye

Hi @querye,

Could you post a screenshot of the model when it fails? Is that a movement of lifting an arm by chance? The tolerance should not be a problem.

Kind regards,
Pavel

Hi @pgalibarov ,
The movement bvh file:
013v2.bvh.zip (32.8 KB)

Failed screenshot:

Thanks!

/querye

Hi @querye,

I suspect that the challenge here is the scapula moving quite a lot in this, reaching-like, movement. This leads to violation of default constraints.

You could try to bypass this issue by using the multipoint contact approach using BM_ARM_THORAX_CONTACT statement. Or/and use a soft constraint on the sternoclavicular protraction and elevation. You may need to try using different weight for those soft drivers.

Kind regards,
Pavel

Hi @pgalibarov ,
Setting MULTIPLE_POINT_CONTACT still gets the same error.

I am still learning how to use the system. Could you please explain a bit more about

and

Thanks!

/querye

Hi @querye,

The default mannequin drivers are something that can be added to control certain degrees of freedom using predefined drivers from the mannequin file.

If you look at ammr\Application\MocapExamples\BVH_Xsens\ExtraDrivers.any, you can see these lines of code:

  #define BM_MANNEQUIN_DRIVER_WEAK_SWITCH ON
  
  #define BM_MANNEQUIN_DRIVER_ANKLE_SUBTALAR_EVERSION_RIGHT ON
  #define BM_MANNEQUIN_DRIVER_ANKLE_SUBTALAR_EVERSION_LEFT ON

It means that ankle subtalar eversion on both feet will be controlled by those drivers, and they are "soft" ("weak" switch is ON). "Soft" constraints are used for overdetermined systems and allow some violation based on the weight function assigned. I believe our Tutorials cover this a little.

But for each such default driver you can overwrite the weight function like this, with weight=1 being equal to the marker, you may want to have it slightly higher to ensure that this constraint is fulfilled:

Main.HumanModel.DefaultMannequinDrivers.AnkleDriverRightEversion.Weights.Fun.Value = {10};

The tutorials is a good source to learn from about how things work, as well as searching for relevant keywords in the repository and on the forum - many of the examples have been covered.

Kind regards,
Pavel

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.