ISAAC LAB 3.0 · UNITREE RL LAB · SIM2REAL MIGRATION

Unitree Isaac Lab 3.0 & Sim2Real Migration Guide: Fixing xyzw Quaternions, Missing libonnxruntime.so, and R1/H2/As2/G1 Deployment

Pin the software versions first, then verify quaternion order, native library resolution, and policy parity independently. Isaac Lab 3.0 task configurations and math utilities use xyzw. Convert a legacy wxyz value once at the boundary where it enters that code. If a Unitree controller build reports No rule to make target .../libonnxruntime.so, check which library filename the selected CMake target actually references.

Unitree G1 EDU Isaac Lab 3.0 Sim2Real migration reference

Direct Answer: Which Upstream Change Applies?

The December 1 R1, H2, and As2 proposal supplies controller and policy candidates; its author reports build and inference validation, with physical deployment still pending for those three models. Verified upstream sources: Isaac Lab 3.0 migration docs · unitree_rl_lab PR #155 · unitree_rl_lab PR #156 · GUMA Migrator Toolkit v1.0.0.

1. Upstream PR & Commit Matrix (unitree_rl_lab)

GitHub RecordVerified Status & CommitWhere to Look
PR #156, Dec 1 Open against isaaclab3.0. Commit fdd764c8. scripts/rsl_rl/train.py, play.py, scripts/mimic/csv_to_npz.py, and deploy/robots/. Adds Manager, Flat Manager, and Flat Direct velocity tasks for R1, H2, and As2 (18 task registrations, C++ builds, and ONNX inference reported for G1, Go2, R1, H2, As2; physical validation pending for R1/H2/As2). PR #156.
PR #153, Oct 26 Closed without merging into main. Commit 61e69769. Isaac Lab 3.0 / Isaac Sim 6.1 port updating csv_to_npz.py and tasks/mimic/mdp/commands.py to write and check quat_order, plus task config resolution in train.py, PhysX/noise config, and bounded playback in play.py. PR #153.
PR #155, Nov 13 Open against main. Commit 830ed420ff1200b82185b5fcf9436398dee534e1. Updates deploy/robots/{b2,go2,go2w,h1,h1_2}/CMakeLists.txt to link libonnxruntime.so.1.22.0. Author reports building all 5 targets on Ubuntu 24.04 x86_64; G1 23-DoF and 29-DoF already used the versioned filename in the PR base. PR #155 diff.
PR #152, Oct 23 Open against main. Commit e0c44ccceeaf1cc9ccf75d15c5108a8d9eec757b. Fixes motion_anchor_ori_b in deploy/robots/g1_29dof/src/State_Mimic.cpp where an Eigen transpose expression held in auto can outlive its temporary matrix. Materializing as Eigen::Matrix3f preserves six-element observation order (ASan & MuJoCo evidence reported). PR #152.

Record the Isaac Lab tag and commit, Isaac Sim version, Unitree RL Lab commit, RSL-RL version, Python version, and robot asset revision. Isaac Lab 3.0 Early Access targeted Isaac Sim 6.1, while the final Isaac Lab v3.0.0 release targets Isaac Sim 6.2. Record which USD or URDF resolves through source/unitree_rl_lab/unitree_rl_lab/assets/robots/unitree.py.

2. Fix Quaternion Order at the Data Boundary

Audit initial poses, resets, IMU decoding, projected gravity, motion clips, and policy observations. Reordering a quaternion preserves its norm, so a unit-norm check passes even when the robot pose is inverted. Test identity and a signed rotation about a known axis. In PR #153's converter, CSV columns 3:7 are already treated as xyzw; a legacy NPZ requires provenance-backed conversion or re-export before receiving an xyzw tag.

python3 - /path/to/reference-motion.npz <<'PY'
import sys
import numpy as np

def wxyz_to_xyzw(q):
    return np.asarray(q)[..., [1, 2, 3, 0]]

def rotate_xyzw(q, v):
    xyz, w = q[:3], q[3]
    cross = 2 * np.cross(xyz, v)
    return v + w * cross + np.cross(xyz, cross)

np.testing.assert_array_equal(wxyz_to_xyzw([1, 0, 0, 0]), [0, 0, 0, 1])
s = np.sqrt(0.5)
yaw90 = wxyz_to_xyzw([s, 0, 0, s])
np.testing.assert_allclose(
    rotate_xyzw(yaw90, np.array([1, 0, 0])), [0, 1, 0], atol=1e-7
)

