Whats New in OpenSim 4.6?
We are pleased to announce the following new features, bug fixes, and other improvements in OpenSim 4.6. The new software includes a brand new visualizer with improved visualization quality, smoother playback animations, and seamless image and video generation tools, along with other improvements to the look and feel of the application.
For API users, we now provide official PyPI packages, meaning that you can now pip-install OpenSim:
pip install opensimWe will also continue to provide official Conda packages. Learn more about using OpenSim in Python here: Scripting in Python. For those looking for an introduction to the OpenSim API through Python, check out the series Jupyter notebooks which can be directly in Google Colab.
Finally, OpenSim 4.6 also includes many new modeling and simulation features including several addition to Moco, OpenSim’s direct collocation optimal control package library. Release notes are provided below along with links to the full change logs for more detail.
Changes from OpenSim 4.5
Note that the following list summarizes all changes since OpenSim 4.5, including changes introduced in the API-only OpenSim versions 4.5.1 and 4.5.2.
OpenSim GUI, featuring the new OpenSim Viewer
The OpenSim GUI now features the new OpenSim Viewer, a new browser-based 3D visualizer designed to improve the quality, performance, and user experience when viewing OpenSim models, both in animation playback and media creation.
The OpenSim Viewer features the following visualization improvements:
Native support for Apple Silicon machines.
Smoother playback animations (i.e., no dropped frames or inconsistent frame rates) and overall improved performance via hardware acceleration.
Loaded motions can now be saved to video directly in the MP4, MOV, and GIF formats with options for different quality and frame rate settings.
Snapshot creation now supports custom resolutions and transparent backgrounds.
Intuitive viewer navigation controls, quick component selection and focus, and smooth view reorientation.
A modern user interface with an intuitive component tree representing the viewer scene, where users can easily control the configuration and visibility of lighting elements, floor and background displays, and models.
OpenSim API
With OpenSim 4.6, we’ve introduced new features to expand modeling capabilities, speed up simulation performance, and improve the overall user experience:
The
Managerclass has been updated to improve documentation and add new features. Notably, support for the implicit integrator CPodes (i.e.,Manager::IntegratorMethod::CPodes) has been added. CPodes is designed for integrating stiff numerical systems and therefore can significantly improve performance when simulating musculoskeletal models.Added
ExponentialContactForce, a foot-ground contact model based on exponential spring functions that can provide up to a 10X performance improvement over the Hunt-Crossley contact model.Added
StatesDocument, a new class that enables direct serialization of all states in aStatesTrajectory, including discrete states.Added
SynergyController, a new subclass ofControllerthat computes model controls based on linear combination of a set ofInputcontrol signals and a set of synergy vectors. This class enables embedding a control structure based on muscle synergies directly in an OpenSim model that is compatible with forward simulation and optimization (e.g., Moco, see below).Added
StationDefinedFrame, a new class for defining aFramebased on threeStation(i.e., body-fixed points). Use this class to define joint frames based on ISB recommendations. See the associated OpenSim Creator tutorial for StationDefineFrames for more information.Added
ExpressionBasedPathForceandExpressionBasedFunctionto provide additional options for defining model components based on user-defined expressions.Added the following new
ModelProcessorfeatures:ModOpAddReservesnow has an option to skip “residual coordinates”, i.e., coordinates belonging to joints whose parent frame isGround.Added
ModOpAddResidualsfor addingCoordinateActuators to “residual coordinates” (see previous bullet).Added
ModOpPrescribeCoordinateValuesfor prescribing the motion of coordinates based on a table of coordinate values.
Add the following new
TableProcessorfeatures:TabOpLowPassFilternow trims the filtered trajectory to the original time range (i.e., removes padded time points).Added
TabOpAppendCoupledCoordinateValues. Given aTimeSeriesTablecontaining values of independent coordinates inCoordinateCouplerConstraints, this operator computes the dependent coordinate values and appends them to the table.Added
TabOpAppendCoordinateValueDerivativesAsSpeeds. Given aTimeSeriesTablecontaining coordinate values, this operator computes the derivative of the coordinate values using a spline fit and appends it to the table as a coordinate speed. For example, the derivative of column/jointset/ankle_r/ankle_angle_r/valuewill be appended as a new column with label/joinset/ankle_r/ankle_angle_r/speed.
Moco’s example3DWalking (see below) shows how to use TabOpAppendCoupledCoordinateValues and TabOpAppendCoordinateValueDerivativesAsSpeedsto construct a reference trajectory for a tracking optimization problem from an inverse kinematics solution.
Added the experimental class
Scholz2015GeometryPath, a new muscle wrapping class based on the Scholz et al. (2015) muscle wrapping algorithm.
Scholz2015GeometryPath is currently an experimental class. We do not yet support visualizing wrapping paths in the GUI, and current default settings and behavior may change in future versions of OpenSim.
OpenSim Moco
OpenSim 4.6 includes several updates to Moco, the direct collocation optimal control library:
The
tropterlibrary, and subsequentlyMocoTropterSolver, have been removed. Since users overwhelmingly preferMocoCasADiSolver, this decision was made to unify future Moco development around the CasADi numerical optimization framework.Added
example3DWalking(C++, Python, and Matlab), which demonstrates best practices for creating muscle-driven tracking simulations in Moco when using foot-ground contact models.Moco now supports OpenSim models that include a
PrescribedController. Model controls defined by aPrescribedControllerwill not be included in the trajectory optimization problem solved by Moco.Moco also supports the new
SynergyControllerclass. SeeexampleMocoInversefor a demonstration on how to useSynergyControllerwithin aMocoStudy.Added new features to
PolynomialPathFitter, including an option to find a minimal set of polynomial coefficients via stepwise regression and support for muscle paths dependent on more than 6 coordinates. In addition, performance inMultivariatePolynomialFunctionhas been improved by ~25%.Several Moco examples have been updated to use
FunctionBasedPaths fitted viaPolynomialPathFitter, which significantly improves convergence time (i.e., 5X to 10X faster).Added support for the projection method for enforcing kinematic constraints from Bordalba et al. (2023). This method can be enabled in
MocoCasADSolverviasolver.set_kinematic_constraint_method('Bordalba2023'). This method is compatible with all transcription in Moco, including the recently addedlegendre-gauss-#orlegendre-gauss-radau-#schemes. The original (and default) kinematic constraint method from Posa et al. (2016) can be explicitly selected with'Posa2016'(but is only compatible with thehermite-simpsonscheme).Added
MocoGeneralizedForceTrackingGoalto support tracking inverse dynamics moments directly in aMocoStudy. SeeexampleMocoTrackfor a demonstration of this goal and the associated new utilityMocoStudy::calcGeneralizedForces(), which enable computing joint moments directly from aMocoTrajectory.Added
MocoExpressionBasedParameterGoalto support defining cost functions based onMocoParameters.Added
MocoOutputBase::setSecondOutputPathandMocoOutputBase::setOperationto support defined goals based on the composite of twoOutputvalues.Added the following new scripting variants of
MocoStudy::analyze():MocoStudy::analyzeVec3(),MocoStudy::analyzeSpatialVec(),MocoStudy::analyzeRotation().
Bug Fixes
Exposed the "dissipated energy" state variable allocated by the
SimTK::Force::LinearBushingthat is internal toBushingForce. This change fixed a bug in Moco where adding aBushingForceled to a segfault due to a mismatch between the size of the auxiliary state vector reserved by Moco andSimTK::State::getZ().Fixed bug in
C3DFileAdapterwhere there was an error when reading C3D files with more than 255 markers.Several issues in
OpenSim::ExpressionBasedBushingForce::generateDecorationswere fixed: the method now checks for zero property values and NaNed vectors before emitting decorations.Fixed various issues in
PolynomialPathFitterincluding failures when too few coordinate samples were provided and hardware threads being assigned toForceelements without a geometry-based path.Fixed bug in
Logger::cout, it now it works at any logger level.Fixed various memory leak issues in OpenSim models and model components.
Fixed an issue where a copy of an
OpenSim::Modelcontaining aOpenSim::ExternalLoadscould not be finalized.
Packaging and Availability
The OpenSim 4.6 can be downloaded at SimTK.org:
SimTK: OpenSim: Downloads
Note, if you are downloading on a Mac, you will need a newer version of Java (between 8 and 17) installed on your computer.
The OpenSim 4.6 release and other “bleeding edge” release candidates can also be downloaded directly from GitHub:
Releases · opensim-org/opensim-gui.Conda and PyPI packages containing the Python interface of the OpenSim 4.6 API are also available for install. See Scripting in Python for full installation instructions, versioning, supported platforms, and more.
conda:
conda install -c opensim-org opensimPyPI:
pip install opensim
Full Change Logs
Application (GUI):
opensim-gui/CHANGELOG.md at main · opensim-org/opensim-gui API:
opensim-core/CHANGELOG.md at main · opensim-org/opensim-core Moco:
opensim-core/CHANGELOG_MOCO.md at main · opensim-org/opensim-core