[BUG FIX] Fix resolve SAPIEN simulation crash caused by multiple parent nodes#16
Open
Miracle-0v0 wants to merge 1 commit into
Open
[BUG FIX] Fix resolve SAPIEN simulation crash caused by multiple parent nodes#16Miracle-0v0 wants to merge 1 commit into
Miracle-0v0 wants to merge 1 commit into
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
The LLM-generated
joint_pred.pyoccasionally assigns a single link to multiple parents (e.g., first attaching a part viaplace_relative_toto parent A, then usingmake_revolute_jointto attach it to parent B). Previously,make_revolute_jointandmake_prismatic_jointfailed to clear the old joint because they matched strictly by(child, parent), leaving the link with two parents. This invalid kinematic tree caused the SAPIEN engine to reject the URDF and crash without generating a video, subsequently leading to a fatalIndexError: list index out of rangewhen accessingvideos[0].This PR fixes this by introducing a safe re-attachment mechanism in
articulate_anything/api/odio_urdf.pyusingget_parent_link_name(child)to detect and overwrite existing joints regardless of the old parent. It also adds robust error handling inarticulate_anything/agent/actor/joint_prediction/joint_actor.pyto raise a descriptiveRuntimeErrorif SAPIEN fails to yield a video.Related Issue
Resolves #14 & #15
Motivation and Context
Reviewer-critical: The Text Modality pipeline currently lacks a Critic/retry loop mechanism. Therefore, a single physical logic hallucination by the LLM (like assigning conflicting parents) causes the entire generation pipeline to crash irrecoverably. By enforcing a strictly valid kinematic tree at the API level—while still respecting the LLM's latest parent-assignment intent—the system becomes significantly more robust against LLM hallucinations.
How Has This Been / Can This Be Tested?
Tested locally using the
text_taskpipeline with the door mechanism prompt (which specifically triggers thedoor_thumb_turn_lockmultiple-parent bug).mainwithError: link with name door_thumb_turn_lock has multiple parents.followed byIndexError.RuntimeError('SAPIEN simulation failed to generate video...')is correctly raised.