[BUG FIX] Fix joint-equality reindexing when attaching a floating-base entity.#2948
Merged
duburcqa merged 1 commit intoJun 15, 2026
Conversation
|
|
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.
Description
RigidEntity.attach()drops the floating base joint of the child entity and shifts thedof_start/q_startof all following joints, but it leftjoint._idxand the joint-equality references (eq_obj1id/eq_obj2id) untouched. Sincejoints_infois built densely by enumeration, those stale absolute indices end up off byn_base_joints, so a mimic (joint-equality) constraint of the attached entity reads the wrongdof_start-- aliasing the free-joint DOFs of an unrelated entity and dragging it around (or reading out of bounds).Fix: shift
joint._idxand the JOINT-type equality references in lockstep with the existingdof_start/q_startshift. Link-based equalities (connect/weld) are unaffected sinceattach()removes no link.Related Issue
Resolves Kashu7100/Eden#589.
Motivation and Context
Attaching a floating-base entity that carries mimic joints (e.g. a dexterous hand) silently corrupted the dynamics of unrelated free bodies in the scene.
How Has This Been / Can This Be Tested?
Strengthened
test_merge_entities: the unrelated free box must keep its lateral position while the attached gripper actuates. Onmainit drifts ~0.04 m in x; with the fix it stays put. Fails for theis_fixed=Falsevariants without the fix, passes for all four with it.Checklist:
Submitting Code Changessection of CONTRIBUTING document.