myoconverter.conversion_steps.O2MStep2
Created on Sat Mar 5 22:29:33 2022
@author: hwang
Module Contents
Classes
Class to optimize muscle moment arms of mujoco model |
- class myoconverter.conversion_steps.O2MStep2.MomentArmOpt(mjc_model_path, osim_model_path, save_path, muscle_list=None, osim_data_overwrite=False, speedy=False)[source]
Class to optimize muscle moment arms of mujoco model
- optMomentArms()[source]
This function optimize wrapping sites in order to have matching moment arms with a given data set (osim_ma_data)
Parameters
Returns
- cvt2_model_path: string
The optimized #####_cvt2.xml model path
- compMomentArmResults(mjc_model_path=None)[source]
Plot the moment arm results before and after the above optimization step
Parameters
- mjc_model_path: string, optional
mujoco model path
Returns
None.
- maVectorSort(ma_vec, nJnt, nEval)[source]
This function sort the moment arm vector that generated by optimization procedures. Results of this sort function are joint specific lists that contains the moment arms of it. The number of list depends on the mesh points of the other coupled joints. The length of each list represent the checking points of this joint angle.
- In the optimization, itertools.product will generate the angle mesh list in this structure:
[Ang11, Ang21, Ang31], [Ang11, Ang21, Ang32], … [Ang11, Ang22, Ang31], [Ang11, Ang22, Ang32], … … [Ang12, Ang21, Ang31], [Ang12, Ang21, Ang32], … … …
- individualMuscleMAPlot(muscle, joints, nJnt, joint_ranges_osim, joint_ranges_mjc, ma_mat_osim, ma_mat_mjc, nEval_osim, nEval_mjc)[source]
” Plot individual muscle moment arm curves. Osim and Mjc are plotted side by side for the situation that multiple joints are coupling in the plot joint moment arm. In this case, a number of mesh points are checked on these coupling joints. And in this case, plot Osim and Mjc moment arms on top of each other.