Custom getExcitation method for a muscle
Posted: Sun May 15, 2022 2:28 pm
Hi there,
I'm new to OpenSim and currently working on a project related to Synergy Optimization techniques.
I actually need to define a custom Excitation (getExcitation method) for a muscle. I managed to define a custom muscle based on FatigableMuscle example but I need to customise the getExcitation method and calculate the excitation based on some Synergy Optimization technique. As far as I noticed, getExcitation method is not a virtual method in Muscle class, so I can't override it:
I was wondering how I can add a customised Excitation for a muscle? Is it right to add a new custom muscle class?
I also noticed that getExcitaion calls getControl(s) which is a virtual method in Actuator class, but I'm not sure if this is the right solution to define a custom Actuator and then inherit a new muscle class from the custom Actuator.
Please advise if there are any solutions for this.
Thanks in advance.
Soh
I'm new to OpenSim and currently working on a project related to Synergy Optimization techniques.
I actually need to define a custom Excitation (getExcitation method) for a muscle. I managed to define a custom muscle based on FatigableMuscle example but I need to customise the getExcitation method and calculate the excitation based on some Synergy Optimization technique. As far as I noticed, getExcitation method is not a virtual method in Muscle class, so I can't override it:
Code: Select all
double Muscle::getExcitation( const SimTK::State& s) const {
return( getControl(s) );
}
I also noticed that getExcitaion calls getControl(s) which is a virtual method in Actuator class, but I'm not sure if this is the right solution to define a custom Actuator and then inherit a new muscle class from the custom Actuator.
Please advise if there are any solutions for this.
Thanks in advance.
Soh