As I understand, the IK/ID tools allow analyzing the motion of the model with a specified motion file (.mot or .sto).
Like I take a model, load tools, and run it - at this moment I can't "control" my model, I mean, I can only see how model simulates the movement from the loaded file.
Example:
Code: Select all
imuIK = osim.IMUInverseKinematicsTool();
# Set tool properties
imuIK.set_model_file(modelFileName);
imuIK.set_orientations_file(orientationsFileName);
imuIK.set_sensor_to_opensim_rotations(sensor_to_opensim_rotation)
imuIK.set_results_directory(resultsDirectory)
# Set time range in seconds
imuIK.set_time_range(0, startTime);
imuIK.set_time_range(1, endTime);
# Run IK
imuIK.run(visualizeTracking);
Example:
Code: Select all
osimModel = osim.Model(modelFileName)
state = osimModel.initSystem()
manager = osim.Manager(osimModel)
state.setTime(0)
manager.initialize(state)
state = manager.integrate(10.0)