Code: Select all
ForceSet forces = _model->getForceSet();
Code: Select all
_model->getMultibodySystem().realize(s, SimTK::Stage::Dynamics);
Array<double> F = _model->getForceSet().get(index).getRecordValues(s)
Code: Select all
ForceSet forces = _model->getForceSet();
Code: Select all
_model->getMultibodySystem().realize(s, SimTK::Stage::Dynamics);
Array<double> F = _model->getForceSet().get(index).getRecordValues(s)
This was definitely very helpful. But I noticed that when I try to realize to the state to the Dynamic stage, the program crashes and when I go line by line on the debugger, it keeps looping back once I get this line:Maybe something to try is to avoid any copying to intermediate variables, so your ForceValue() function looks something like this:
CODE: SELECT ALL
_model->getMultibodySystem().realize(s, SimTK::Stage::Dynamics);
Array<double> F = _model->getForceSet().get(index).getRecordValues(s)
Code: Select all
_model->getMultibodySystem().realize(s, SimTK::Stage::Dynamics);
Code: Select all
realizedDynamics
Code: Select all
computeControls
Code: Select all
Controller::computeControls