AMMR4 beta Kinematic analysis failed

Hello team!
I have been using the AMMR4 beta repository in AnyBody 8. I have some data in .c3d format and I am running the template "Plug-in-gait_Simple", but adding to the main the line:
#define BM_TRUNK_THORACIC_MODEL_THORACIC_MODEL_FLEXIBLE_
to activate/use the new thoracic flex model. Althought I was able to run some of the models, a couple of days ago, I keep receiving the next Error:

ERROR(OBJ.MCH.KIN3) : KinematicStudyForParameterIdentification.any(11) : KinematicStudyForParameterIdentification.Kinematics : Kinematic analysis failed in time step 8 : Position analysis is not completed
0.1.0.0.8) ...Kinematic analysis terminated

I have attached a screenshot of the full error. What is interesting is that I previously ran those same .C3D files in an older AnyBody version without issues. But now, I am not sure what I am missing when adapting or working on the AMMR4 beta.

I appreciate any suggestions about how to correct the error.
Thank you
Maria Prado.

Dear Maria,

We have a MOCAP example model for flexible thorax, which can be also used for scoliosis models. It can be found in Application\MocapExamples\Plug-in-gait_FlexibleThorax. However it need a C3D file as an input and due to data protection, we could not make our data public yet. In this model, we have excluded the arms.

But it seems that you found the example :slight_smile:
The model will work with this marker config without any change.

You can also use the old marker set (without extra markers on spine) and it will work fine. You just need some modifications:

  1. When you set the flexible_thorax, it will use the flexible thorax marker protocol. So you need to change it back to old marker protocol (in the LabSpecificData.any file).
  2. You need to exclude the arms markers in the marker protocol.

Some brief explanation of the model:
The model has Spine rhythms, which is included by BM_TRUNK_LUMBAR_RHYTHM, BM_TRUNK_THORACIC_RHYTHM, and BM_TRUNK_CERVICAL_RHYTHM that are kinematic constraints for the spine, which all of them are soft constraints to be able to solve the kinematics together with markers. That is why it can solve the spine kinematics without any markers on it. However it may be not necessary to use flexible thorax when you do not have markers on the thoracic spine and ribcage.

Further explanation if you want to use the model for scoliotic postures:
The model has all the rhythms included, albeit with a very small weight in lateral and flexion-extension directions. The reason is that the model is created for a scoliotic posture modelling, but since the single markers cannot provide axial rotation, we have to have a big enough weight in axial rotation. You can see the code in AnyMocapModel.any. However, the model also works with weight=1 for all the rhythms for healthy subjects.

Best regards,
Hamed

1 Like

Hello Hamed,

Following this latest answer and one from another entrance in the forum about scoliosis, I am having some conflicts with understanding the logic of work.

I shifted OFF the lumbar and thoracic rhythms and created drivers into JointsLumbar.any and ThoraxLumbar.any, respectively. In this new driver, I assigned a position (DriverPos), an angle to generate a curvature for scoliosis. With this approach, I am not using the ScoliosisRhythmDriver.any, which is not clear to me if I should use it simultaneously and also change the angles in that AnyScript.

Also, I assumed the rib would require constraints when the rhythms are OFF. Could you please, confirm this to me? I found "RibConstraints.any" but again, I am not sure if I should create drivers here.

Any extra information would be highly appreciated.

Thanks. Maria

Hello Maria,

First of all, no change needed for the rib constraints and you do not need to change anything in the "RibConstraints.any". When you drive the spine posture, the ribcage will follow :slightly_smiling_face:
About the spine drivers, you do not need to use ScoliosisRhythmDriver.any if you define drivers for the spine joints. It is actually doing the same thing.

I think the best way is to find the Thoracic.main in the example model, remove the rhythms and add the joint drivers and make sure that the kinematics can run. Then you are ready to deal with MOCAP.

Note that what I explained in the before is that you can use the rhythms when you do not run scoliotic postures. This way, you do not need to define the joint drivers. So the only things that are needed to change to make it work are listed above. And then it should work. However, for creating scoliotic postures, it is probably better to remove the rhythms and add manual joint drivers (and the input of the driver can come from xrays or something).

Maybe, try the above-mentioned method to make it run without arms and then add the scoliotic posture by excluding the rhythms and adding new joint drivers. Then add arms :slight_smile:

I hope it helps,
Hamed

Hello Hamed!
Thank you so much for your reply. It has been very useful and I have been adapting the template StandingModel.Main.any for the thoracic flexible AND scoliosis! Now at least for that standing model, I can get the loads for the lumbar and thoracic regions.

