Presently, the goto method for bilateral symmetry is simulating half of the gait cycle and imposing periodic boundary constraints that match right side states and controls to left side. Using this method where the states, controls, and model are all bilaterally symmetric and periodic, the effort function -- as a function of the state variables, and controls only -- is guaranteed to be periodic on the half-gait cycle. So if we generate a cost of walking for the half gait-cycle, given the model is symmetric, we can simply double the half-cycle cost to get the full gait-cycle cost.
However, if the model parameters are not symmetric, but we still want the kinematics to be symmetric this does not work. If, for example, the mass of the left tibia body is higher than the right, it follows that some muscle activations will have to be larger on the left leg than the right leg for the same joint angle trajectory on each leg. Given this, we cannot assume or specify bilateral symmetry for the muscle activations or excitations. If our effort is computed from the muscle activations or excitations, we cannot simulate a half gait cycle anymore because the effort integrand will not be periodic on a half gait cycle. For example, if the left tibia is more massive than the left, left swing will be more effortful than right swing. As a result, if we did just simulate the half gait cycle with periodic boundary constraints with state pairs to enforce kinematic bilateral symmetry, we would end up with an an underestimate of the cost of that gait as the simulation would favor only running over the half of the gait cycle which involves mostly right swing and left stance.
I am wondering if anyone is aware of a way to craft this problem correctly using the existing MoCo goals and constraints. Presently, looking through all the available options the only solutions I can think of require building a new goal or constraint.
For example, this could involve:
- Implementing a 'stronger' bilateral symmetry MocoGoal which requires that two state trajectories be identical according to a prescribed or variable phase difference. For use in simulating a whole gait cycle.
- Building an OpenSim model which contains two copies of the MSK system: an original and a duplicate, plus building a new MocoGoal or extending an existing MocoGoal that aims to keep two states identical (e.g.: model1_knee_ankle_r = model2_knee_angle_l). For use in simulating a half gait cycle on one model and the other half on the duplicate model concurrently.
- Implementing multi-phase TO problems in MoCo. Phase 1 is the first half of the gait cycle. Phase 2 is the second half of the gait cycle. And implementing a MocoGoal that the matches state trajectories in pairs in the two phases (e.g.: phase1_knee_angle_r = phase2_knee_angle_l).
If there is no precedent or known solution using the available MoCo goals, I would be interested in helping implement what is necessary for the best solution. I use MoCo from MATLAB mostly and I have recently succeeded in building MoCo from source including the Java bindings, but am totally knew to working on and building such a large project.