realizePosition instead of assemble for faster computation
This commit is contained in:
parent
4f18dd770d
commit
890ac14eb9
@ -123,7 +123,8 @@ def bodykin_from_mot_osim_func(*args):
|
||||
model.getCoordinateSet().get(coord).setValue(state, motion_data_np[n,c], enforceContraints=False)
|
||||
except:
|
||||
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
|
||||
loc_rot_frame = []
|
||||
|
@ -81,7 +81,8 @@ def get_marker_positions(motion_data, model, in_degrees=True, marker_list=[]):
|
||||
else:
|
||||
value = motion_data_pd.loc[n,coord]
|
||||
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
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user