OpenSim muscles: Get torque contribution instead of applying force


#1

I am trying to set up a system for virtual muscles (similar to Van Der Noot 2018 - https://doi.org/10.1177/0278364917743320 )
This requires that I can simulate muscles as normally, based on current joint positions and including activation dynamics and what not and calculating their tension.
However, instead of letting this tension apply force directly to the links at their attachments, I have to extract their torque contributions at each joint, and ‘manually’ apply this torque to get the model to move.

Is this possible through the current implementation of OpenSim muscles or would it require some or significant changes?

Cheers and thanks in advance


#2

Dear Jakob,

Although what you depict seems feasible, the current architecture of our OpenSim - Gazebo integration in the NRP does not allow it in a straightforward way. Nevertheless, I invite you to feel a feature request if you feel this could be benefit a reseasonably wide user community.

Best regards,
Luc


#3

Hello, Jakob!

If I understand correctly, you want to use a muscle system, but you need to suppress the application of the resulting forces and torques induced by the muscle system to your underlying kinematic structure.

This is possible in principle: In the internal API of OpenSim itself, the resulting forces from muscle instances are applied to corresponding SimBody rigid body instances/constraints. It is by default not possible to switch this off, but it could theoretically be added as an option.
But as @lguyot pointed out in his answer, this is not currently possible with the NRP, because such a “deactivation” option for muscle dynamics isn’t currently implemented in the OpenSim plugin for Gazebo and/or the OpenSim fork the NRP uses.

Thank you very much!
With best regards,
Fabian


#4

Hi @lguyot and @faichele,

Thank you for your replies!
@faichele, you are right and I have now filed a feature request (On Atlassian, not bitbucket? - Bitbucket says this when I try to submit anything: “This issue tracker is obsolete. Please use https://hbpneurorobotics.atlassian.net”)
Feature request can be found here: https://hbpneurorobotics.atlassian.net/browse/NUIT-34

The feature I’ve described is at the heart of my project so I initially intended to implement the muscle system myself, from scratch. However, seeing how I struggled with only the simple aspects of it (coloring the muscles) then I will probably choose a path that doesn’t involve this feature anyway, for now.

With that said, I believe it is quite an important feature for any bio-inspired motor control system that seeks to run on a robotic platform, so I would say that it is well worth some effort.

Finally: Can you dare to make an estimate of how troublesome it would be to implement this? I may attempt it myself if you are optimistic about it :slight_smile:

Cheers and thanks for all your help


#5

Hello, Jakob!

A “deactivation” switch for OpenSim muscles has one critical issue: The muscles depend on dynamics data from the kinematic hierarchy “underneath” for calculating their own dynamics. Suppressing the “back-propagation” of resulting forces/torques exerted by muscles to the kinematic hierarchy is rather simple.
However, the “forward-propagation” of the kinematic hierarchies’ force and torque values in its constraints to muscle instances (this would also be the API hook for your custom constraint control) would be a bit more tricky to get working. It would need to decouple the tight integration between SimBody’s rigid body system and OpenSim’s muscle instances.
I would estimate somewhere between 1.5 and 2.5 man months for this feature given basic familiarity with OpenSim’s and SimBody’s internals, 3 to 4 otherwise.

Thank you very much!
With best regards,
Fabian


#6

Alright, I see. That definitely rules out my attempt :slight_smile: Thanks for the heads up!