CoordinateCouplerConstraint

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Pasha van Bijlert
Posts: 226
Joined: Sun May 10, 2020 3:15 am

CoordinateCouplerConstraint

Post by Pasha van Bijlert » Fri Jun 24, 2022 7:12 am

Hi all,

I'm looking to add a component to my model that acts as a kinematic constraint - when a muscle flexes the ankle joint, I want the toe joint to flex as well (preferably with a weighted mapping, where a degree of ankle flexion causes more than a degree of toe flexion). The toe itself will not be actuated, so the muscles crossing the ankle are now also controlling the toe angle.

I think CoordinateCouplerConstraint does exactly this, but I was wondering if someone has used it in Moco to this effect? I think Carlos used it to enforce bilateral symmetry - but that's not the same as what I'm doing. Is this the best way to implement what I'm after?

Cheers,
Pasha

User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: CoordinateCouplerConstraint

Post by Ross Miller » Fri Jun 24, 2022 9:59 am

Would a PathSpring work?

Ross

User avatar
Pasha van Bijlert
Posts: 226
Joined: Sun May 10, 2020 3:15 am

Re: CoordinateCouplerConstraint

Post by Pasha van Bijlert » Mon Jun 27, 2022 6:45 am

Hi Ross,

I think that would only work if I add two of them, right? One for flexing the toe joints, & one for extending the toe joints? I wonder if I might run into slack length issues there.

Cheers,
Pasha

User avatar
Nicholas Bianco
Posts: 1041
Joined: Thu Oct 04, 2012 8:09 pm

Re: CoordinateCouplerConstraint

Post by Nicholas Bianco » Mon Jun 27, 2022 9:57 am

Hi Pasha,

Yes, a CoordinateCouplerConstraint should work fine for this application. If you want a weighted mapping between the ankle and toe joint, you could could use a CustomJoint to define the toe joint rotation as a function of the toe coordinate to prescribe whatever behavior you want.

-Nick

User avatar
Pasha van Bijlert
Posts: 226
Joined: Sun May 10, 2020 3:15 am

Re: CoordinateCouplerConstraint

Post by Pasha van Bijlert » Mon Jul 04, 2022 4:16 am

Hi Nick,

Did you mean "toe joint rotation as a function of the ankle joint coordinate" ? I hadn't thought of that, this essentially is another way of kinematically constraining the toe joint to a different coordinate, isn't it?

Cheers,
Pasha

User avatar
Nicholas Bianco
Posts: 1041
Joined: Thu Oct 04, 2012 8:09 pm

Re: CoordinateCouplerConstraint

Post by Nicholas Bianco » Tue Jul 05, 2022 10:42 am

Hi Pasha,

No, what I wrote is correct. A CoordinateCouplerConstraint will only allow two coordinates to have equal values, so you can't create the weighted mapping you need with this constraint alone.

What I'm suggesting is to 1) implement the constraint between the toe and ankle coordinates, and then 2) define the toe joint to rotate based on the toe coordinate with whatever mapping you want. With a CustomJoint, the toe rotation can be a function of the toe coordinate, and this function can be whatever you need it to be to create the mapping you want.

Check out the knee joint of the Rajagopal model to see what I'm walking about. Rather than a spline, you could probably use a linear function to get motion you need.

-Nick

User avatar
Pasha van Bijlert
Posts: 226
Joined: Sun May 10, 2020 3:15 am

Re: CoordinateCouplerConstraint

Post by Pasha van Bijlert » Wed Jul 06, 2022 2:23 pm

Hi Nick,

Thanks for elaborating. Maybe this is a recent addition, but CoordinateCouplerConstraint allows the user to define a linear function, and by choosing a slope that isn't 1, you get a non-one-to-one mapping between the coordinates (e.g. a slope of 2 gives me double the toe flexion for each degree of ankle flexion).

I'll have a look at the Rajagopal model nonetheless, maybe I can learn something from the model.

Cheers,
Pasha

User avatar
Carlos Gonçalves
Posts: 135
Joined: Wed Jun 08, 2016 4:56 am

Re: CoordinateCouplerConstraint

Post by Carlos Gonçalves » Tue Aug 02, 2022 4:55 pm

Hello Pasha,

I'm coming back to study MOCO for my simulations ... catching the train late this time ...

The CoordinateCouplerConstraints really do the trick with you don't mind the constraint forces that will appear. Nowadays I'm getting by without using them because my jumps tend to go higher if the legs work symmetrically.

Just a tip, as much as I like to automate the processing with Python, I used to edit the .osim file directly with a text editor. When in doubt, I often go to OpenSim GUI, click Help -> XML Browser and copy the text to edit later.

I once used this CoordinateCouplerConstraints to ensure that a gait trial (without torso markers) could be used (or forced) for CMC for muscle force analysis. I used the constraints to maintain the torso upright.

Best regards.

POST REPLY