Hi there,
I tried to set the muscle excitation through Matlab, and read the knee angle from Matlab as well. I went through the OpenSim API documentation, and used "Muscle.setExcitation()" and "Joint.get_coordinates ('Joint Name')" respectively. However, none of these command works. The system just told me something like "No method 'setExcitation' with matching signature found for class 'org.opensim.modeling.Muscle'.". Could anyone help me with it? Thank you so much!
Set Muscle Excitation through Matlab
- Zhenwei Liu
- Posts: 6
- Joined: Sat Sep 15, 2018 7:03 pm
Re: Set Muscle Excitation through Matlab
Hi Zhenwei,
While not directly answering your question, I've found using the 'methods' and 'methodsview' commands in Matlab useful for troubleshooting these "No method '...' with matching signature found for class '...'" sort of problems. You could check out 'methods Muscle' or 'methodsview Muscle' and this show you a list of the available commands and their inputs/outputs. This might help you find the appropriate method for setting the muscle excitation.
Hope it helps,
Aaron
While not directly answering your question, I've found using the 'methods' and 'methodsview' commands in Matlab useful for troubleshooting these "No method '...' with matching signature found for class '...'" sort of problems. You could check out 'methods Muscle' or 'methodsview Muscle' and this show you a list of the available commands and their inputs/outputs. This might help you find the appropriate method for setting the muscle excitation.
Hope it helps,
Aaron
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Set Muscle Excitation through Matlab
Hi,
Controlling the muscle excitation is typically performed through a controller. Despite that there is a setExcitation method, currently it is not working as you might think (its use is different). Please look at the following example:
https://github.com/opensim-org/opensim- ... del.py#L99
where a PrescribedController is being used. If this controller is not appropriate for you task then you may need to implement your own controller through the C++ API and create a plugin that will be loaded by Matlab.
More on plugins: https://simtk-confluence.stanford.edu/d ... ng+Plugins
Example of task-based muscle controller: https://github.com/mitkof6/task-space/b ... ol.cpp#L68
Example of a Matlab controller: https://simtk.org/projects/opensimmatlab
Controlling the muscle excitation is typically performed through a controller. Despite that there is a setExcitation method, currently it is not working as you might think (its use is different). Please look at the following example:
https://github.com/opensim-org/opensim- ... del.py#L99
where a PrescribedController is being used. If this controller is not appropriate for you task then you may need to implement your own controller through the C++ API and create a plugin that will be loaded by Matlab.
More on plugins: https://simtk-confluence.stanford.edu/d ... ng+Plugins
Example of task-based muscle controller: https://github.com/mitkof6/task-space/b ... ol.cpp#L68
Example of a Matlab controller: https://simtk.org/projects/opensimmatlab