I am importing usd objects into my simulation and want to change the pose of them using my own implemented OgnPerAxisPose node. In this node I am trying to get the bbox size of the object and do some overlap test like here Frequently Used Python Snippets — isaacsim latest documentation (without line 10, since it is not possible during randomization).
The problem starts with the size of the bbox, because the results are not stable.
(0.6530528665575275, 0.7136309560278187, 0.5500675907560046) (0.6870291550008039, 0.6052032736056401, 0.5500475141172724) (0.7263889617847499, 0.6848893498133128, 0.550064940423661)
Since I want to change the pose of all objects and avoid overlaps with other objects, this is not really working for me.
The following function is used for computation of the bbox:
def compute_bbox_with_cache(prim: Usd.Prim) -> Gf.Range3d: bbox_cache = UsdGeom.BBoxCache(Usd.TimeCode.Default(), includedPurposes=[UsdGeom.Tokens.default_]) bbox_cache.Clear() bound = bbox_cache.ComputeWorldBound(prim) return bound.GetRange().GetSize()
During the very first randomization, the size of the bbox seems to be good:
(0.6499999921768904, 0.5499999944120646, 0.5499999944120646) (0.6499999921768904, 0.5499999944120646, 0.5499999944120646) (0.6499999921768904, 0.5499999944120646, 0.5499999944120646)
Any recommendations for getting stable and correct results of the bbox size?
Thanks in advance!