I wanted to clarify some information, please. When declaring the DriverPos, DriverPos = { 0, 0, 0} is the order defined for {flexion/extension, rotation, lateral}? Initially, I defined my angles in that order, changing mostly in the lateral direction; however, instead of changing the curvature leftward or rightward (looking from the back), I modified the kyphosis/lordosis angulation. I want to be sure to modify the angles properly.

Last question... I know there are some entrances related to the Abdominal volumes in the model. But it is still not clear to me what those volumes represent. In the screenshot, I am attaching, for example, What does the Abdominal Volume represent? Also, for the Diaphragm, is there any information related to the lung/breathing capacity that we can extract?

image

As always thank you for your help! :slight_smile:

Hello Maria,

That is great that your model worked :slight_smile:

Regarding the first question: You can check the axes in your measure that is driven. In the figure below you can see the Axis1, Axis2, and Axis3 in a rotational measure.

Regarding the second question, the volume is a measure defined using multiple nodes on the 8th, 9th, and 10th ribs and is used to constrain the diaphragm segments :slight_smile: You can see it below. However, you cannot use it for any pressure purposes.
image

If you want to see the pressure in abdominal layers, you can check it in PressureActuators. The volume measures are defined in the file named Volumes.
image

There is ThoracicCavity volume in the tree as well, which is the volume inside the ribcage. However, the pressure actuator in this volume is OFF by default and will not make pressure. This means that the force from abdominal pressure will be handles by the diaphragm compeletely. But if you add an actuator (similar to the abdominal volumes) to have pressure values in the thoracic cavity, some of the pressure will be transfered to the thoracic cavity and the rest is balanced by diaphragm :slight_smile:

And there is nothing defined as lungs in the model yet :slight_smile:

BR,
Hamed

1 Like

Hello Hamed,
I am very sorry to bother you again, and I am very grateful that you have answered so many questions.
1、I would like to ask if there are any other ways to achieve the scoliosis position besides removing the rhythm and adding a joint drive.I've been able to achieve scoliosis by removing the rhythm and adding a joint drive, but I don't think it's a good idea to do it this way.In my mind, using this method to achieve scoliosis will completely fix the spinal Angle, but in real life, the human body walking will cause the spinal Angle to change.So I want to ask if it is possible to achieve scoliosis with markers?To be more specific, the position information of the spine-related marker is used to determine the relative Angle of the spine of the mannequins. I have tried to modify OptX OptY, OptZ, but it seems doesn't work, when running RunParameterIdentification markers will only lead to model mobile, will not result in changes of the Angle of the spine.
2、The second question is why I am in the static test run after RunParameterIdentification, palm will become very big, very long, even if I try to use another person for motion capture or attach more accurate marker point, too, I used the 'paf-anyone-example-main' example project for this problem, it seems that this does not happen when using the 'Plug-in-gait_Simple' example project, I have read your related reply in another post, but I am still confused and do not know how to fix it.


3、After I use a new model of thoracic vertebra, in static test, Why does one person's motion capture data work, but another doesn't?After running RunParameterIdentification, completely deformed spine.As a result, the parameter optimization cannot work properly.

4、When I used the new thoracic spine model, running parameter optimization in a static test and then running 'RunAnalysis' in a dynamic test, I got an error:

Kinematic analysis failed in time step 0 : Position analysis is not completed

Overall, I had a lot of issues after adding the new thoracic spine model to the 'paf-anyone-example-main' example project.
Because I use the translation software to translate into English, I am deeply sorry if there is anything that does not reach the meaning. If you do not understand my meaning, you can inform me in time.
Thank you again for helping me so many times.

