[FEATURE] Add support of torsional and rolling friction to the rigid solver.#3069
Conversation
85a057e to
26f9365
Compare
d0f8388 to
256f874
Compare
… in the breakaway example.
… cover the rolling axis in the breakaway example.
…stop stiction sweeps once every entity slipped.
…criterion stiction sweep).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae17fb23db
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…parsed friction coefficients on MJCF condim.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Description
Add opt-in torsional and rolling friction to rigid contacts: every contact can also resist relative spin about its normal (
RigidOptions.enable_torsional_friction) and rolling about its tangent axes (RigidOptions.enable_rolling_friction).gs.materials.Rigid.friction_torsional/friction_rolling(meters, the effective contact patch radius), parsed from MJCF geomfriction[1]/friction[2](on condim >= 4 / >= 6 geoms, matching when MuJoCo applies them), combined per contact by elementwise maximum, and settable at runtime at geom/link/entity level.friction_breakaway.pysweeps constant tangential, torsional, and rolling loads across the analytic Coulomb limits under both cones (documenting the pyramidal cone's limitations at its defaultimpratioof 1),torsional_grasp.pyshows in-hand pivoting, androlling_coast.pya ball coasting to rest.friction_breakaway.py(pyramidal left, elliptic right)torsional_grasp.pyrolling_coast.pyMotivation and Context
Point contacts transmit no spin or rolling torque, so anything relying on them (a grasped object twisting in a gripper, a ball rolling to rest) moves freely forever; the MJCF torsional and rolling coefficients were silently dropped at parsing. With the option off (default), behavior and performance are unchanged (interleaved A/B benchmark on a contact-dense pile: within noise); enabled, the same scene costs ~12% (elliptic) / ~14% (pyramidal) per step on CPU for torsional friction, and ~28% / ~41% with rolling friction on top, from the extra contact rows, with the Cholesky factor unaffected.
Related Issue
Addresses the torsional and rolling friction half of #2718 (the per-geom friction priority field remains open).
How Has This Been / Can This Be Tested?
pytest tests/rigid/test_friction.py tests/rigid/test_mujoco_parity.py --backend cpucovers the new tests: MuJoCo condim=4 and condim=6 consistency through slip, stick, and rest for both cones (60-step slide+spin+roll trajectories match at the suite's 64-bit tolerance of 1e-9), the analytic sphere spin-down ratefriction_torsional * g / (0.4 r^2)including a coefficient far below the tangential ones, zero-coefficient inertness, and runtime coefficient updates, and the analytic rolling deceleration(5/7) * friction_rolling * g / r.Checklist:
Submitting Code Changessection of CONTRIBUTING document.