diff --git a/Pose2Sim/Utilities/bodykin_from_mot_osim.py b/Pose2Sim/Utilities/bodykin_from_mot_osim.py index 9c85a99..62140ba 100644 --- a/Pose2Sim/Utilities/bodykin_from_mot_osim.py +++ b/Pose2Sim/Utilities/bodykin_from_mot_osim.py @@ -123,8 +123,9 @@ 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 = [] for b in bodies: diff --git a/Pose2Sim/Utilities/trc_from_mot_osim.py b/Pose2Sim/Utilities/trc_from_mot_osim.py index 359ff30..acf3e6a 100644 --- a/Pose2Sim/Utilities/trc_from_mot_osim.py +++ b/Pose2Sim/Utilities/trc_from_mot_osim.py @@ -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)