Change Environment in Online_generation

Hi everyone~

I got some problem when I was trying online_generation.
I add a jetbot to the shapeNet and run the online_generation.py successfully.
Then I would like to change the environment(/World/Room) to built-in Isaac Simple_Room, but I have no idea how to do it because the way of creating environment is different from offline_generation.

Here is the original Code:
#############################
create_prim(“/World/Room”, “Sphere”, attributes={“radius”: 1e3, “primvars:displayColor”: [(1.0, 1.0, 1.0)]})
create_prim(
“/World/Ground”,
“Cylinder”,
position=np.array([0.0, -0.5, 0.0]),
orientation=euler_angles_to_quat(np.array([90.0, 0.0, 0.0]), degrees=True),
attributes={“height”: 1, “radius”: 1e4, “primvars:displayColor”: [(1.0, 1.0, 1.0)]},
)
create_prim(“/World/Asset”, “Xform”)
###############################

Thanks~

Hi there,

you can use the helper function from the offline generation example to load custom environments:

from omni.isaac.core.utils.nucleus import get_assets_root_path
import omni.replicator.core as rep

STAGE = "/Isaac/Environments/Simple_Warehouse/full_warehouse.usd"

# Helper to function to get the Isaac asset server path
def prefix_with_isaac_asset_server(relative_path):
    assets_root_path = get_assets_root_path()
    if assets_root_path is None:
        carb.log_error("Could not find Isaac Sim assets folder")
        return
    return assets_root_path + relative_path

with rep.new_layer():
    env = rep.create.from_usd(prefix_with_isaac_asset_server(STAGE))

Best,
Andrei