Page 1 of 1

Custom Muscle Plugin is displayed/considered as Actuator

Posted: Sun May 22, 2022 7:29 am
by soheil2021
Hi all,

I managed to create a custom muscle as a plugin, I called it BMillard2012EquilibriumMuscle (as it has most of the Millard2012EquilibriumMuscle behaviour). I successfully loaded it into OpenSim UI and created an .osim file which has a number of muscles of this type.
I noticed that in OpenSim UI the muscles of this type are categorised as Actuator not as Muscle but if I add a Millard2012EquilibriumMuscle muscle, it is categorised as a muscle. Please find the attached screenshot.

I also loaded the plugin into Matlab and started to interact with the model object, but when calling osimModel.getMuscles(), it does not return any muscle of the new type but if I call osimModel.getActuators(), the muscle of the new type are available as Actuator.

Is it the expected behaviour for custom muscle plugin? or have I configured the muscle plugin incorrectly?
I actually need to star the next phase of the project but not sure if the custom model is configured/implemented correctly.
How can validate if the new muscle is correctly implemented? I can access it in C++ and interact with it.

Thank you in advance.

regards,
Soh

Re: Custom Muscle Plugin is displayed/considered as Actuator

Posted: Mon May 23, 2022 12:08 pm
by aymanh
Hello,

The model keeps a cache of Muscles (which is a subset of Actuators returned by get/updMuscles() call) for quick access and that's populated based on how you construct the model, but this has no downstream effect on simulations/functionality. I'd double check having the correct class hierarchy since the GUI tries to cast each Force to a Muscle to decide where to show it in the navigator, if that's correct (you subclass Muscle) then you should be good to go.

Hope this helps,
-Ayman