with np.load(sys.argv[1], allow_pickle=False) as motion:
    if "quat_order" not in motion.files:
        raise SystemExit("Missing quat_order. Confirm provenance or re-export.")
    if motion["quat_order"].item() != "xyzw":
        raise SystemExit("Expected xyzw motion data.")
    q = motion["body_quat_w"]
    if q.ndim != 3 or q.shape[-1] != 4 or q.size == 0:
        raise SystemExit(f"Expected nonempty [frames, bodies, 4], got {q.shape}")
    if not np.isfinite(q).all():
        raise SystemExit("Nonfinite body quaternions")
    np.testing.assert_allclose(np.linalg.norm(q, axis=-1), 1.0, atol=1e-3)
    print(f"{q.shape[0]} frames, {q.shape[1]} bodies, finite unit quaternions")
PY

For G1 Mimic, inspect the six motion_anchor_ori_b values in the native controller. If they become nonfinite while source rotations stay valid, check the Eigen lifetime bug from PR #152 and verify unit length, orthogonality, and known-rotation axis alignment.

3. Fix the ONNX Runtime Link Target and Check the Loader

PR #155 addresses a build graph referencing an unversioned libonnxruntime.so absent from a fresh checkout, switching to the checked-in libonnxruntime.so.1.22.0 under deploy/thirdparty/onnxruntime-linux-x64-1.22.0/lib/. A working Python import onnxruntime proves nothing about the C++ binary's ELF loader. Run these read-only checks on Linux:

robot=go2
ort_dir=deploy/thirdparty/onnxruntime-linux-x64-1.22.0/lib
ort="$ort_dir/libonnxruntime.so.1.22.0"

git rev-parse HEAD
uname -m
git ls-files -- "$ort_dir"
grep -n 'libonnxruntime' "deploy/robots/$robot/CMakeLists.txt"
file -L "$ort"
readelf -d "$ort" | grep -E 'SONAME|NEEDED'

# After linking, inspect the actual controller without starting it.
controller=/absolute/path/to/the/built/controller
file -L "$controller"
readelf -d "$controller" | grep -E 'NEEDED|RPATH|RUNPATH'

Replacement CMake link entry for affected x86_64 targets (on aarch64 hosts, match aarch64 ONNX Runtime headers and libraries):

"${PROJECT_SOURCE_DIR}/../../thirdparty/onnxruntime-linux-x64-1.22.0/lib/libonnxruntime.so.1.22.0"
SymptomDiscriminating CheckAction
Robot spawns rotated or projected gravity has wrong signRun identity and signed-axis fixtures through the exact task conversion and frame transform.Fix boundary conversion and re-verify on a known pose from the original asset.
Mimic observations become nonfinite while input quaternions stay finiteInspect motion_anchor_ori_b and compare deployed source against PR #152.Materialize the Eigen::Matrix3f and compare the six values against a known orientation.
Build says No rule to make target .../libonnxruntime.soCompare CMake entry with git ls-files and actual checkout.Use versioned libonnxruntime.so.1.22.0 entry and reconfigure a clean build tree.
Binary links cleanly but fails to start on deployment hostCompare NEEDED, SONAME, RUNPATH, CPU arch, and installed libraries.Package the matching runtime and dependencies for the target architecture.
ONNX loads but output differs from training runnerFeed identical preprocessed observation tensor into original actor and exported policy.Check tensor order, normalization, observation history, and scaling before touching gains.
Flat policy works in Isaac Lab and diverges in MuJoCoCompare first divergent observation and action (including reset state & timing) using the same bundle.Resolve joint mapping, frame, timestep, or reference motion differences before hardware sign-off.

Automate NPZ Quaternion & ONNX Runtime Preflight Before Hardware Bring-Up

Run GUMA's open-source read-only migrator toolkit (unitree-isaaclab3-sim2real-migrator v1.0.0) or book a 1-on-1 English Isaac Lab 3.0 Sim2Real review for Unitree G1 EDU, R1, H2, or As2. 15-second RFQ form · Written engineering scope within 1 business day.

4. Audit the Controller and Policy as One Bundle

In PR #156, velocity candidates pair config/policy/velocity/v0/params/deploy.yaml with exported/policy.onnx and its external policy.onnx.data companion. Keep model and external weights together and verify ONNX tensor dimensions directly.

