coordinates
Posted: Thu Aug 03, 2017 1:43 pm
hello,
i have a simple matlab code which loads the model and makes a free falling.
clear all;
import org.opensim.modeling.*
foot1 = Model('C:\Users\shayan\Desktop\model-20170712T165116Z-001/foot1.osim');
s = foot1.initSystem();
manager = Manager(foot1);
x0 = foot1.updCoordinateSet().get('y');
x0.setDefaultValue(3);
manager.setInitialTime(0);
manager.setFinalTime(.04);
manager.integrate(s);
what i want to do is to change the initial state (in my case y, showing the height). using following lines in the above code seems to do the job:
x0 = foot1.updCoordinateSet().get('y');
x0.setDefaultValue(3);
however, the change happens only in .sto or .mot file. and i want to retrieve (see the value) it through matlab. do the previous two lines change the values for center of mass?if so, why running this line (foot1.calcMassCenterPosition(s)) results in a different value than my default value (which was 3)?
the second question is:how can i get the value of state y from one simulation to use it as starting position for another simulation?
regards
Shayan
i have a simple matlab code which loads the model and makes a free falling.
clear all;
import org.opensim.modeling.*
foot1 = Model('C:\Users\shayan\Desktop\model-20170712T165116Z-001/foot1.osim');
s = foot1.initSystem();
manager = Manager(foot1);
x0 = foot1.updCoordinateSet().get('y');
x0.setDefaultValue(3);
manager.setInitialTime(0);
manager.setFinalTime(.04);
manager.integrate(s);
what i want to do is to change the initial state (in my case y, showing the height). using following lines in the above code seems to do the job:
x0 = foot1.updCoordinateSet().get('y');
x0.setDefaultValue(3);
however, the change happens only in .sto or .mot file. and i want to retrieve (see the value) it through matlab. do the previous two lines change the values for center of mass?if so, why running this line (foot1.calcMassCenterPosition(s)) results in a different value than my default value (which was 3)?
the second question is:how can i get the value of state y from one simulation to use it as starting position for another simulation?
regards
Shayan