Page 1 of 1

How to add and compile a new Muscle

Posted: Wed Oct 10, 2018 8:02 am
by aparziale
Dear all,

We are interested in creating a new muscle model and using it in some of upper-arm musculoskeletal models available on simtk.
In particular, we have downloaded the Muscle class available on https://simtk.org/projects/afferents, which extends the default Millard model, and we want to use this model instead of the classical one.
It is not clear for us if we have to put the new cpp classes in the directory "opensim-core" and then to compile as usual for generation the directory "opensim-install" or if we have to follow another procedure.
We tried to compile the new cpp classes together with opensim but we experienced some issues in the process: some libs are required and not found.
Any suggestion?
Thanks and Best regards
Lin02GolgiTendonOrgan.obj : error LNK2019: unresolved external symbol __imp_RegisterTypes_osimAnalyses non r
isolto nella funzione "void __cdecl `dynamic initializer for 'instantiator''(void)" (??__Einstantiator@@YAXXZ) [
C:\opensim-build\OpenSim\Actuators\osimActuators.vcxproj]
Mileusnic06Spindle.obj : error LNK2001: simbolo esterno __imp_RegisterTypes_osimAnalyses non risolto [C:\opensim
-build\OpenSim\Actuators\osimActuators.vcxproj]
Millard12EqMuscleWithAfferents.obj : error LNK2001: simbolo esterno __imp_RegisterTypes_osimAnalyses non risolto
[C:\opensim-build\OpenSim\Actuators\osimActuators.vcxproj]
Lin02GolgiTendonOrgan.obj : error LNK2019: riferimento al simbolo esterno __imp_RegisterTypes_osimTools non riso
lto nella funzione "void __cdecl `dynamic initializer for 'instantiator''(void)" (??__Einstantiator@@YAXXZ) [C:\
opensim-build\OpenSim\Actuators\osimActuators.vcxproj]
Mileusnic06Spindle.obj : error LNK2001: simbolo esterno __imp_RegisterTypes_osimTools non risolto [C:\opensim-bu
ild\OpenSim\Actuators\osimActuators.vcxproj]
Millard12EqMuscleWithAfferents.obj : error LNK2001: simbolo esterno __imp_RegisterTypes_osimTools non risolto [C
:\opensim-build\OpenSim\Actuators\osimActuators.vcxproj]
C:\opensim-build\RelWithDebInfo\osimActuators.dll : fatal error LNK1120: 2 esterni non risolti [C:\opensim-build
\OpenSim\Actuators\osimActuators.vcxproj]


"C:\opensim-build\ALL_BUILD.vcxproj" (destinazione predefinita) (1) ->
"C:\opensim-build\Bindings\Java\JavaBindings.vcxproj" (destinazione predefinita) (3) ->
"C:\opensim-build\Bindings\Java\OpenSimJNI\osimJavaJNI.vcxproj" (destinazione predefinita) (12) ->
"C:\opensim-build\OpenSim\Actuators\osimActuators.vcxproj" (destinazione predefinita) (22) ->
(destinazione: Link) ->
Lin02GolgiTendonOrgan.obj : error LNK2019: riferimento al simbolo esterno __imp_RegisterTypes_osimAnalyses non
risolto nella funzione "void __cdecl `dynamic initializer for 'instantiator''(void)" (??__Einstantiator@@YAXXZ)
[C:\opensim-build\OpenSim\Actuators\osimActuators.vcxproj]
Mileusnic06Spindle.obj : error LNK2001: simbolo esterno __imp_RegisterTypes_osimAnalyses non risolto [C:\opens
im-build\OpenSim\Actuators\osimActuators.vcxproj]
Millard12EqMuscleWithAfferents.obj : error LNK2001: simbolo esterno __imp_RegisterTypes_osimAnalyses non risol
to [C:\opensim-build\OpenSim\Actuators\osimActuators.vcxproj]
Lin02GolgiTendonOrgan.obj : error LNK2019: riferimento al simbolo esterno __imp_RegisterTypes_osimTools non ri
solto nella funzione "void __cdecl `dynamic initializer for 'instantiator''(void)" (??__Einstantiator@@YAXXZ) [C
:\opensim-build\OpenSim\Actuators\osimActuators.vcxproj]
Mileusnic06Spindle.obj : error LNK2001: simbolo esterno __imp_RegisterTypes_osimTools non risolto [C:\opensim-
build\OpenSim\Actuators\osimActuators.vcxproj]
Millard12EqMuscleWithAfferents.obj : error LNK2001: simbolo esterno __imp_RegisterTypes_osimTools non risolto
[C:\opensim-build\OpenSim\Actuators\osimActuators.vcxproj]
C:\opensim-build\RelWithDebInfo\osimActuators.dll : fatal error LNK1120: 2 esterni non risolti [C:\opensim-bui
ld\OpenSim\Actuators\osimActuators.vcxproj]

Re: How to add and compile a new Muscle

Posted: Thu Oct 11, 2018 5:03 am
by jimmy
There are examples of how to build new classes on the confluence website; https://simtk-confluence.stanford.edu:8 ... I+Examples

Re: How to add and compile a new Muscle

Posted: Thu Oct 11, 2018 8:40 am
by aparziale
Dear James,

thank you for your response.
Unfortunately, my question was not clear.

My problem is the following: I developed a new Muscle Model by extending the standard Millard Model and I want to use it in one of the musculoskeletal model available on simtk. If I want to import an osim model in C++ I have to write "Model* m_model=new Model("arm.osim")"
How can i simulate m_model by using my own muscle model?
The first step is to change the muscle name in arm.osim but then the class Model is not able to load my muscle model because it doesn't belong to the standard actuators provided by OpenSim.
So the question is "How to add a new muscle model and continue to use the class Model?"

Thanks, Antonio

Re: How to add and compile a new Muscle

Posted: Thu Oct 11, 2018 8:48 am
by aparziale
I think the answer is "to create a plugin" :oops: