What is the correct usage of initSystem()
Posted: Tue Oct 23, 2018 4:00 am
Hi all,
I am wondering whether someone can inform me of the correct usage of initSystem() and when it is appropriate/not appropriate to use?
I am currently using it once after my initial call to load the model as a global variable in my mex function:
Model *myModel = new Model("folder/something.osim");
SimTK::State *myState = new State(myModel->initSystem());
I then subsequently use myState throughout my main mex function to set my state variables, update the model to the position and velocity stages, obtain position and velocity information of stations, and compute state variable derivatives etc.
e.g. SimTK::Vector derivs = myModel->computerStateVariableDerivatives(*myState);
Kind regards,
Nicos Haralabidis
I am wondering whether someone can inform me of the correct usage of initSystem() and when it is appropriate/not appropriate to use?
I am currently using it once after my initial call to load the model as a global variable in my mex function:
Model *myModel = new Model("folder/something.osim");
SimTK::State *myState = new State(myModel->initSystem());
I then subsequently use myState throughout my main mex function to set my state variables, update the model to the position and velocity stages, obtain position and velocity information of stations, and compute state variable derivatives etc.
e.g. SimTK::Vector derivs = myModel->computerStateVariableDerivatives(*myState);
Kind regards,
Nicos Haralabidis