Page 1 of 1

calculate constraint forces

Posted: Fri Nov 20, 2015 7:00 am
by bjdekruif
Hello,

I have added an exoskeleton (ES) in my model and constraint its movements by means of a PointConstraint. I could implement this rather quickly, and I can actuate the joint and skeleton as I want. A big thanks for all the time the developers have put into OpenSim!

The next step would be to actuate the ES motor based on the force between the ES and the human, which is the constraint force. The UserFunctions in the DynamicWalingStarter illustrates how you can implement a controller in Matlab by means of a control handle. However, in their example they use the joint angle as input and not a constraint force.

Would it be possible to get the constraint forces at any time step in a similar fashion?
Or, nearly the same, if I connect the ES with a Bushing force, can I get these forces/torques?

I found that I can add a ForceReporter in the Analyze tool which gives me the constraint forces, but this seems to give the values only after the simulation.

Thanks in advance for your time
Bas

Re: calculate constraint forces

Posted: Thu Nov 26, 2015 2:29 am
by bjdekruif
Hello all,

In the Simbody documentation I could find that I can calculate the forces:
https://simtk.org/api_docs/simbody/late ... 8ae29f5134

However, it seems that I cannot access them from Matlab?
I expected to access them with:

Code: Select all

c = osimModel.getConstraintSet.get(0);
F = c.getConstrainedBodyForcesAsVector(osimState)
but this gives me an error that the method does not exist.

Can this method be accessed from Matlab with such an API call, or do I need to go to C?

Thanks again
Bas