Hi everyone!
I'm working on a project, and I need some advice. I want to group muscles in a specific area to share the same activation. Is there a way to do this in OpenSim Moco, or does it need to be handled in OpenSim itself (by modelling)?
For example, my model has two muscles: the rectus femoris and the vastus lateralis. Each muscle has its activation variable, so when I run MocoInverse, I get separate results for each muscle. I want to combine these two muscles into one group - let's call it 'quadriceps' - so that there is just one activation variable for the entire group, and I get a unified solution.
Does anyone know how to achieve this in Moco, or are there any constraints or techniques that might help?
Thanks in advance for any suggestions!
Grouping muscle activations
- Pasha van Bijlert
- Posts: 219
- Joined: Sun May 10, 2020 3:15 am
Re: Grouping muscle activations
Hi Ana,
If you load a model into a problem that you solve with Moco, I think Moco automatically adds a controller to each actuator that doesn't already have one. I think if you first manually define a controller, then add the muscles you want it to control, you circumvent this. The code would look something like this (but I haven't tested it):
You may have to SafeDownCast the muscles first, and/or check whether the other (uncontrolled) actuators still get their own controller automatically.
Cheers,
Pasha
If you load a model into a problem that you solve with Moco, I think Moco automatically adds a controller to each actuator that doesn't already have one. I think if you first manually define a controller, then add the muscles you want it to control, you circumvent this. The code would look something like this (but I haven't tested it):
Code: Select all
mycontroller = Controller()
mycontroller.setActuator(muscle_one)
mycontroller.setActuator(muscle_two)
model.addController(mycontroller)
model.initSystem()
Cheers,
Pasha