Fix ee_inertia override writing invalid MJCF attribute "ipos" - #100
Open
addisonhammer wants to merge 1 commit into
Open
addisonhammer wants to merge 1 commit into
addisonhammer wants to merge 1 commit into
Conversation
combine_arm_and_gripper_xml() wrote the end-effector center of mass as <inertial ipos="..."> but MJCF's <inertial> element names it "pos", so any get_yam_robot(..., ee_inertia=...) call failed at model construction with "XML Error: Schema violation: unrecognized attribute: 'ipos'". Write "pos" instead, update the XML-level test to expect "pos", and add a test that compiles the overridden model in MuJoCo and checks the resulting gripper mass and center of mass for every arm/gripper combination (the existing test only inspected XML text, so it could not catch this). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CvajU7exuGGR1wreVadnX1
This branch has not been deployed
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.
Fixes #99.
combine_arm_and_gripper_xml()wrote theee_inertiacenter of mass as<inertial ipos="...">; MJCF's<inertial>usespos, so anyee_inertiaoverride failed at model construction withXML Error: Schema violation: unrecognized attribute: 'ipos'.Changes
i2rt/robots/utils.py: writeposinstead ofipos(one line).test_combine_xml_with_custom_ee_mass_inertia: expectpos(and assertiposis absent).test_custom_ee_inertia_compiles_in_mujoco: compiles the overridden model for every arm/gripper combo and checks the compiled gripper mass andbody_ipos. The existing test only inspected XML text, which is how this slipped through.Testing
unrecognized attribute: 'ipos'); with it,test_assembly.pypasses (151) and the full suite passes:uv run pytest -n auto→ 710 passed, 2 skipped.ruff check/ruff format --checkclean on the changed files.get_yam_robot(..., ee_inertia=...).🤖 Generated with Claude Code
https://claude.ai/code/session_01CvajU7exuGGR1wreVadnX1