Through the .osim file I know what the model components are called e.g. the given name of the muscles, through string assignments or bodies:
Code: Select all
<Body name="femur_r">
<mass>9.3014</mass>
<mass_center> 0 -0.17 0</mass_center>
<inertia_xx>0.1339</inertia_xx>
<inertia_yy>0.0351</inertia_yy>
<inertia_zz>0.1412</inertia_zz>
<inertia_xy>0</inertia_xy>
<inertia_xz>0</inertia_xz>
<inertia_yz>0</inertia_yz>
Code: Select all
# Load model
model = osim.Model("gait2354_simbody.osim")
muscles = model.getMuscles()
muSize = muscles.getSize()
for i in range(muSize):
print muscles.get(i)