Scripting vs. GUI
Posted: Mon Aug 20, 2018 8:31 am
Hi,
I am running in some issues with scripting some basic functions.
I have run successfully the CMC via the GUI in both v3.3 and v4 (windows and mac) using the following files (using "Filter Kinematics" with 6Hz).
Unfortunately, when I run the same simulation via scripting I receive always this error:
Below the python script I used:
What am I doing wrong?
Thanks for your help.
I am running in some issues with scripting some basic functions.
I have run successfully the CMC via the GUI in both v3.3 and v4 (windows and mac) using the following files (using "Filter Kinematics" with 6Hz).
Unfortunately, when I run the same simulation via scripting I receive always this error:
This happens both with python and matlab.CMC.computeControls: ERROR- Optimizer could not find a solution.
Unable to find a feasible solution at time = 0.1125.
Model cannot generate the forces necessary to achieve the target acceleration.
Possible issues: 1. not all model degrees-of-freedom are actuated,
2. there are tracking tasks for locked coordinates, and/or
3. there are unnecessary control constraints on reserve/residual actuators.
Below the python script I used:
Code: Select all
import opensim as osim
pth='';
taskFile='GIL01_CMC_Tasks.xml'
kinematicFile=pth+'GIL01_fast5_ik.mot'
modelFile=pth+'GIL01_gait2392_simbody.osim'
model = osim.Model(modelFile)
state = model.initSystem();
cmctool = osim.CMCTool()
cmctool.setModel(model)
cmctool.setLowpassCutoffFrequency(6.0)
cmctool.setDesiredKinematicsFileName(kinematicFile)
cmctool.setTaskSetFileName(taskFile);
fsf=osim.ArrayStr()
fsf.append('GIL01_CMC_Actuators.xml');
cmctool.setForceSetFiles(fsf)
cmctool.setMaximumNumberOfSteps(20000);
cmctool.setMaxDT(1);
cmctool.setMinDT(0.00000001);
cmctool.setErrorTolerance(0.00001);
cmctool.run();
Thanks for your help.