Pelvis mobility forces = 0 - not correct

The 2018 Fall Virtual Workshop will bring together a group of international scholars and OpenSim experts to help each other advance their research using modeling and simulation. This forum is a place to accelerate OpenSim based projects while also buildin
POST REPLY
User avatar
Nicos Haralabidis
Posts: 196
Joined: Tue Aug 16, 2016 1:46 am

Pelvis mobility forces = 0 - not correct

Post by Nicos Haralabidis » Sun Oct 28, 2018 11:22 am

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

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

Re: Pelvis mobility forces = 0 - not correct

Post by Thomas Uchida » Sun Oct 28, 2018 12:32 pm

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).

User avatar
Nicos Haralabidis
Posts: 196
Joined: Tue Aug 16, 2016 1:46 am

Re: Pelvis mobility forces = 0 - not correct

Post by Nicos Haralabidis » Sun Oct 28, 2018 3:42 pm

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

POST REPLY