I'm trying to compile a custom muscle model class with OpenSim 4.0 API but it seems it doesn't add two subcomponents related to the main class.
I used this: https://simtk.org/projects/afferents
This muscle extends Millard2012EquilibriumMuscle class and it adds two subcomponents which extend ModelComponent class.
My questions are:
1. For subcomponents class, I have to override ModelComponent methods calling Super::method() within them or it's useless?
2. For main component class, I can execute adoptSubComponent() method in the constructor for each subcomponent or I should use a different approach?
With these choices, It seems I can't load this muscle model in MATLAB as a plugin. It returns this error:
Code: Select all
Java exception occurred:
java.io.IOException: Model::equilibrateMuscles() Component has no underlying System.
You must call initSystem() on the top-level Component (i.e. Model) first.
In Object '<no-name>' of type Mileusnic06Spindle.
Thrown at component.cpp:798 in getStateVariableValue().
at org.opensim.modeling.opensimActuatorsAnalysesToolsJNI.ForwardTool_run(Native Method)
at org.opensim.modeling.ForwardTool.run(ForwardTool.java:117)