Difference joint vs constraint
- Pagnon David
- Posts: 86
- Joined: Mon Jan 06, 2014 3:13 am
Difference joint vs constraint
Hello,
I'm a little confused with OpenSim constraints, and I can't find an answer anywhere:
- Does OpenSim handle soft constraints?
- If not, what is the difference between a joint and a hard constraint? More specifically, between a weld joint and a weld constraint, or a point constraint and a ball joint?
- When should I use one over the other, and why? (I'm only concerned with kinematics in my case)
Thanks!
Reference: https://simtk-confluence.stanford.edu:8 ... Sim+Models
I'm a little confused with OpenSim constraints, and I can't find an answer anywhere:
- Does OpenSim handle soft constraints?
- If not, what is the difference between a joint and a hard constraint? More specifically, between a weld joint and a weld constraint, or a point constraint and a ball joint?
- When should I use one over the other, and why? (I'm only concerned with kinematics in my case)
Thanks!
Reference: https://simtk-confluence.stanford.edu:8 ... Sim+Models
- Pagnon David
- Posts: 86
- Joined: Mon Jan 06, 2014 3:13 am
Re: Difference joint vs constraint
Subsidiary question: Is it possible to assign weights to constraints, in the inverse kinematics tool for example?
I might be missing something, but I feel like it could make a hard constraint become soft?
I might be missing something, but I feel like it could make a hard constraint become soft?
- Thomas Uchida
- Posts: 1797
- Joined: Wed May 16, 2012 11:40 am
Re: Difference joint vs constraint
Please see the Simbody Theory Manual (SimbodyTheoryManual.pdf): https://github.com/simbody/simbody/tree ... imbody/doc. A joint permits relative motion between bodies; a constraint prohibits some or all motion between bodies. Constraints are sometimes used to "break" kinematic loops. Some examples of "soft" constraints in OpenSim are the CoordinateLimitForce (https://simtk.org/api_docs/opensim/api_ ... ml#details) and the BushingForce (https://simtk.org/api_docs/opensim/api_ ... ml#details).
- Michael Sherman
- Posts: 812
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Difference joint vs constraint
Tom beat me to answering and gave a better answer than I would have! (Hi, Tom)
To elaborate a little -- in your example of a Weld joint vs. Weld constraint:
Say we weld body A to body B. With a weld joint, A and B essentially become the same body, with B attached exactly as specified by the joint. There are no additional degrees of freedom and no constraint equations added to the system by the introduction of body B. In contrast, using a weld constraint, A and B are still separate bodies each with their own mobility (could have as many as 6 dofs each). The weld constraint introduces 6 algebraic equations each restricting one of the possible relative motions between A and B. The equations of motion (in terms of body dofs) must be solved such that the constraint equations are satisfied simultaneously (to a tolerance).
Soft connections like the Bushing Tom mentioned are not actually implemented via constraints, but are force elements whose force contributions can be individually determined just from the current state.
Regards,
Sherm
To elaborate a little -- in your example of a Weld joint vs. Weld constraint:
Say we weld body A to body B. With a weld joint, A and B essentially become the same body, with B attached exactly as specified by the joint. There are no additional degrees of freedom and no constraint equations added to the system by the introduction of body B. In contrast, using a weld constraint, A and B are still separate bodies each with their own mobility (could have as many as 6 dofs each). The weld constraint introduces 6 algebraic equations each restricting one of the possible relative motions between A and B. The equations of motion (in terms of body dofs) must be solved such that the constraint equations are satisfied simultaneously (to a tolerance).
Soft connections like the Bushing Tom mentioned are not actually implemented via constraints, but are force elements whose force contributions can be individually determined just from the current state.
Regards,
Sherm
- Pagnon David
- Posts: 86
- Joined: Mon Jan 06, 2014 3:13 am
Re: Difference joint vs constraint
Thank you both! It is clearer now.
I had come across BushingForce, but not CoordinateLimitForce. I have not tested any of them, I guess it is going to be my next step! I can't find any mention of either of them in the Simbody manual, though.
Also, I am curious: to my knowledge kinematics does not consider forces. Will they still be taken into account for IK? Are they a kind of coupling, rather than a proper force then?
Michael, you say that
Thanks !
I had come across BushingForce, but not CoordinateLimitForce. I have not tested any of them, I guess it is going to be my next step! I can't find any mention of either of them in the Simbody manual, though.
Also, I am curious: to my knowledge kinematics does not consider forces. Will they still be taken into account for IK? Are they a kind of coupling, rather than a proper force then?
Michael, you say that
What o you mean, by a tolerance?the constraint equations are satisfied simultaneously (to a tolerance).
Thanks !
- Michael Sherman
- Posts: 812
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Difference joint vs constraint
You are correct that kinematics doesn't consider forces so the force elements don't affect IK. IK always respects joints and should satisfy constraints also.
"To a tolerance" means that (unlike joints) constraints won't be satisfied perfectly (that is, to machine precision). Instead there will be some small residual error in the constraints, typically something like 10^-4 length units. The maximum allowable error (user settable, typically) is called the "tolerance".
Sherm
"To a tolerance" means that (unlike joints) constraints won't be satisfied perfectly (that is, to machine precision). Instead there will be some small residual error in the constraints, typically something like 10^-4 length units. The maximum allowable error (user settable, typically) is called the "tolerance".
Sherm
- Pagnon David
- Posts: 86
- Joined: Mon Jan 06, 2014 3:13 am
Re: Difference joint vs constraint
Okay, thank you for clarifying.
Just to make it sure, using bushingforce or coordinatelimitforce won't be useful for closed-loop inverse kinematics?
To be more specific, lets say I want to constrain a bike to a cyclist, but IK fails when I use the standard weld or point constraints. I would like to release them a little, or to use something different. In this case, these two elements cannot help?
I do appreciate the time you are taking to help
Just to make it sure, using bushingforce or coordinatelimitforce won't be useful for closed-loop inverse kinematics?
To be more specific, lets say I want to constrain a bike to a cyclist, but IK fails when I use the standard weld or point constraints. I would like to release them a little, or to use something different. In this case, these two elements cannot help?
I do appreciate the time you are taking to help
- Michael Sherman
- Posts: 812
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Difference joint vs constraint
I'm not familiar with OpenSim's IK interface so this is just Thanksgiving speculation in case no one else is available:
- assuming there is a way to loosen the tolerance, you may find you can solve the problem using joints and constraints with a little more slop allowed
- you may have a problem with your geometry where there actually isn't an exact solution; in that case if loosening tolerance isn't enough you might need to refine your geometry
Right, forces are not consider during IK. If you want to solve with forces in place, consider static analysis (looks for an equilibrium solution).
Hopefully someone more knowledgeable will answer soon!
Regards,
Sherm
- assuming there is a way to loosen the tolerance, you may find you can solve the problem using joints and constraints with a little more slop allowed
- you may have a problem with your geometry where there actually isn't an exact solution; in that case if loosening tolerance isn't enough you might need to refine your geometry
Right, forces are not consider during IK. If you want to solve with forces in place, consider static analysis (looks for an equilibrium solution).
Hopefully someone more knowledgeable will answer soon!
Regards,
Sherm
- Pagnon David
- Posts: 86
- Joined: Mon Jan 06, 2014 3:13 am
Re: Difference joint vs constraint
Thank you!
So, if I sum it up:
- I don't think there is any way to loosen the tolerance of constraints (I could be wrong), nor to implement soft constraints
- I can't use force elements for inverse kinematics (unless I first conduct a static analysis, and then I refine geometry in order to minimize the forces where I reattached the broken loop, is that it?)
But
- I can probably design and/or scale my model better, to make sure that no geometry incompatibilities are met.
Other consideration: Would other inverse kinematics algorithm work better? I am not totally clear on it, but how does Global optimization compare to Kalman smoother to inverse Jacobian, in this case?
So, if I sum it up:
- I don't think there is any way to loosen the tolerance of constraints (I could be wrong), nor to implement soft constraints
- I can't use force elements for inverse kinematics (unless I first conduct a static analysis, and then I refine geometry in order to minimize the forces where I reattached the broken loop, is that it?)
But
- I can probably design and/or scale my model better, to make sure that no geometry incompatibilities are met.
Other consideration: Would other inverse kinematics algorithm work better? I am not totally clear on it, but how does Global optimization compare to Kalman smoother to inverse Jacobian, in this case?