I'm trying to get the time-varying orientation of every body in my model, after running marker-based inverse kinematics. I'm getting the data I expect, but I'm not sure my process is very efficient...
My current system (using API through python scripting) is to:
1. Run the inverse kinematics which creates a coordinates .mot file
2. Use the Analyze tool to create a states .sto file from the coordinates .mot file
3. Create a StatesTrajectory from the states .sto file, then my code looks something like this:
Code: Select all
stateTrajectory = osim.StatesTrajectory.createFromStatesTable(model, states_table)
model.initSystem()
for row in range(stateTrajectory.getSize()):
state = stateTrajectory.get(row)
model.realizePosition(state)
Rot = body.getTransformInGround(state).R()
Thanks in advance for any suggestions.
Mhairi