utils.UtilsOpensim
Module Contents
Functions
|
remove the locked coordinates and dependency coordinates of the spanned joints |
|
Check if coordinates are coupling when calculating moment arms |
|
Extract motion range of given joint coordinates from Osim model |
|
Extract motion range of given joint coordinates from Osim model |
|
Extract motion range of all joint coordinates of the Osim model |
|
Given as INPUT a muscle OSMuscleName from an OpenSim model, this function |
|
Function that given a dependent coordinate finds the independent |
|
functon to retun a strcuture for a specifc model, returning a list of the |
|
|
|
|
|
|
|
Calculate the position of the wrapping side |
|
Get all indpendent coordinates in an Osim model |
|
Extract marker list from Osim model for forward kinematic check |
|
Calculate the positions of endpoints when iterating all joint angle meshes. |
|
|
|
Compute moment arm of a muscle at a joint that it wraps. |
|
|
|
|
|
|
|
|
|
- utils.UtilsOpensim.getJointsControlledByMuscle(osimModel, OSMuscle)[source]
remove the locked coordinates and dependency coordinates of the spanned joints
- utils.UtilsOpensim.getCouplingJoints(osimModel, osim_muscle_model, joints)[source]
Check if coordinates are coupling when calculating moment arms
- utils.UtilsOpensim.getJointRanges_dict(osimModel, joints)[source]
Extract motion range of given joint coordinates from Osim model
- utils.UtilsOpensim.getJointRanges_array(osimModel, joints)[source]
Extract motion range of given joint coordinates from Osim model
- utils.UtilsOpensim.getAllJointsRanges(osimModel)[source]
Extract motion range of all joint coordinates of the Osim model
- utils.UtilsOpensim.getJointsSpannedByMuscle(osimModel, OSMuscleName)[source]
Given as INPUT a muscle OSMuscleName from an OpenSim model, this function returns the OUTPUT structure jointNameSet containing the OpenSim jointNames crossed by the OSMuscle.
It works through the following steps: 1) extracts the GeometryPath 2) loops through the sinccgle points, determining the body they belong to 3) stores the bodies to which the muscle points are attached to 4) determines the nr of joints based on body indexes 5) stores the crossed OpenSim joints in the output structure named jointNameSet
NB this function return the crossed joints independently on the constraints applied to the coordinates. Eg patello-femoral is considered as a joint, although in Arnold’s model it does not have independent coordinates, but it is moved in dependency of the knee flexion angle.
- utils.UtilsOpensim.getIndipCoordAndJoint(osimModel, constraint_coord_name)[source]
Function that given a dependent coordinate finds the independent coordinate and the associated joint. The function assumes that the constraint is a CoordinateCoupleConstraint as used by Arnold, Delp and LLLM. The function can be useful to manage the patellar joint for instance.
- utils.UtilsOpensim.getModelJointDefinitions(osimModel)[source]
functon to retun a strcuture for a specifc model, returning a list of the joints present in the model and their associated frames
- utils.UtilsOpensim.getWrappingSide(osimModel, OSMuscleName, currentState)[source]
Calculate the position of the wrapping side
- Parameters:
osimModel: Opensim model OSMuscleName (str): muscle name currentState : State of the Opensim model
- returns:
wrapMuscleDic: Dictionary with the wrapping center, dimension, type and position of the side
- utils.UtilsOpensim.getAllIndependentCoordinates(osimModel)[source]
Get all indpendent coordinates in an Osim model
- utils.UtilsOpensim.extractMarkerSet(osimModel_path)[source]
Extract marker list from Osim model for forward kinematic check
- utils.UtilsOpensim.calculateEndPoints_osim(osimModel_path, endPoints, N_EvalPoints)[source]
Calculate the positions of endpoints when iterating all joint angle meshes. This is to check the Geometry and Joint Definition matches between the Opensim and the converted MuJoCo models. Parameters ———- osimModel_path : string
Path and name of the Osim model that will be evaluated.
- endPointslist of string
The names of the endpoints whose positions will be evaluated.
Returns
- evaData: dict
The evaluation data, including the joint angle meshes and the corresponding endpoint locations
- utils.UtilsOpensim.getMomentArmAtJoints(muscleModel, state, joint_set)[source]
Compute moment arm of a muscle at a joint that it wraps.
- utils.UtilsOpensim.computeMomentArm(osimModel, osim_muscle_model, joints, ang_ranges, N_EvalPoints)[source]
- utils.UtilsOpensim.updOsimCoordMomentArm(osimModel, osim_muscle_model, joints_idx, DOF_index, jointEval)[source]