Unitree TargetCandidate ControllerWhat to Validate
R1deploy/robots/r1 → r1_ctrlMaps 24 joints and excludes head_ joints from JointPositionAction. Match enabled action joints with exact R1 variant and SDK motor slots.
H2deploy/robots/h2 → h2_ctrlMaps 29 joints with a two-component gait-phase observation. Verify torso/leg order and motor-slot gains.
As2deploy/robots/as2 → as2_ctrlMaps 12 joints. Verify hip, thigh, and calf mapping and sign per leg against hardware report.
G1 29-DoFdeploy/robots/g1_29dof → g1_ctrlUses 29 mapped joints and 5-step history. Match exact G1 EDU or G1+ trim and keep velocity and Mimic bundles separate.

Verify single-frame ONNX actor parity against a golden fixture saved from your training runner, then extend to a recorded sequence covering reset, nonzero yaw, and command transitions in Sim2Sim isolated from robot DDS traffic:

python3 - /path/to/policy.onnx /path/to/golden-frame.npz <<'PY'
import sys
import numpy as np
import onnxruntime as ort

model, fixture = sys.argv[1:]
session = ort.InferenceSession(model, providers=["CPUExecutionProvider"])
if len(session.get_inputs()) != 1 or len(session.get_outputs()) != 1:
    raise SystemExit("This check expects one model input and one output.")
input_spec = session.get_inputs()[0]
with np.load(fixture, allow_pickle=False) as data:
    obs, expected = data["obs"], data["action"]
    if obs.dtype != np.float32 or not np.isfinite(obs).all():
        raise SystemExit("Expected a finite float32 observation tensor.")
    actual, = session.run(None, {input_spec.name: obs})
    if actual.shape != expected.shape or not np.isfinite(actual).all():
        raise SystemExit(f"Invalid output shape or values: {actual.shape}")
    np.testing.assert_allclose(actual, expected, rtol=1e-4, atol=1e-5)
    print(f"Actor parity passed for one frame: {obs.shape} -> {actual.shape}")
PY

5. Physical Bench Acceptance Record (Honest PENDING Gate)

Record exact Unitree model/trim, firmware, asset and policy hashes, SDK commit, operator, and evidence path. Motion checks require your lab's approved Unitree procedure and verified operator stop path.

Physical Bench CheckStatusEvidence to Attach
R1 variant and motor-slot identityPENDINGRobot build sheet and signed comparison of policy joint order vs. observed motor slots.
H2 orientation and projected gravityPENDINGTimestamped read-only IMU capture from known poses and frame comparison.
As2 leg orderingPENDINGLabeled telemetry capture pairing each physical leg and joint with its decoded slot.
G1 EDU or G1+ bundle compatibilityPENDINGExact trim, DoF, firmware, and startup-state telemetry matched to the selected bundle.
Operator stop and controller handbackPENDINGSupervised acceptance record showing authority and telemetry before and after stop.
First supervised policy evaluationPENDINGTimestamped actions and states, agreed stop criteria, and operator disposition for that build.

6. Frequently Asked Questions

Does Isaac Lab 3.0 require xyzw everywhere?

Isaac Lab 3.0 task configs, tensors, and math utilities use xyzw. Check the declared convention at every external boundary (motion archive, robot IMU, USD API, C++ math) and convert once when conventions differ.

Why does CMake report missing libonnxruntime.so when ONNX Runtime is in the repo?

The affected targets in PR #155 pointed at an unversioned filename while the checkout contained versioned library files (libonnxruntime.so.1.22.0). Update the CMake link entry and check NEEDED entries on the deployment host.

Can H2 and G1 share a policy because both candidates map 29 joints?

Keep a separate bundle for each model. The H2 and G1 candidates use different observation history and action scaling, and compatibility also depends on geometry, joint semantics, firmware, and controller timing.

Is the R1, H2, or As2 candidate ready for physical deployment?

The PR #156 author reports task resolution, playback, controller builds, and ONNX inference checks, while explicitly leaving physical deployment on R1, H2, and As2 for hardware validation.

GUMA Engineering Resources & Open-Source Tooling

Compare Unitree G1 EDU hardware options, review our G1 EDU ROS 2 & SDK2 onboarding service, follow the G1 Isaac Lab Sim2Real coaching guide, run our open-source unitree-isaaclab3-sim2real-migrator (v1.0.0) preflight scripts, or browse GUMA's awesome-unitree-sdk2-ros2 engineering index.

Scope Genuine Unitree Hardware + 1-on-1 Isaac Lab 3.0 Migration Coaching

Share your target Unitree trim, Isaac Lab / Isaac Sim versions, and policy export status for an itemized hardware + English engineering onboarding quote. 15-second RFQ form · Written engineering scope within 1 business day.