Hi Hojin,
I've used the Goal Nick mentioned to minimize the deviations of the torso in global frame, it worked well. You could try that Goal with a high weight and see if it makes the deviations of the arms small enough for your purpose.
If you want the deviations to be literally zero, I think you'd have to use kinematic constraints in the .osim model itself, similar to what is done to define patella motions as prescribed functions of the knee angle. To get the arms to be always parallel to the ground, the kinematic constraint would have to make the shoulder angles functions of both the pelvis and lumbar angles (assuming pelvis is your model's "base" segment) and I'm not sure if that's possible, the patella is the only example of kinematic constraints I'm familiar with in OpenSim models and it's only a function of a single coordinate in the model.
I've run many Moco simulations with the kinematic constraints of the patellas in the problem and it works fine. It's been a while since I troubleshot this part of the model, but I use the following solver settings that I think tell Moco to pay attention to this constraint (maybe Nick can confirm; I searched but couldn't find the old thread on this):
Code: Select all
solver.set_enforce_constraint_derivatives(true);
solver.set_enforce_path_constraint_midpoints(true);
There's another setting that can be used:
Code: Select all
solver.set_lagrange_multiplier_weight(weight_goes_here);
but I didn't get good results with it.
Ross