-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Hi @nickbianco,
In the Rajagopal2016.osim model, the walker_knee joint is ranged between 0 and 2.0944 Radians, and the patellofemoral joint, which is constrained as a function of knee motion, is defined to be in [-99999, -99999] range. Accordingly, OpenSim Moco uses this huge range for patellofemoral joint bound, while its actual range is [0, 2.0944]. This range can be confirmed by:
model = osim.Model('Rajagopal2016.osim')
state = model.initSystem()
knee = model.getCoordinateSet().get('knee_angle_r')
patellofemoral = model.getCoordinateSet().get('knee_angle_r_beta')
angles = osim.createVectorLinspace(10, knee.getRangeMin(), knee.getRangeMax())
for i in range( angles.size()):
angle = angles.get(i)
knee.setValue(state, angle)
model.realizePosition(state)
PFA = patellofemoral.getValue(state)
print(f'knee: {round(angle,4)}, patellofemoral: {round(PFA,4)}')knee: 0.0, patellofemoral: 0.0
knee: 0.2327, patellofemoral: 0.2327
knee: 0.4654, patellofemoral: 0.4654
knee: 0.6981, patellofemoral: 0.6981
knee: 0.9308, patellofemoral: 0.9308
knee: 1.1636, patellofemoral: 1.1636
knee: 1.3963, patellofemoral: 1.3963
knee: 1.629, patellofemoral: 1.629
knee: 1.8617, patellofemoral: 1.8617
knee: 2.0944, patellofemoral: 2.0944
I just tested this new range for the bound of the patellofemoral joint in OpenSim MocoTrack, i.e. [0, 2.0944] (exactly the same as the knee), and the convergence time of a torque-driven marker tracking simulation reduced from 00:10:19 (535 iter) to 00:06:53 (347 iter) (4 threads). So, adjusting this range in the official model, as well as in the Moco examples, could be beneficial.
Thank you in advance.