Page 1 of 1

Specified motion of model without IK Tools

Posted: Fri Jun 12, 2020 10:01 am
by annshorn
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:

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);
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:

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)
(So I get the same motion from file)

Re: Specified motion of model without IK Tools

Posted: Mon Jun 15, 2020 4:46 pm
by mjasmuss
Hi Anna,

If I understand correctly, you want to keep the kinematics all the same, but then change the force applied to the model? What type of force are you applying?

If you are looking at prescribing a force, this forum topic might be helpful: viewtopicPhpbb.php?f=91&t=4870&p=11940&start=0&view=

I hope this is helpful

Mike