Dear sherman,
I tried to run the Muscle analysis (GUI) using just the new control and state files I have got from my FD simulation to check the muscle forces produced. But I ran into the same problem of velocity (stage). I didnt use the calPower() function in my c code, so used the
osimModel.getMultibodySystem().realize(s, Stage::Velocity); and got the following error in GUI.
Or, is it that I have to run MuscleAnalysis via coding to avoid this problem?
my inputs for testing:
Storage: file=C:\OpenSimWorkspace\sdk\APIExamples\Mult_prescribedC\New\Release\NewControls.sto (nr=973 nc=3)
Loading states from file C:\OpenSimWorkspace\sdk\APIExamples\Mult_prescribedC\New\Release\NewStates.sto.
Storage: file=C:\OpenSimWorkspace\sdk\APIExamples\Mult_prescribedC\New\Release\NewStates.sto (nr=973 nc=61)
Found 973 state vectors with time stamps ranging from 0 to 1.
Storage: file=C:\OpenSimWorkspace\sdk\APIExamples\Mult_prescribedC\New\Release\NewControls.sto (nr=973 nc=3)
No external loads will be applied (external loads file not specified).
Storage: file=C:\OpenSimWorkspace\sdk\APIExamples\Mult_prescribedC\New\Release\NewControls.sto (nr=973 nc=3)
Executing the analyses from 0 to 1...
WARNING- MuscleAnalysis::record() unable to evaluate muscle forces at time 0 for reason: SimTK Exception thrown at State.cpp:2069:
Expected stage to be at least Dynamics in StateImpl::getCacheEntry() but current stage was Velocity
WARNING- MuscleAnalysis::record() unable to evaluate muscle forces at time 1.322e-005 for reason: SimTK Exception thrown at State.cpp:2069:
Expected stage to be at least Dynamics in StateImpl::getCacheEntry() but current stage was Velocity
WARNING- MuscleAnalysis::record() unable to evaluate muscle forces at time 3.298e-005 for reason: SimTK Exception thrown at State.cpp:2069:
Expected stage to be at least Dynamics in StateImpl::getCacheEntry() but current stage was Velocity
The output I got:
MuscleAnalysis_ActiveFiberForce, MuscleAnalysis_ActiveFiberlength, length, Passivefibreforcealong tendon, tendonforce, tendonlength.
Didnt get:
Moment arms of muscles, moments, PennationAngular velocity, Non of the power components for tendon and muscle,
Then, I tried to run my FD with osimModel.getMultibodySystem().realize(s) [ Not needed since I am not measuring any power]; Eventhough I didnt get any error in the GUI as shown above still the Actuator power, moment etc were not calculated.
I tried to run the force reporter , it works -as attached.
Please let me know if I am doing something wrong.
Thanking you,
Nithin