Skip to content

Unitree H1: sync body masses and inertials with upstream URDF update - #340

Open
akushonkamen wants to merge 1 commit into
google-deepmind:mainfrom
akushonkamen:fix/h1-inertial-sync-333
Open

akushonkamen wants to merge 1 commit into
google-deepmind:mainfrom
akushonkamen:fix/h1-inertial-sync-333

Conversation

@akushonkamen

Copy link
Copy Markdown

Description

unitree_h1/h1.xml still carried the pre-Dec-2025 body inertials. Upstream
unitreerobotics/unitree_ros@34e7506
(2025-12-31, "update h1 urdf (mass&inertial)") revised the masses, centers of mass and
inertia tensors of the pelvis, both legs and both arms — 59.34 kg total — while h1.xml
summed to 51.44 kg, the discrepancy reported in #333.

The fix resyncs the affected <inertial> blocks from that URDF commit via a scripted
URDF→MJCF conversion (R_rpy @ I @ R_rpy^T, eigen-decomposition into the principal frame),
applied minimally:

  • pelvis + all 10 leg links: mass, COM and inertia fully resynced
  • 6 arm links: mass only (COM and inertia already matched)
  • 2 elbow links: pos + mass (stale COM, inertia matched)
  • torso_link untouched (already matched)

Joint limits, kinematics and collision geometry are unchanged; the hip_pitch range is
left as-is per the open question in the issue. unitree_h1/CHANGELOG.md documents the
change and the contributor entry is added to CONTRIBUTORS.md (alphabetical by first name,
per the sorted-order test).

Methodology check: before being applied, the converter was validated to reproduce the
then-current file's (parent revision, unitree_ros e909ca2) masses, COMs and diagonal
inertias digit-for-digit.

Verification, all run locally on this exact tree:

  • RED, before patch: XML-level checker comparing every body against the
    unitree_ros@34e7506 URDF → 19/20 bodies FAIL, totals mjcf=51.437 vs urdf=59.338
    (reproduces the issue's 51.44/59.34).
  • GREEN, after patch: same checker → checked=20 failures=0, totals equal at 59.338.
  • Compiled-model checker (MuJoCo 3.16.0): reconstructed mass, COM and body-frame inertia
    of all 20 bodies match the URDF; total model mass 59.338 kg.
  • make check: all pre-commit hooks Passed (trailing-whitespace, end-of-file, yaml,
    merge-conflict, mixed-line, ruff, ruff-format, LICENSE, format_xml).
  • Full suite: uv run --quiet --with-requirements test/requirements.txt pytest test/ -q
    → 375 passed, 1 skipped.

Investigated, edited and tested with Claude Code (AI assistant).

Fixes: #333

Checklist

  • make all passes locally (lint, format, license, XML, tests) — make check all
    hooks Passed; pytest test/ 375 passed, 1 skipped
  • Added my name to CONTRIBUTORS.md (alphabetical by first name)
  • Updated the relevant CHANGELOG.md (model-local: unitree_h1/CHANGELOG.md)
  • Signed the Contributor License Agreement (CLA)
    — left unticked: signing requires the account holder's action; will be ticked once
    confirmed at cla.developers.google.com

unitreerobotics/unitree_ros@34e7506 (2025-12-31, 'update h1 urdf
(mass&inertial)') revised the masses, centers of mass and inertia tensors
of the pelvis, both legs and both arms; unitree_h1/h1.xml still carried
older values (51.44 kg total vs 59.34 kg in the URDF, most of the gap in
the legs). This syncs the affected <inertial> blocks from that commit.
Joint limits, kinematics and collision geometry are unchanged, and the
hip_pitch range stays as-is.

Also adds the CONTRIBUTORS.md entry (casefold order, per
test/model_dir_test.py::ContributorsTest::test_sorted) and a model
CHANGELOG.md entry.

Verified on this exact tree with MuJoCo 3.16.0: every body's mass, COM
and body-frame inertia tensor reconstructed from h1.xml matches the
URDF reference (20/20 bodies; model total 59.338 kg), 'uv run --quiet
--with-requirements test/requirements.txt pytest test/ -q' = 375
passed, 1 skipped (exit 0), and 'make check' is green.

Fixes google-deepmind#333.

Signed-off-by: akushonkamen <akushonkamen@163.com>
@google-cla

google-cla Bot commented Oct 17, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

This branch has not been deployed

No deployments
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.

unitree h1: masses and inertias predate unitree's dec 2025 urdf update (51.44 vs 59.34 kg)

1 participant