DetachableJoint: allow physics constraint properties to be set
🎉 New feature
Allow the joint constraint physics parameters constraint force mixing (cfm) and error reduction parameter (erp) to be set via Features. Here the parameters only apply to dynamically created joints in the dartsim engine, although the features are declared generally.
The parameters are not documented in the dartsim manual and must be inspected in the source code. They appear to be defined similarly to the parameters with the same name in ODE https://ode.org/wiki/index.php/Manual#Soft_constraint_and_Constraint_Force_Mixing_(CFM).
The parameters allow finer control over the simulation of the weld joints created using the detachable joint system. This is relevant when creating closed kinematic chains, where in some cases the constraint forces and error reduction iterations must be increased in order for the model to maintain integrity (i.e. prevent joints flying apart).
In dartsim these parameters are declared as class variables for DyanamicJointConstraints, so setting them on one detachable joint affects all others. Other physics engines may treat this differently.
Related:
- https://github.com/gazebosim/gz-physics/issues/636
Summary
- Add a new feature
SetDynamicJointConstraintPropertiesFeature - Like
AttachFixedJointthis is a Link feature (the weld constraints belong to the link).
Test it
- See related PR in
gz-sim: https://github.com/gazebosim/gz-sim/pull/2960
Checklist
- [x] Signed all commits for DCO
- [ ] Added tests
- [ ] Added example and/or tutorial
- [ ] Updated documentation (as needed)
- [ ] Updated migration guide (as needed)
- [ ] Consider updating Python bindings (if the library has them)
- [ ]
codecheckpassed (See contributing) - [ ] All tests passed (See test coverage)
- [ ] While waiting for a review on your PR, please help review another open pull request to support the maintainers
- [ ] Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)
Generated-by: Remove this if GenAI was not used.
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.
cc @scpeters in case you have opinions on these APIs.
There are some merge conflicts that need to be resolved otherwise looks good to me.
There are some merge conflicts that need to be resolved otherwise looks good to me.
Resolved in https://github.com/gazebosim/gz-physics/commit/03b126cd0f2f2c6c102860cc90c8c75e59f3b829
@osrf-jenkins run tests please