fix: IS 4.5.0 -> 5.0.0 migration — USD metadata, DomeLight, scene reuse

- Fix USD metersPerUnit/upAxis for IS 5.0.0 (no longer auto-compensated)
- Batch fix all Aligned_obj.usd, table, and art USD files with backups
- Fix DomeLight rotation to Z-axis only (prevent tilted environment map)
- Fix scene reuse across episodes (arena_file caching, task clearing, prim guard)
- Add migration tools: scan_usd_metadata.py, fix_usd_metadata.py
- Add migration guide: migerate/migerate.md
- Add nvidia-curobo to .gitignore
- Fix sort_the_rubbish config: obj_0 -> obj_1 (obj_0 does not exist)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tangger
2026-04-03 11:10:39 +08:00
parent f338199bcb
commit 03d9a5b909
65 changed files with 862 additions and 6 deletions

View File

@@ -284,8 +284,49 @@ class Pick(BaseSkill):
if frame == "body":
return self.T_obj_ee
T_world_obj = tf_matrix_from_pose(*self.pick_obj.get_local_pose())
local_pose = self.pick_obj.get_local_pose()
world_pose = self.pick_obj.get_world_pose()
print(f"[PICK_DBG] prim_path={self.pick_obj.prim_path}", flush=True)
print(f"[PICK_DBG] local_pose trans={local_pose[0]}", flush=True)
print(f"[PICK_DBG] world_pose trans={world_pose[0]}", flush=True)
print(f"[PICK_DBG] local_pose ori={local_pose[1]}", flush=True)
print(f"[PICK_DBG] world_pose ori={world_pose[1]}", flush=True)
parent_prim = get_prim_at_path(self.pick_obj.prim_path).GetParent()
print(f"[PICK_DBG] parent_prim_path={parent_prim.GetPrimPath()}", flush=True)
grandparent_prim = parent_prim.GetParent()
print(f"[PICK_DBG] grandparent_prim_path={grandparent_prim.GetPrimPath()}", flush=True)
try:
from pxr import UsdGeom
obj_prim = get_prim_at_path(self.pick_obj.prim_path)
obj_xf = UsdGeom.Xformable(obj_prim)
xform_ops = obj_xf.GetOrderedXformOps()
print(f"[PICK_DBG] obj_xformOps_count={len(xform_ops)}", flush=True)
for op in xform_ops:
print(f"[PICK_DBG] obj_xformOp: {op.GetName()} val={op.Get()}", flush=True)
obj_l2w = obj_xf.ComputeLocalToWorldTransform(0)
print(f"[PICK_DBG] obj_USD_l2w=({obj_l2w[3][0]:.6f}, {obj_l2w[3][1]:.6f}, {obj_l2w[3][2]:.6f})", flush=True)
parent_xf = UsdGeom.Xformable(parent_prim)
parent_l2w = parent_xf.ComputeLocalToWorldTransform(0)
print(f"[PICK_DBG] parent_l2w_translate=({parent_l2w[3][0]}, {parent_l2w[3][1]}, {parent_l2w[3][2]})", flush=True)
gp_xf = UsdGeom.Xformable(grandparent_prim)
gp_l2w = gp_xf.ComputeLocalToWorldTransform(0)
print(f"[PICK_DBG] grandparent_l2w_translate=({gp_l2w[3][0]}, {gp_l2w[3][1]}, {gp_l2w[3][2]})", flush=True)
stage = parent_prim.GetStage()
mpu = UsdGeom.GetStageMetersPerUnit(stage)
print(f"[PICK_DBG] stage_metersPerUnit={mpu}", flush=True)
# Check get_local_pose source
glp_method = type(self.pick_obj).get_local_pose
print(f"[PICK_DBG] get_local_pose_from={glp_method.__qualname__}", flush=True)
except Exception as e:
import traceback
print(f"[PICK_DBG] UsdGeom error: {e}", flush=True)
traceback.print_exc()
print(f"[PICK_DBG] root_prim_path={self.task.root_prim_path}", flush=True)
print(f"[PICK_DBG] reference_prim_path={self.controller.reference_prim_path}", flush=True)
T_world_obj = tf_matrix_from_pose(*local_pose)
print(f"[PICK_DBG] T_world_obj translation={T_world_obj[:3,3]}", flush=True)
T_world_ee = T_world_obj[None] @ self.T_obj_ee
print(f"[PICK_DBG] T_world_ee[0] translation={T_world_ee[0,:3,3]}", flush=True)
if frame == "world":
return T_world_ee
@@ -294,8 +335,11 @@ class Pick(BaseSkill):
T_world_base = get_relative_transform(
get_prim_at_path(self.controller.reference_prim_path), get_prim_at_path(self.task.root_prim_path)
)
print(f"[PICK_DBG] T_world_base translation={T_world_base[:3,3]}", flush=True)
T_base_world = np.linalg.inv(T_world_base)
print(f"[PICK_DBG] T_base_world translation={T_base_world[:3,3]}", flush=True)
T_base_ee = T_base_world[None] @ T_world_ee
print(f"[PICK_DBG] T_base_ee[0] translation={T_base_ee[0,:3,3]}", flush=True)
return T_base_ee
def get_contact(self, contact_threshold=0.0):