[multibody] Add SapJointFrictionConstraint for joint dry friction - #24920
Open
xuchenhan-lbm wants to merge 1 commit into
Open
[multibody] Add SapJointFrictionConstraint for joint dry friction#24920xuchenhan-lbm wants to merge 1 commit into
xuchenhan-lbm wants to merge 1 commit into
Conversation
Adds a single equation SAP constraint that models load independent dry (Coulomb) friction on one degree of freedom, the analog of MuJoCo's frictionloss. The cost is the Huber regularization of the maximum dissipation cost dt*tau_c*|v|, so the impulse is clamp(-v/R, +-dt*tau_c) with R = sigma*w, the same scale independent regularization SAP applies to contact friction. Friction saturates at the bound while sliding and holds the DOF at rest, up to a small regularization creep, in stiction. The constraint is not yet used by SapDriver; that follows separately.
xuchen-han
reviewed
Aug 26, 2026
xuchen-han
left a comment
Contributor
There was a problem hiding this comment.
+a:@joemasterjohn for feature review please
@xuchen-han reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: LGTM missing from assignee joemasterjohn, needs platform reviewer assigned, needs at least two assigned reviewers, missing label for release notes (waiting on joemasterjohn).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Towards #18932.
This PR adds
SapJointFrictionConstraint, a single equation SAP constraint that models load independent dry (Coulomb) friction on one degree of freedom joints. Future PRs will wire it up.Model
The constraint velocity is the joint velocity,
vc = eᵢᵀ v, and the friction impulse is bounded byγₘₐₓ = δt τ_c. The ideal maximum dissipation costγₘₐₓ |vc|is not differentiable atvc = 0, so, as for friction inSapFrictionConeConstraint, it is regularized. The cost is the Huber functionso the impulse
γ = −∂ℓ/∂vc = clamp(−vc/R, −γₘₐₓ, γₘₐₓ)is continuous and the Hessian is1/Rin stiction and zero in sliding. Friction always opposes the constraint velocity and|γ| ≤ γₘₐₓ, so the forceγ/δtis bounded byτ_c.The regularization is
R = σ w, withwthe diagonal Delassus approximation for the constraint (an estimate of the inverse effective inertia of the DOF) andσthe same dimensionless parameter used for contact friction. During stiction the DOF creeps with a residual velocity bounded byR γₘₐₓ = σ w δt τ_c, i.e.σtimes the velocity change friction alone could produce on the DOF in one step, and under a sustained loadτₐbelow the bound it settles atσ w δt τₐ.This change is