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
realizeVelocity not in OpenSim3.3
- Kaiwen Yang
- Posts: 45
- Joined: Mon Sep 03, 2018 11:25 am
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: realizeVelocity not in OpenSim3.3
Code: Select all
model.getMultibodySystem().realize(state, SimTK::Stage::Velocity);
- Kaiwen Yang
- Posts: 45
- Joined: Mon Sep 03, 2018 11:25 am
Re: realizeVelocity not in OpenSim3.3
Thank you!
- Kaiwen Yang
- Posts: 45
- Joined: Mon Sep 03, 2018 11:25 am
Re: realizeVelocity not in OpenSim3.3
Thanks for the reply, but it seems that 'SimTK::Stage::Velocity' is not valid in Matlab.
- Thomas Uchida
- Posts: 1804
- Joined: Wed May 16, 2012 11:40 am
Re: realizeVelocity not in OpenSim3.3
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).
- Kaiwen Yang
- Posts: 45
- Joined: Mon Sep 03, 2018 11:25 am
Re: realizeVelocity not in OpenSim3.3
Thank you!