Page 1 of 1

Pelvis mobility forces = 0 - not correct

Posted: Sun Oct 28, 2018 11:22 am
by nicos1993
Hi all,

I have 31 coordinate actuators - getMobilityForces vector returns values as expected after I have set the controls for these DoFs.

I have 3 torque and 3 point actuators for the 6 pelvis DoFs - getMobilityForces vector returns zeros after I have set the controls for these DoFs - these values should be non-zero.

Does anyone have any idea why this?

Code:
PrescribedController* controller = dynamic_cast<PrescribedController*>(&controllerSet.get(0));

for (int index = 0; index < nActuators; index++)
{
controller->prescribeControlForActuator(index, new Constant(control_vars[index]));
}

myModel.updMultibodySystem().realize(myState, Stage::Dynamics);
const Vector& mf = myModel.getMultibodySystem().getMobilityForces(myState, Stage::Dynamics);


getMobilityForces output:
~[0 0 0 0 0 0 -91.3713 -2.58656 0.363775 -55.033 -2.32601 1.35196 0.134994 90.2715 -16.3504 3.61922 27.1173 4.19173 -0.861287 0.159846 -3.82231 -12.908 22.5087 4.61437 -2.798 0.228085 2.42431 -0.238017 0.147474 -0.382614 -1.90044 1.48016 0.534239 -0.437608 0.0226138 0.120517 0.00314895]

Thanks,

Nicos

Re: Pelvis mobility forces = 0 - not correct

Posted: Sun Oct 28, 2018 12:32 pm
by tkuchida
There are several examples that use prescribeControlForActuator() (https://github.com/opensim-org/opensim-core; search for "prescribeControlForActuator"); you could try following one of those examples if possible (see, e.g., https://github.com/opensim-org/opensim- ... e.cpp#L768).

Re: Pelvis mobility forces = 0 - not correct

Posted: Sun Oct 28, 2018 3:42 pm
by nicos1993
Hello Thomas,

Thank you for sharing the examples. I have looked through them and compared with my code for prescribing actuator control - they seem to match up.

Do you think it has anything to do with the type of actuator? Those actuators are the pelvis residual actuators.

Thanks,

Nicos