Skip to content

[multibody] Add SapJointFrictionConstraint for joint dry friction - #24920

Open
xuchenhan-lbm wants to merge 1 commit into
RobotLocomotion:masterfrom
xuchen-han:sap-joint-friction-constraint
Open

[multibody] Add SapJointFrictionConstraint for joint dry friction#24920
xuchenhan-lbm wants to merge 1 commit into
RobotLocomotion:masterfrom
xuchen-han:sap-joint-friction-constraint

Conversation

@xuchenhan-lbm

@xuchenhan-lbm xuchenhan-lbm commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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 at vc = 0, so, as for friction in SapFrictionConeConstraint, it is regularized. The cost is the Huber function

ℓ(vc) = vc²/(2R)                if |vc| ≤ R γₘₐₓ   (stiction)
        γₘₐₓ |vc| − R γₘₐₓ²/2   otherwise           (sliding)

so the impulse γ = −∂ℓ/∂vc = clamp(−vc/R, −γₘₐₓ, γₘₐₓ) is continuous and the Hessian is 1/R in stiction and zero in sliding. Friction always opposes the constraint velocity and |γ| ≤ γₘₐₓ, so the force γ/δt is bounded by τ_c.

The regularization is R = σ w, with w the 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 by R γₘₐₓ = σ 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 Reviewable

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 xuchen-han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants