Home

Awesome

OpenSim to MuJoCo XML converter

:exclamation: IMPORTANT! This project is deprecated, but the development continues in MyoConverter. Please use MyoConverter for your model conversion needs.

If you use these converted MuJoCo models in your research, please cite "Converting Biomechanical Models from OpenSim to MuJoCo", as well as the original models. The converted models, and the original ones, are available for academic and other non-commercial use (check the references given in table below for licenses of original models).

Disclaimer: I started writing this code when I was still learning MuJoCo and OpenSim, and therefore the code logic is subpar at some places and could use a little update.

Models

Converted fileOriginal fileFile containing optimized parametersDescription of the modelReference
gait10dof18musc MuJoCogait10dof18musc OpenSimdata.pcklA simple leg model consisting of both legs and rotating torso. Derived from the gait2392 model below.Distributed with OpenSim, OpenSim web page (download requires registration) GitHub
MoBL_ARMS MuJoCoMoBL_ARMS OpenSimdata.pcklA dynamic shoulder and arm model with fixed torso.Project web page (download requires registration). Benchmarking of Dynamic Simulation Predictions in Two Software Platforms Using an Upper Limb Musculoskeletal Model, K. R. Saul, X. Hu, C. M. Goehler, M. E. Vidt, M. Daly, A. Velisar, W. M. Murray (2014)
gait2392 MuJoCogait2392 OpenSimdata.pcklA leg model consisting of both legs and a rotating/bending torso.Distributed with OpenSim, OpenSim web page (download requires registration) GitHub
leg6dof9musc MuJoColeg6dof9musc OpenSim-A simple leg model (one leg), derived from gait2392 model.Distributed with OpenSim, OpenSim web page (download requires registration) GitHub
Hamner2010Not available in this repo, see reference-3D full-body model with 92 musculotendon actuators in lower extremitiesProject web page (download requires registration). Muscle contributions to propulsion and support during running, S.R. Hamner, A. Seth, S.L. Delp (2010)
Rajagopal2015Not available in this repo, see reference-3D full-body model with a muscle-actuated lower extremity and torque actuated trunk and upper extremityProject web page (download requires registration). Full-Body Musculoskeletal Model for Muscle-Driven Simulation of Human Gait, A. Rajagopal, C. L. Dembia, M. S. DeMers, D. D. Delp, J. L. Hicks, S. L. Delp (2016)
HYOID1.2HYOID1.2 OpenSim-Neck modelProject web page (download requires registration). The Inclusion of Hyoid Muscles Improve Moment Generating Capacity and Dynamic Simulations in Musculoskeletal Models of the Head and Neck, J. D. Mortensen, A. N. Vasavada, A. S. Merryweather (2018)

Limitations and known bugs

How to run the converter

Easiest way to run the converter is to use conda to create the environment from conda_env.yml, activate the environment, and then run O2MConverter.py script

> conda env create --name O2MConverter --file=conda_env.yml
> conda activate O2MConverter
> python O2MConverter.py opensim_model_file.osim /location/where/converted/model/will/be/saved /location/where/geometry/files/are

How to optimize converted model's parameters (for a new model)

How to load converted model's optimized parameters

The optimized parameters are saved in tests/[model_name]/output/data.pckl, or in a file specified by the EnvTemplate object if you created & optimized a new model. Use function load_data(args) from Utils.py to load the optimized parameters, and function set_parameters(args) to set the models into a mujoco_py.PyMjModel model (see function run_mujoco_simulations(args) in tests/process_test_runs.py for an example).

Contributors

Florian Fischer, Miroslav Bachinski (analysis and conversion of musculotendon properties)