Specified motion of model without IK Tools
Posted: Fri Jun 12, 2020 10:01 am
Hi
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:
Is it possible to somehow make this movement from the file the default movement of the model? (this is for further using PrescribedController() and iterative changing the behavior of the model by applying force)
Example:
(So I get the same motion from file)
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)