"""1) Blade vs item contact height at the pusher. 2) Actual authored deck surfaceVelocity magnitudes vs the commanded 1.0 m/s - the log showed items crawling 8-50s across ~1-2m of deck (expected ~1-2s), which smells like the drive_belt() scale-correction being wrong for these particular Cube prims (same class of bug as ConveyorTrack_04's documented 0.5-scale issue).""" import omni.usd from pxr import Usd, UsdGeom, PhysxSchema, Gf stage = omni.usd.get_context().get_stage() bbc = UsdGeom.BBoxCache(Usd.TimeCode.Default(), [UsdGeom.Tokens.default_, UsdGeom.Tokens.render]) print("=== pusher blade vs belt height ===") blade = stage.GetPrimAtPath("/World/Diverters/DiverterY_Split/Pusher/Geom") r = bbc.ComputeWorldBound(blade).ComputeAlignedRange() print(f" blade z[{r.GetMin()[2]:+.3f}..{r.GetMax()[2]:+.3f}]") belt = stage.GetPrimAtPath("/World/ConveyorTrack_03/Belt") r2 = bbc.ComputeWorldBound(belt).ComputeAlignedRange() print(f" ConveyorTrack_03/Belt top z={r2.GetMax()[2]:+.3f}") print("\n=== item rest heights (bottom of bbox) for the 11 named items, unposed ===") import sys sys.path.insert(0, "/home/dasha/robozon-sorter") from robozon_sorter import config as C items_dir = C.ROOT / "assets" / "items" for name in ["bottle","box_300x200x200","box_400x400x300","lunchbox","bag","detergent", "pouf","pen","plate","cylinder","helmet"]: tmp_stage = Usd.Stage.CreateInMemory() prim = tmp_stage.DefinePrim("/probe", "Xform") prim.GetReferences().AddReference(str(items_dir / f"{name}.usd")) bb2 = UsdGeom.BBoxCache(Usd.TimeCode.Default(), [UsdGeom.Tokens.default_, UsdGeom.Tokens.render]) rr = bb2.ComputeWorldBound(prim).ComputeAlignedRange() if rr.IsEmpty(): print(f" {name:18s} EMPTY BBOX"); continue mn, mx = rr.GetMin(), rr.GetMax() print(f" {name:18s} local z[{mn[2]:+.3f}..{mx[2]:+.3f}] height={mx[2]-mn[2]:.3f}") print("\n=== deck actual surfaceVelocity (authored) vs commanded speed=1.0 ===") for path in ["/World/PlowTransition_B", "/World/PlowCornerDeck_B", "/World/PlowTransition_C", "/World/PlowCornerDeck_C"]: prim = stage.GetPrimAtPath(path) if not prim.IsValid(): print(f" {path} MISSING"); continue sv = prim.GetAttribute("physxSurfaceVelocity:surfaceVelocity") v = sv.Get() if sv else None mag = (v[0]**2+v[1]**2+v[2]**2)**0.5 if v else 0.0 # world-space check: transform local surfaceVelocity to world using current xform xc = UsdGeom.XformCache() M = xc.GetLocalToWorldTransform(prim) world_v = M.TransformDir(Gf.Vec3d(*v)) if v else Gf.Vec3d(0,0,0) world_mag = world_v.GetLength() scale_op = None for op in UsdGeom.Xformable(prim).GetOrderedXformOps(): if op.GetOpType() == UsdGeom.XformOp.TypeScale: scale_op = op.Get() print(f" {path}") print(f" local surfaceVelocity={v} |local|={mag:.3f} |world|={world_mag:.3f} scale={scale_op}")