realizePosition instead of assemble for faster computation
This commit is contained in:
parent
4f18dd770d
commit
890ac14eb9
@ -123,8 +123,9 @@ def bodykin_from_mot_osim_func(*args):
|
|||||||
model.getCoordinateSet().get(coord).setValue(state, motion_data_np[n,c], enforceContraints=False)
|
model.getCoordinateSet().get(coord).setValue(state, motion_data_np[n,c], enforceContraints=False)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
model.assemble(state)
|
# model.assemble(state)
|
||||||
|
model.realizePosition(state) # much faster (IK already done, no need to compute it again)
|
||||||
|
|
||||||
# Use state of model to get body coordinates in ground
|
# Use state of model to get body coordinates in ground
|
||||||
loc_rot_frame = []
|
loc_rot_frame = []
|
||||||
for b in bodies:
|
for b in bodies:
|
||||||
|
@ -81,7 +81,8 @@ def get_marker_positions(motion_data, model, in_degrees=True, marker_list=[]):
|
|||||||
else:
|
else:
|
||||||
value = motion_data_pd.loc[n,coord]
|
value = motion_data_pd.loc[n,coord]
|
||||||
model.getCoordinateSet().get(coord).setValue(state,value, enforceContraints=False)
|
model.getCoordinateSet().get(coord).setValue(state,value, enforceContraints=False)
|
||||||
model.assemble(state)
|
# model.assemble(state)
|
||||||
|
model.realizePosition(state) # much faster (IK already done, no need to compute it again)
|
||||||
# get marker positions
|
# get marker positions
|
||||||
marker_positions += [np.array([marker_set.get(mk_name).findLocationInFrame(state, model.getGround()).to_numpy() for mk_name in marker_set_names]).flatten()]
|
marker_positions += [np.array([marker_set.get(mk_name).findLocationInFrame(state, model.getGround()).to_numpy() for mk_name in marker_set_names]).flatten()]
|
||||||
marker_positions_pd = pd.DataFrame(marker_positions, columns=marker_set_names_xyz)
|
marker_positions_pd = pd.DataFrame(marker_positions, columns=marker_set_names_xyz)
|
||||||
|
Loading…
Reference in New Issue
Block a user