First solution is to align the thorax with the global ref, to do so remove the PostureDriver in the optimization model and replace it by something like this:
Second solution is to contrain to thorax to stay above the pelvis, then remove the flexion/extension and lateral bending component of the PostureDriver and add something like this:
AnyKinEqSimpleDriver driver = {
MeasureOrganizer = {0,1}; //along x and y
AnyKinLinear lin = {
ref = -1; //measured in global
AnyRefFrame ref1 = Thorax;
AnyRefFrame ref2 = Pelvis;
};
Pos = {0,0};
vel = {0,0};
};
The syntax is not exact, but i think you get the idea. Just choose the one you think looks better.
Thanks for the advice. I added the second solution that you recommended but still found the same issues with my model. I was wondering if you could take a look and see where I have gone wrong. Thank you.
I can see you copied my code directly, but as i said it was more a guideline and the syntax needs some adjustments to your model (the path for the reference to the segments). Anyway here is the code adjsuted, and don’t forget you still need to drive the trunk axial rotation:
Now I understand what you meant. My apologies. Thanks for the help. I was wondering if you could explain the trunk axial rotation. Is that done similarly to the pelvis thorax rotation. Could it be done the same way with the MeasureOrganizer = {2};
I was wondering, you said that I still need to drive the trunk axial rotation. In the code that you sent me isn’t the trunk axial rotation being driven already? Can you clarify this for me. When I have used the codee you sent me the model is still not standing upright.
I am not sure what is still causing the model to not stand upright. Will the posture make a difference in my results for muscle forces in the legs and hips.
I have attached my model.
Since there are no markers for the upper body i have added all three rotational drivers between thorax and pelvis, otherwise the upper-body is not well controlled.
I have also switched off the optimization of the trunk height since it is not a good idea trying to optimize it while having no markers “controlling” it, this may cause convergence problems.
These changes creates a plausible motion, the one you had previously will definitely have an effect on the results since the pelvis was rotated a lot.