"""Find the real D-item collection bin/container geometry near the pusher branch.""" import omni.usd from pxr import Usd, UsdGeom stage = omni.usd.get_context().get_stage() bbc = UsdGeom.BBoxCache(Usd.TimeCode.Default(), [UsdGeom.Tokens.default_, UsdGeom.Tokens.render]) print("=== config bin constants (old sorter.usd) ===") import sys sys.path.insert(0, "/home/dasha/robozon-sorter") from robozon_sorter import config as C print(f"BIN_X0={C.BIN_X0} BIN_X1={C.BIN_X1} BIN_Y0={C.BIN_Y0} BIN_Y1={C.BIN_Y1} BIN_LIP_Z={C.BIN_LIP_Z}") print("\n=== SortingRig subtree (candidate bin location) ===") p = stage.GetPrimAtPath("/World/SortingRig") if p.IsValid(): for c in p.GetChildren(): r = bbc.ComputeWorldBound(c).ComputeAlignedRange() if not r.IsEmpty(): mn, mx = r.GetMin(), r.GetMax() print(f" {c.GetPath()} x[{mn[0]:+.2f}..{mx[0]:+.2f}] y[{mn[1]:+.2f}..{mx[1]:+.2f}] z[{mn[2]:+.2f}..{mx[2]:+.2f}]") else: print(" MISSING") print("\n=== ConveyorTrack_03 subtree (pusher branch) ===") p = stage.GetPrimAtPath("/World/ConveyorTrack_03") for c in p.GetChildren(): r = bbc.ComputeWorldBound(c).ComputeAlignedRange() if not r.IsEmpty(): mn, mx = r.GetMin(), r.GetMax() print(f" {c.GetPath()} x[{mn[0]:+.2f}..{mx[0]:+.2f}] y[{mn[1]:+.2f}..{mx[1]:+.2f}] z[{mn[2]:+.2f}..{mx[2]:+.2f}]") print("\n=== search whole stage for Bin-like names ===") for pr in stage.Traverse(): nm = pr.GetName().lower() if "bin" in nm: r = bbc.ComputeWorldBound(pr).ComputeAlignedRange() if not r.IsEmpty(): mn, mx = r.GetMin(), r.GetMax() print(f" {pr.GetPath()} x[{mn[0]:+.2f}..{mx[0]:+.2f}] y[{mn[1]:+.2f}..{mx[1]:+.2f}] z[{mn[2]:+.2f}..{mx[2]:+.2f}]")