Dear Zyax :slight_smile:

  1. I think you should use your joint drivers with very low weights in the marker tracking and with higher weights in the parameter identification. So in the marker tracking study, your markers have much bigger weights and will change the spinal angles.
    Regarding the OptX, OptY, OptZ of the markers, I have explained it in another topic called " Segments length optimization", which you can read about it :slight_smile:
    Remember that the rhythms and the joint drivers are constraining the joint angles and are the same basically. So if you want to use the rhythms, you should also have very low weights for them. But the joint drivers are better to make a better guess of the spine if you have the spine alignment measured from somewhere like X-rays. If you are modelling a normal spine and you do not have extra spine alignment data, you should drive the joint drivers to zero, which is exactly what the rhythms will do when you drive the rhythms to zero :slight_smile:

  2. It seems that the hand marker position on the model and your data does not match.
    If the hand is not very important to you, you can exclude the the HAND_LENGTH optimization in the LabSpecificData.any.
    If you need it, then you probably need to change the marker position in the model to tip of the fingers or something that fits the anatomical explanation of where you out the marker in the lab.

  3. In your picture, I can see that the red and blue markers in lumbar are not close to each other. So the markers are showing almost a straight guy and the spine alignment is a curved one. And I can see that the OptZ for lumbar markers are OFF. So the markers cannot move in that direction (which I think that is correct to have it this way) and the spine cannot move because you are driving it to special spine angles (which I also think that is a correct way to do it). However you should seek the problem on the marker positions in the lab data and also the spine alignment. I can see that they do not match, and that is probably why it gives results with big errors.

  4. Maybe it is better to solve the above issues first, and then run 'RunAnalysis'. But when you did that, let me know if you still see the kinematic error and you see it in which study :slight_smile:

Best regards,
Hamed

Dear Hamed,
1、Is reducing the weight of the joint driver to add this sentence in the driver?

WeightFun = {0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1};
      AnyKinEqSimpleDriver rhythmT1T12 = 
      {
        AnyKinMeasure& T11T12_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T11T12;      
        AnyKinMeasure& T10T11_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T10T11;      
        AnyKinMeasure& T9T10_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T9T10;      
        AnyKinMeasure& T8T9_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T8T9;      
        AnyKinMeasure& T7T8_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T7T8;      
        AnyKinMeasure& T6T7_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T6T7;      
        AnyKinMeasure& T5T6_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T5T6;      
        AnyKinMeasure& T4T5_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T4T5;      
        AnyKinMeasure& T3T4_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T3T4;      
        AnyKinMeasure& T2T3_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T2T3;      
        //AnyKinMeasure& T1T2_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T1T2;
        MeasureOrganizer = iarr(0, 3, 27)+0;
        DriverPos = pi/180 * {-10,-10,-10,10,10,10,0,0,0,-0};
        DriverVel = pi/180 * {0,0,0,0,0,0,0,0,0,0};
        
        WeightFun = {0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1};

        Reaction.Type = {OFF,OFF,OFF,OFF,OFF,OFF,OFF,OFF,OFF,OFF};
      };

2、The hand is not very important to me, I have exclude the the HAND_LENGTH optimization in the LabSpecificData.any.
3、 I didn't add any extra things or extra codes. I all followed the standard sample project. The only change was that I transformed the thoracic vertebra model into a new one, but there is a problem when using this person's motion capture data (there was no problem when using the old thoracic vertebra model). At the same time, I observed the motion capture data in the laboratory and didn't see any problems.



4、When I run "RunAnalysis" using the parameters of the static test, the error it reports is this.

