Page 1 of 1

Torque Actuator

Posted: Wed Mar 31, 2010 5:48 pm
by ambaus
How can I apply a torque actuator (say T = k*coordinate) without writing a plugin? The C++ code is really complicated and the plugin examples are difficult to follow. Any help would be appreciated. There was another post on this that said OpenSim 2.0 might have this capability.

RE: Torque Actuator

Posted: Wed Mar 31, 2010 9:36 pm
by aymanh
Anne,

According to the Doxygen documentation, there's a SpringGeneralizedForce class that you can use. You may add an object of this type to a model programmatically in a plugin/main or add it to an XML file that contains Forces/ForceSet. The Doxygen documentation is at
https://simtk.org/api_docs/opensim/api_docs20b/

Good Luck,
-Ayman

RE: Torque Actuator

Posted: Wed Mar 31, 2010 9:45 pm
by aymanh
Anne,

Wanted to mention that depending on what you want, you may also want to consider an OpenSim::TorqueActuator. In that case, however, you'll have to provide a "control" signal to it since it's an Actuator (rather than a Force).

Documentation is in the sane place and we use this in the input files for some of our examples I believe.

-Ayman

RE: Torque Actuator

Posted: Wed Mar 31, 2010 9:55 pm
by ambaus
Torque Actuator is in the examples as a default but it doesn't show how to call it. I think I need the generalized spring force, but I'm not sure how to put it in the .xml or .osim. Any examples I can look at on how to 'call' it in my model file?

RE: Torque Actuator

Posted: Thu Apr 01, 2010 9:22 am
by ambaus
I think I figured out how to add SpringGeneralizedForce. However, I'm not sure how to find in the documentation how this actuator computes the forces to apply. Since it's a spring, is it F = stiffness*(coord-restlength)?

RE: Torque Actuator

Posted: Thu Apr 01, 2010 9:55 am
by ambaus
I added it to my .osim file at the end as an 'actuator'. However, it doesn't show up in the GUI in the forces tab. How do I know I have added this torsional spring?