A calibration mast can stand upright when opened as an OpenUSD asset and lie sideways after it is referenced into a robot workcell. Verify the orientation in the composed scene using two landmarks. The scene's up-axis setting tells you which world direction counts as up, and the composed transform tells you which way the mast actually points.
OpenUSD records the up axis as a stage-level convention. A Y-up asset brought into a Z-up workcell by a raw USD reference does not get a corrective rotation from that metadata alone. An importer can add that correction, so inspect the assembled stage before applying one yourself.
Test a Y-up mast in a Z-up stage
This fixture uses an origin and a point along local positive Y as stand-ins for the mast's foot and tip. The source and consuming stage declare different up axes. A parent transform under the consuming stage provides the orientation correction.
from pxr import Gf, Usd, UsdGeom
asset = Usd.Stage.CreateInMemory()
UsdGeom.SetStageUpAxis(asset, UsdGeom.Tokens.y)
mast = UsdGeom.Xform.Define(asset, "/Mast")
cell = Usd.Stage.CreateInMemory()
UsdGeom.SetStageUpAxis(cell, UsdGeom.Tokens.z)
mount = UsdGeom.Xform.Define(cell, "/Mount")
placed = cell.DefinePrim("/Mount/Mast", "Xform")
assert placed.GetReferences().AddReference(
asset.GetRootLayer().identifier, mast.GetPath()
)
def mast_direction():
matrix = UsdGeom.XformCache().GetLocalToWorldTransform(placed)
foot = matrix.Transform(Gf.Vec3d(0, 0, 0))
tip = matrix.Transform(Gf.Vec3d(0, 1, 0))
return tip - foot
assert Gf.IsClose(mast_direction(), Gf.Vec3d(0, 1, 0), 1e-9)
mount.AddRotateXOp().Set(90)
assert Gf.IsClose(mast_direction(), Gf.Vec3d(0, 0, 1), 1e-9)
assert UsdGeom.GetStageUpAxis(cell) == UsdGeom.Tokens.z
print(tuple(round(v, 8) for v in mast_direction()))
The assertions pass in OpenUSD 0.26.11. Before the rotation, the vector from the foot to the tip points along world positive Y even though the cell declares Z up. A 90-degree rotation around X on the mount maps the mast's positive Y direction to world positive Z. Recomputing the transform with a fresh cache captures the edit, and the cell's stage metadata still reports Z up.
Apply the landmark check to the composed asset
Choose two points that are easy to identify in the source asset and lie along the direction intended as up. Use the exact prim and transform from the consuming stage to express both points in world coordinates. Subtract the foot from the tip so that an offset in the mounting location does not affect the direction measurement. A positive component along the target up axis and negligible lateral components indicate alignment for a mast expected to be exactly vertical.
Confirm a second direction or an off-axis landmark if the installation also has a required facing angle. A vertical mast can still be twisted about its length. Record the source and target up axes and the authored mounting transform so the check can be repeated after the asset or import pipeline changes.
Sources
OpenUSD UsdGeom overview, stage metrics and corrective transforms
https://openusd.org/release/user_guides/schemas/usdGeom/overview.html
OpenUSD UsdGeomXformCache API reference, local-to-world transforms
https://openusd.org/release/api/class_usd_geom_xform_cache.html