Hi, I am trying to use occupancy_map. However, the doc example failed to get phyx object. And I got “No Physics Scene Present” from cmd.
This prevents me from accessing the occupancy_map.
Any idea? Thanks!
Example script:
the min_bound is failed to be set to (-2, -2, 0)
import omni
from pxr import UsdPhysics
from omni.isaac.occupancy_map.bindings import _occupancy_map
from omni.physx import get_physx_interface
from pxr import UsdGeom, UsdPhysicsdef add_cube(stage, path, size, offset):
cubeGeom = UsdGeom.Cube.Define(stage, path) cubePrim = stage.GetPrimAtPath(path) cubeGeom.CreateSizeAttr(size) cubeGeom.AddTranslateOp().Set(offset) UsdPhysics.CollisionAPI.Apply(cubePrim) return cubeGeom
#--------------------------
context = omni.usd.get_context()
stage = omni.usd.get_context().get_stage()
stage_id = omni.usd.get_context().get_stage_id()add_cube(stage, “/World/cube_1”, 1.00, (1.0, 1.0, 0))
physce = UsdPhysics.Scene.Define(stage, “/physicsScene”)
physx = get_physx_interface() #omni.physx.acquire_physx_interface()
stage_id = omni.usd.get_context().get_stage_id()print(type(physx))
generator = _occupancy_map.Generator(physx, stage_id)
generator.update_settings(.05, 4, 5, 6)
min_bound=(-2, -2, 0)
max_bound=(2, 2, 0)
generator.set_transform((0, 0, 0), min_bound, max_bound)print(‘get_min_bound:’, generator.get_min_bound())