I am learning the content of the replicator. I added an Xform according to the case, and I checked the type, which is the same as the type in the case. But when I run it for data collection, it is not under my control and cannot be random. I can’t find the reason and would love some help.`Preformatted text
import omni.replicator.core as rep
from omni.isaac.core.utils.stage import add_reference_to_stage
from omni.isaac.core import World, prims
import numpy as np
import omni
with rep.new_layer():
camera = rep.create.camera(position=(67, 0, 0))
render_product = rep.create.render_product(camera, (1024, 1024))
torus = rep.create.torus(semantics=[('class', 'torus')], position=(0, 0, 0))
sphere = rep.create.sphere(semantics=[('class', 'sphere')], position=(0, 0, 0))
cube = rep.create.cube(semantics=[('class', 'cube')], position=(0, 0, 0))
car5 = add_reference_to_stage("/D:/OM/car/car5/car5.usd", prim_path="/Replicator/car5")
stage = omni.usd.get_context().get_stage()
car5 = stage.GetPrimAtPath("/Replicator/car5")
car5 = prims.XFormPrim(f"/Replicator/car5")
car5.set_local_pose(np.array([1, 2, 3]))
car5 = rep.get.prim_at_path("/Replicator/car5")
with rep.trigger.on_frame(num_frames=10):
with rep.create.group([torus, sphere, cube,car5]):
rep.modify.pose(
position=rep.distribution.uniform((-10000, -10000, -10000), (20000, 20000, 20000)),
scale=rep.distribution.uniform(0.1, 2))
# Initialize and attach writer
writer = rep.WriterRegistry.get("BasicWriter")
writer.initialize( output_dir="D:\OM\out_put", rgb=True, bounding_box_2d_tight=True)
writer.attach([render_product])
rep.orchestrator.preview()