trouble running getRecordValues in matlab
Posted: Fri May 28, 2021 8:47 am
Hi,
I tried something like the following code in matlab and faced an error (matlab environment has been configured before and I could run a number of other methods):
import org.opensim.modeling.*
EnvModel = Model('Modelfile');
state = EnvModel.initSystem(); % I also tried with initializeState with the same error message
force = EnvModel.getForceSet.get(0);
values = force.getRecordValues(state);
Then I get the following error:
Java exception occurred:
java.lang.RuntimeException: SimTK Exception thrown at GeneralContactSubsystem.cpp:131:
Expected stage to be at least Dynamics in GeneralContactSubsystemImpl::getContacts() but current stage was Velocity
at org.opensim.modeling.opensimSimulationJNI.Force_getRecordValues(Native Method)
at org.opensim.modeling.Force.getRecordValues(Force.java:121)
Any hint on what could be wrong?
Best regards,
Afshin
I tried something like the following code in matlab and faced an error (matlab environment has been configured before and I could run a number of other methods):
import org.opensim.modeling.*
EnvModel = Model('Modelfile');
state = EnvModel.initSystem(); % I also tried with initializeState with the same error message
force = EnvModel.getForceSet.get(0);
values = force.getRecordValues(state);
Then I get the following error:
Java exception occurred:
java.lang.RuntimeException: SimTK Exception thrown at GeneralContactSubsystem.cpp:131:
Expected stage to be at least Dynamics in GeneralContactSubsystemImpl::getContacts() but current stage was Velocity
at org.opensim.modeling.opensimSimulationJNI.Force_getRecordValues(Native Method)
at org.opensim.modeling.Force.getRecordValues(Force.java:121)
Any hint on what could be wrong?
Best regards,
Afshin