Center of Mass velocity
Posted: Fri Jan 20, 2023 1:11 pm
Hello,
i have a .trc file that stores the results of an Inverse Kinematics Analysis.
In Matlab, I load this file as a StatesTrajectory. Then, for every state, I assemble my model to match this state. I then want to extract the position and velocity of the assebled state. This works well for the center of mass position, but not for the center of mass velocity.
I do it like this:
state = model.initSystem()
current_state = traj.get(i); (where traj is the state trajectory)
model.assemble(current_state);
model.realizePosition(current_state);
com = model.calcMassCenterPosition(current_state)
model.realizeVelocity(current_state);
current_state.setSystemTopologyStageVersion(7);
comdot = model.calcMassCenterVelocity(current_state);
Nevertheless, for comdot I only get NaNs.
What do I do wrong?
I really appreciate your help!!
Thanks and best regards,
Sophie
i have a .trc file that stores the results of an Inverse Kinematics Analysis.
In Matlab, I load this file as a StatesTrajectory. Then, for every state, I assemble my model to match this state. I then want to extract the position and velocity of the assebled state. This works well for the center of mass position, but not for the center of mass velocity.
I do it like this:
state = model.initSystem()
current_state = traj.get(i); (where traj is the state trajectory)
model.assemble(current_state);
model.realizePosition(current_state);
com = model.calcMassCenterPosition(current_state)
model.realizeVelocity(current_state);
current_state.setSystemTopologyStageVersion(7);
comdot = model.calcMassCenterVelocity(current_state);
Nevertheless, for comdot I only get NaNs.
What do I do wrong?
I really appreciate your help!!
Thanks and best regards,
Sophie