I’ve been receiving lots of questions about MocoOutputGoal on the Moco forum recently, which made me realize that I never sent out an announcement for the latest Moco updates! OpenSim 4.4 with Moco 1.2.0 was released this past summer, and it includes some useful updates to MocoOutputGoal along with some other additions and bug fixes.

In OpenSim, Outputs allow you to query values from a Model that are calculated from a State object. We created MocoOutputGoal to make it easier to build custom cost functions in Moco that depend on Output values. In Moco 1.2.0, we’ve updated MocoOutputGoal to now support not only scalar Output types, but also Vec3 and SpatialVec types, which covers the majority of Outputs offered by OpenSim Components. We’ve also added new MocoGoals which allow you to minimize an Output at the beginning of a trajectory (MocoInitialOutputGoal), an Output at the end of a trajectory (MocoFinalOutputGoal), the error between initial and final Output values (MocoOutputPeriodicityGoal), and the error between an Output and a user-provided trajectory (MocoOutputTrackingGoal). In addition, we added MocoOutputConstraint to allow you to include Output values in a path constraint in your problems. Many users have requested more flexibility in building cost functions in Moco, and these new Output-based goals will give you many more options to do so.

Other updates include fixes for MocoAngularVelocityTrackingGoal and MocoOrientationTrackingGoal, which were not properly supported in Matlab and Python. We fixed a bug that was breaking marker tracking problems when using ‘setMarkersReferenceFromTRC()’ in MocoTrack. We fixed a bug where calculations from MocoStudy’s ‘analyze()’ were incorrect because DeGrooteFregly2016Muscle auxiliary variables were not properly included. Finally, we implemented a fix for DeGrooteFregly2016Muscle so that optimal fiber lengths and tendon slack lengths are scaled when using the ScaleTool.

Get Moco 1.2.0 by downloading the OpenSim 4.4 release from SimTK.

More details about this release can be foudn in the CHANGELOG.md and CHANGELOG_MOCO.md files.

Read the Moco paper here.