What is the difference between path constraints and kinematic constraints?

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
Chonghui Zhang
Posts: 10
Joined: Wed May 19, 2021 1:58 am

What is the difference between path constraints and kinematic constraints?

Post by Chonghui Zhang » Fri Apr 08, 2022 2:29 am

Hi everyone,

I am a newcomer to the optimal control theory and the amazing tool of OpenSim Moco. I find there are two class of OpenSim::MocoPathConstraint and OpenSim::Constraint which can add constraints to a problem. The difference between them confuse me.

There is a constraint named WeldConstraint in the class of OpenSim::Constraint which constraint six DoFs of a joint. If I customize a weld constraint in the class of OpenSim::MocoPathConstraint, would it make a change to the prediction?

Thanks,
Chonghui

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

Re: What is the difference between path constraints and kinematic constraints?

Post by Pasha van Bijlert » Fri Apr 08, 2022 4:28 am

Hi Chongui,

The terminology is a bit confusing. OpenSim::Constraint can essentially be thought of as adding an extra component to your model, that enforces a desired constraint by adding constraint forces (which can either be actual forces, or torques, depending on the type of joint you are constraining). So in the case of a WeldConstraint, you can think of it acting as a kneebrace, preventing flexion at the joint. As an aside, if you're interested in a WeldConstraint, I think I remember reading somewhere that you'd be better-off replacing the joint with a WeldJoint instead.

MocoPathConstraint is not a physical constraint on your model. Instead, it's a constraint on the movement (coordination) you would like to find after an optimization. This assumes that the model has enough controllable degrees of freedom to produce this movement, so you could also think of it as a constraint on the control space/ coordination of the movement. For example - I may want to keep the distance between the two knees above 10 cm throughout a walk cycle, even though the model is perfectly capable of them meeting at the midline. There are no external (constraint) forces involved, the optimizer is looking for solutions where you abide by your goal within the confines of the unmodified model.

Hope this helps!

Cheers,
Pasha

User avatar
Chonghui Zhang
Posts: 10
Joined: Wed May 19, 2021 1:58 am

Re: What is the difference between path constraints and kinematic constraints?

Post by Chonghui Zhang » Sat Apr 09, 2022 7:37 am

Hi Pasha,

Thanks for your detailed reply. Your examples make me better understand the difference. OpenSim::Constraint will add a constraint force, so it may affect the dynamics of the multibody system? If so, I think that we should choose OpenSim::Constraint or OpenSim::MocoPathConstraint carefully when we wanna add a constraint.

Thanks,
Chonghui

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

Re: What is the difference between path constraints and kinematic constraints?

Post by Pasha van Bijlert » Mon Apr 11, 2022 9:04 am

Hi Chongui,

Yes, adding OpenSim::Constraint will add constraint forces, so you are changing the multibody system itself, before simulating it.

Opensim::MocoPathConstraint will limit the search space/possible solutions of the simulation, without changing the multibody system.

Cheers,
Pasha

POST REPLY