calculate constraint forces

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Bas de Kruif
Posts: 7
Joined: Tue Sep 15, 2015 4:28 am

calculate constraint forces

Post by Bas de Kruif » Fri Nov 20, 2015 7:00 am

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

User avatar
Bas de Kruif
Posts: 7
Joined: Tue Sep 15, 2015 4:28 am

Re: calculate constraint forces

Post by Bas de Kruif » Thu Nov 26, 2015 2:29 am

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

POST REPLY