Fix: Migrate suction margin/gap for MuJoCo 3.9 contact semantics - #811
Draft
danwahl wants to merge 1 commit into
Draft
Fix: Migrate suction margin/gap for MuJoCo 3.9 contact semantics#811danwahl wants to merge 1 commit into
danwahl wants to merge 1 commit into
Conversation
MuJoCo 3.9 redesigned contact margin/gap. Detection moved from `dist < margin` to `dist < margin + gap`, and force generation from `dist < margin - gap` to `dist < margin`. All five suction sites here use margin == gap, the idiom for "detect early but only apply force on true contact". Under the new semantics that same markup generates force from a full margin away, so the cups push parts off before touching them. Measured with margin = gap = 0.02: on 3.6 a 15 mm separation is detected with no force, on 3.10 it is force-generating. Applies the upstream migration, margin_new = margin_old - gap_old, which is 0 at every site since margin equals gap. This is the same markup upstream migrated its own adhesion demo to. Ordering: this markup only behaves correctly on MuJoCo 3.10 or newer. Under 3.6 it reads as detection at 0 and force at -gap, so the cups stop sensing parts until they interpenetrate. Merge this only once moveit_pro ships the 3.10 bump, which also carries the widen_body_margin_for_gap change that restores detection on multi-geom bodies. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJinnRQknbm62X7GCveK
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
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.
Motivation
MuJoCo 3.9 redesigned the contact
marginandgapgeom attributes, and every suction site here uses the pre-3.9 idiom.Brief description
Detection moved from
dist < margintodist < margin + gap, and force fromdist < margin - gaptodist < margin. All five sites usemargin == gap— the idiom for sensing a part without pushing it away — which now generates force from a full margin out: atmargin = gap = 0.02, a 15 mm separation is force-generating on 3.10 where 3.6 produced none.Applies the upstream migration
margin_new = margin_old - gap_old, zero at every site — the markup upstream moved its own adhesion demo to.factory_sim'soverride="enable"forces every margin too_margin, so its edits are inert there; kept for consistency.Merge order
Only correct on MuJoCo 3.10+. Under the 3.6 shipping today this reads as detection at
0, so cups stop sensing parts until they interpenetrate.How it was tested
margin + gap, zero force-generating contacts, force only on penetration.factory_simObjectives run end to end against the paired branch.Release notes
None — the user-facing migration guidance ships with PickNikRobotics/moveit_pro#20813.