how can i set initial states in forward dynamics-MatLab API
Posted: Mon May 27, 2013 10:02 pm
Hi All
I want to set the initial states (joint angles and velocities) to specific values and use forward dynamics to integrate the equations of motion forward in time.
I am using MatLab API. here is my script:
When I look at the results, all of the joint angles and velocities have an initial value of zero. Any idea how can I solve this problem?
Thanks,
Sina
I want to set the initial states (joint angles and velocities) to specific values and use forward dynamics to integrate the equations of motion forward in time.
I am using MatLab API. here is my script:
Code: Select all
system = osimModel.initSystem();
modelCoordinateSet = osimModel.updCoordinateSet();
modelCoordinateSet.get(aCoor).setValue(system,aValue);
tool = ForwardTool();
tool.setModel(osimModel);
tool.setStartTime(0);
tool.setFinalTime(finalTime);
tool.run();
Thanks,
Sina