I have played around with this a little bit but I can't seem to decide on a nice, scalable method to implement it. I tried creating a derived class of a muscle (e.g. Thelen2003Muscle) and re-implementing functions such getLength(), but found that this didn't work. My intuition is that tools are getting the muscle-tendon lengths by referencing the GeometryPath inside of PathActuator and obtaining it from there, hence bypassing my derived class's function.
Based on this I want to try a new approach but seek your comments/ideas beforehand.
My Approach
Create a derived "GeometryPath" class that reimplements the getLength(), getLengtheningSpeed(), addInEquivalentForces(), computeMomentArm() functions using the approximation methods. Then, replace the GeometryPath object in the muscle with this new derived one.
Questions
- Will this work? I have little experience with polymorphism and I assume it falls into this category.
- Are there any other functions I would need to reimplement to make OpenSim tools such ID, FD, MomentArmSolver agnostic to this plugin?
- If my approach wont work, is a solution to develop a new derived GeometryPath, then a new derived PathActuator that makes use of the derived GeometryPath, then a new derived Muscle that makes use of ..... all the way up to the specific actuator of interest? This seems very tedious, any ideas on how this could be simplified?