1.0.1.0.0.1.0.0) Operation Sequence: (Operation: Main.ModelSetup.Views.SetViewMacros.KinematicView): 
1.0.1.0.0.1.0.0.0) mcr (Operation: Main.ModelSetup.Views.SetViewMacros.KinematicView.mcr): 
#### Macro command : mcr(1:1)> classoperation Main.ModelSetup.Views.KinematicView"Set View"
Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Failed to solve kinematic optimality conditions and hard constraints after 10 fallback attempts.
Constraint violations for study 'Main.Studies.MarkerTracking' : 
Constraint #24 is above tolerance 0.001, error = 0.002505, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C1C0.Constraints'.
Constraint #98 is above tolerance 0.001, error = 0.001076, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.Joints.Thorax.ExtensionRhythmDriver'.
Constraint #99 is above tolerance 0.001, error = 0.001072, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.Joints.Thorax.ExtensionRhythmDriver'.
Constraint #100 is above tolerance 0.001, error = 0.001030, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.Joints.Thorax.ExtensionRhythmDriver'.
Constraint #108 is above tolerance 0.001, error = 0.001058, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.Joints.Thorax.LumbarThroacicExtensionLinkDriver'.
Constraint #307 is above tolerance 0.001, error = 0.001582, constr. #1 in 'Main.HumanModel.BodyModel.Right.ShoulderArm.Jnt.SternoClavicularJoint.Constraints'.
Constraint #309 is above tolerance 0.001, error = 0.001147, constr. #0 in 'Main.HumanModel.BodyModel.Right.ShoulderArm.Jnt.AcromioClavicularJoint.Constraints'.
...
Constraint #652 is above tolerance 0.001, error = 0.044642, segment constr. 'Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.WristJointSeg'.
Constraint #653 is above tolerance 0.001, error = 0.041818, segment constr. 'Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Hand'.
Constraint #654 is above tolerance 0.001, error = 0.041818, segment constr. 'Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Glove'.
Constraint #655 is above tolerance 0.001, error = 0.001180, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Foot.Talus'.
Constraint #656 is above tolerance 0.001, error = 0.001863, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Foot'.
Constraint #657 is above tolerance 0.001, error = 0.001734, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Shank'.
Constraint #658 is above tolerance 0.001, error = 0.004457, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh'.
Constraint #659 is above tolerance 0.001, error = 0.002302, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Patella'.
ERROR(OBJ.MCH.KIN3) :   AnyMocapModel.any(77)  :   MarkerTracking.InitialConditions  :  Kinematic analysis failed in time step 0 : Position analysis is not completed
1.0.1.0) Kinematic analysis...
Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Failed to solve kinematic optimality conditions and hard constraints after 10 fallback attempts.
Constraint violations for study 'Main.Studies.MarkerTracking' : 
Constraint #0 is above tolerance 1e-06, error = 0.000207, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.T1C7.Constraints'.
Constraint #1 is above tolerance 1e-06, error = 0.000010, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.T1C7.Constraints'.
Constraint #2 is above tolerance 1e-06, error = 0.000173, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.T1C7.Constraints'.
Constraint #3 is above tolerance 1e-06, error = 0.000135, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C7C6.Constraints'.
Constraint #4 is above tolerance 1e-06, error = 0.000426, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C7C6.Constraints'.
Constraint #5 is above tolerance 1e-06, error = 0.000311, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C7C6.Constraints'.
Constraint #6 is above tolerance 1e-06, error = 0.000248, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C6C5.Constraints'.
Constraint #7 is above tolerance 1e-06, error = 0.000422, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C6C5.Constraints'.
Constraint #8 is above tolerance 1e-06, error = 0.000555, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C6C5.Constraints'.
Constraint #9 is above tolerance 1e-06, error = 0.000233, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C5C4.Constraints'.
Constraint #10 is above tolerance 1e-06, error = 0.000124, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C5C4.Constraints'.
Constraint #11 is above tolerance 1e-06, error = 0.000659, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C5C4.Constraints'.
Constraint #12 is above tolerance 1e-06, error = 0.000164, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C4C3.Constraints'.
Constraint #13 is above tolerance 1e-06, error = 0.000386, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.Joints.Cervical.C4C3.Constraints'.
...
Constraint #653 is above tolerance 1e-06, error = 0.041818, segment constr. 'Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Hand'.
Constraint #654 is above tolerance 1e-06, error = 0.041818, segment constr. 'Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Glove'.
Constraint #655 is above tolerance 1e-06, error = 0.001180, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Foot.Talus'.
Constraint #656 is above tolerance 1e-06, error = 0.001863, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Foot'.
Constraint #657 is above tolerance 1e-06, error = 0.001734, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Shank'.
Constraint #658 is above tolerance 1e-06, error = 0.004457, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh'.
Constraint #659 is above tolerance 1e-06, error = 0.002302, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Patella'.
ERROR(OBJ.MCH.KIN3) :   AnyMocapModel.any(77)  :   MarkerTracking.Kinematics  :  Kinematic analysis failed in time step 0 : Position analysis is not completed
1.0.1.0) ...Kinematic analysis terminated

When running "RunAnalysis" with the parameters obtained from the dynamic test, there will not be such an error.(By the way,there was no problem when using the old thoracic vertebra model)

Hello Zyax,

We had a webinar explaining the thoracic and abdominal model. It may help you understand it better :slight_smile: Here is the link: https://youtu.be/R4kM-ZKc8Gs?si=1uw3kdACBSa7IvWx

  1. You should make a weight function like this:
    AnyFolder Weight = { AnyFunConst Fun ={ Value ??= repmat(..nDim, 0.005); }; };
    WeightFun = {&Weight.Fun};

  2. I think the best is to try it without arms. So just exclude the arms and arms markers and see the differences. And see if it still does not work. Then you are sure that there is something with the thoracic region.

  3. It seems that you get kinematic error in the marker tracking. This could be due to many things that went wrong especially in the parameter identification. Please watch the video that I mentioned at the top. And if you still have problems, feel free to ask.

Best regards,
Hamed

