Skip to content

[BUG FIX] Fix joint-equality reindexing when attaching a floating-base entity.#2948

Merged
duburcqa merged 1 commit into
Genesis-Embodied-AI:mainfrom
duburcqa:fix_attach_joint_equality_reindex
Jun 15, 2026
Merged

[BUG FIX] Fix joint-equality reindexing when attaching a floating-base entity.#2948
duburcqa merged 1 commit into
Genesis-Embodied-AI:mainfrom
duburcqa:fix_attach_joint_equality_reindex

Conversation

@duburcqa

@duburcqa duburcqa commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Description

RigidEntity.attach() drops the floating base joint of the child entity and shifts the dof_start / q_start of all following joints, but it left joint._idx and the joint-equality references (eq_obj1id / eq_obj2id) untouched. Since joints_info is built densely by enumeration, those stale absolute indices end up off by n_base_joints, so a mimic (joint-equality) constraint of the attached entity reads the wrong dof_start -- aliasing the free-joint DOFs of an unrelated entity and dragging it around (or reading out of bounds).

Fix: shift joint._idx and the JOINT-type equality references in lockstep with the existing dof_start / q_start shift. Link-based equalities (connect/weld) are unaffected since attach() 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. On main it drifts ~0.04 m in x; with the fix it stays put. Fails for the is_fixed=False variants without the fix, passes for all four with it.

Checklist:

  • I read the CONTRIBUTING document.
  • I followed the Submitting Code Changes section of CONTRIBUTING document.
  • I tagged the title correctly (including BUG FIX/FEATURE/MISC/BREAKING)
  • I updated the documentation accordingly or no change is needed.
  • I tested my changes and added instructions on how to test it for reviewers.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@duburcqa duburcqa requested a review from YilingQiao as a code owner June 15, 2026 13:29
@duburcqa duburcqa merged commit 92d9ae7 into Genesis-Embodied-AI:main Jun 15, 2026
19 of 20 checks passed
@github-actions

Copy link
Copy Markdown

⚠️ Abnormal Benchmark Result Detected ➡️ Report

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.

1 participant