realizeVelocity not in OpenSim3.3

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Kaiwen Yang
Posts: 45
Joined: Mon Sep 03, 2018 11:25 am

realizeVelocity not in OpenSim3.3

Post by Kaiwen Yang » Tue Jan 15, 2019 4:04 pm

Hello,

I am a new user of OpenSim API. I am trying to run (modify) a piece of code intended for 4.0 in Matlab which binded with my OpenSim 3.3. The main issue is that the function 'realizeVelocity' is not defined in 3.3 library. What is the substitute for 'realizeVelocity' if I am trying to make the code run for 3.3?

Kaiwen

Tags:

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: realizeVelocity not in OpenSim3.3

Post by Dimitar Stanev » Wed Jan 16, 2019 2:00 am

Code: Select all

model.getMultibodySystem().realize(state, SimTK::Stage::Velocity);

User avatar
Kaiwen Yang
Posts: 45
Joined: Mon Sep 03, 2018 11:25 am

Re: realizeVelocity not in OpenSim3.3

Post by Kaiwen Yang » Wed Jan 16, 2019 8:12 am

Thank you!

User avatar
Kaiwen Yang
Posts: 45
Joined: Mon Sep 03, 2018 11:25 am

Re: realizeVelocity not in OpenSim3.3

Post by Kaiwen Yang » Wed Jan 16, 2019 8:41 am

Thanks for the reply, but it seems that 'SimTK::Stage::Velocity' is not valid in Matlab.

User avatar
Thomas Uchida
Posts: 1804
Joined: Wed May 16, 2012 11:40 am

Re: realizeVelocity not in OpenSim3.3

Post by Thomas Uchida » Wed Jan 16, 2019 5:27 pm

In OpenSim 3.3, you can use myModel.computeStateVariableDerivatives(myState) (https://simtk.org/api_docs/opensim/api_ ... 3dc9c41d17), which will "realize" under the hood. There are some example scripts here that might be helpful: https://simtk.org/frs/download.php?file_id=3862 (see, e.g., "Main_WalkerForwardSim.m" in the UserFunctions directory).

User avatar
Kaiwen Yang
Posts: 45
Joined: Mon Sep 03, 2018 11:25 am

Re: realizeVelocity not in OpenSim3.3

Post by Kaiwen Yang » Wed Jan 16, 2019 8:02 pm

Thank you!

POST REPLY