In MocoInverse, after a problem solves, we automatically add back to the MocoTrajectory the kinematics prescribed to the model via the PositionMotion in the model. This works well when solving problems directly from MocoInverse, but if you instead export a MocoInverse problem to a MocoStudy (e.g., to add another cost function), then the kinematics will not be included in the final MocoTrajectory returned to the user.
This means the user needs to add the kinematics back to the trajectory themselves in order to run an analysis, and doing so is unintuitive: example forum post.
We should automate this, or at least provide a convenience function on MocoTrajectory for adding in kinematics from a model's PositionMotion.
Try adding a method to MocoStudy that looks for PositionMotion in the model to add back.
In MocoInverse, after a problem solves, we automatically add back to the MocoTrajectory the kinematics prescribed to the model via the
PositionMotion
in the model. This works well when solving problems directly from MocoInverse, but if you instead export a MocoInverse problem to a MocoStudy (e.g., to add another cost function), then the kinematics will not be included in the final MocoTrajectory returned to the user.This means the user needs to add the kinematics back to the trajectory themselves in order to run an analysis, and doing so is unintuitive: example forum post.
We should automate this, or at least provide a convenience function on MocoTrajectory for adding in kinematics from a model's
PositionMotion
.