Dear Hamed,
I have already seen it on the day the video was released. I am very grateful that you held such a webinar on scoliosis. I continued to try according to the instructions on the video, but still encountered problems.

1、Changing the weight doesn't seem to work.I have used my joint drivers with very low weights in the marker tracking and with higher weights in the parameter identification,but doing so seems to have no effect at all.

The following is the code of the joint driver.

    AnyFolder LateralBending = 
    {
      AnyKinEqSimpleDriver rhythmT1T12 = 
      {
        AnyKinMeasure& T11T12_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T11T12;      
        AnyKinMeasure& T10T11_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T10T11;      
        AnyKinMeasure& T9T10_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T9T10;      
        AnyKinMeasure& T8T9_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T8T9;      
        AnyKinMeasure& T7T8_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T7T8;      
        AnyKinMeasure& T6T7_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T6T7;      
        AnyKinMeasure& T5T6_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T5T6;      
        AnyKinMeasure& T4T5_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T4T5;      
        AnyKinMeasure& T3T4_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T3T4;      
        AnyKinMeasure& T2T3_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T2T3;      
        //AnyKinMeasure& T1T2_ref = Main.HumanModel.BodyModel.Trunk.Joints.Thorax.T1T2;
        MeasureOrganizer = iarr(0, 3, 27)+0;
//        DriverPos = pi/180 * {-3,-3,-3,3,3,3,0,0,-0,-0};
        DriverPos = pi/180 * repmat(nDim, 0);
        DriverVel = pi/180 * {0,0,0,0,0,0,0,0,0,0};
        #ifdef STATIC
        AnyFolder Weight = { AnyFunConst Fun ={ Value ??= repmat(..nDim, 1); }; };
        WeightFun =  {&Weight.Fun};
        #endif
        #ifdef MOVE_S
        AnyFolder Weight = { AnyFunConst Fun ={ Value ??= repmat(..nDim, 0.0005); }; };
        WeightFun =  {&Weight.Fun};
        #endif

        
        Reaction.Type = {OFF,OFF,OFF,OFF,OFF,OFF,OFF,OFF,OFF,OFF};
        
        #ifdef BM_TRUNK_RHYTHM_LATERAL_SOFT_
        CType= repmat(nDim,Soft);  
        #endif

      };
      
            
    };

I use a weight of 1 when parameter identification and a weight of 0.005 when marker tracking,but in the dynamic analysis, the spinal angle will not change at all.

This is the picture of bending over when not using the spine driver:

This is the picture of bending over when using the spine driver:

3、 Regarding the third point, I have already figured out what's going on. The appearance of this problem is because the gap between the model and the actual marker points is too large. In order for the marker points on the model to match the actual marker points, the program bends the spine of the model. It is only necessary to modify the data of 'SubjectSpecificData.any'.

Under your guidance, I have already solved most of the problems, and currently only the problem that the angle will not change after using the spinal driver remains. Thank you very very much for your patient guidance.

Dear Zyax,

It is great that you solved most of the problems.
You have this piece of code to make the driver soft or hard.
#ifdef BM_TRUNK_RHYTHM_LATERAL_SOFT_
CType= repmat(nDim,Soft);
#endif

Are you sure that you defined BM_TRUNK_RHYTHM_LATERAL_SOFT_?

If you have not defined this, then the drivers will be hard constraints and does not use the weights.

Best regards,
Hamed

Dear Hamed,

This answer brings up a question for me. I am working on the MOCAP model when scoliosis is included. As you presented in the last webinar (which was very good, by the way), I am turning the rhythms OFF and creating drivers for the lumbar and thoracic regions, respectively. On these new drivers, I added a weight function, as follows:

// AnyFolder Weights =
// {
// AnyFunConst Fun = { Value = repmat(..nDim, 0.005); };
// };
//
// Reaction.Type = {Off, Off, Off};

Do I need to also include the above-mentioned BM_TRUNK_RHYTHM_LATERAL_SOFT_? If so, it is not clear to me where the code should me included.

Thank you for your assistance.

Dear Maria,

You need to have these drivers as soft drivers and you should include the following code if you do not have it already :slight_smile:
CType= repmat(nDim,Soft);

Explanation: The drivers are hard constraints and will not have errors, but the soft constraints can have small errors, and will be calculated based on a optimization problem. Basically, the markers are soft constraints and you should have the spine drivers as soft drivers, so they can be affected by the markers as well :slight_smile: And then which makes a bigger role comes to the weigths :slight_smile:

Best regards,
Hamed

1 Like

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