Page 1 of 1

Opensim And Matlab

Posted: Fri Aug 21, 2020 11:57 pm
by mec_amini
Hi guys

I want to define controller by model controls that created. I wrote this code:
modelcontrols = Model.getDefaultControls;
Tkr = Vector(1, Tkr);
Model.getActuators.get("knee_motor_r").addInControls(Tkr,modelcontrols)
Model.setDefaultControls(modelcontrols)

Now I try to add this controller to model. first i should derive our controller from Controller. next by addController atach the controller to the model. I define this code:

kk = ControlSetController();
kk.setControlSet(modelcontrols)
kk.setActuators(Model.updActuators());
Model.addController(kk)
but this is wrong. Please guide me