I am trying to capture photos of a cube in the view of the camera and I am not sure why every captured photo is black and why I can’t see any randomization when I click on Replicator → Step or Replicator → Start after hitting Run on Script Editor Python code.
Here’s the dummy script:
# click on Replicator --> Start to start the capture
# with current state of the code, everything is captured as black
import omni.replicator.core as rep
from datetime import datetime
with rep.new_layer():
camera = rep.create.camera(position=(0, 0, 1000))
render_product = rep.create.render_product(camera, (1024, 1024))
cube = rep.create.cube(semantics=[('class', 'cube')], position=(100, -200 , 100) )
with rep.trigger.on_frame(num_frames=10):
with cube:
rep.modify.pose(
position=rep.distribution.uniform((-100, -100, -100), (200, 200, 200)),
scale=rep.distribution.uniform(0.1, 2))
timestamp = datetime.now().strftime("%Y_%m_%d-%I_%M_%S_%p")
# Initialize and attach writer
writer = rep.WriterRegistry.get("BasicWriter")
writer.initialize( output_dir="/home/mona/Desktop/Isaac_Sim_Dummy_Out/cube_out/" + timestamp, rgb=True, bounding_box_2d_tight=True)
writer.attach([render_product])
rep.orchestrator.preview()
and here’s the screenshot of my window:
as a basic goal, I want the following:
- spawn a cube
- create a camera
- create a plane
- make sure the cube is always spawn inside the plane
- make sure the camera is always taking photos of the cube
If you could guide me to a tutorial that does these minimal things I’d really appreciate. Some of the tutorials start too big and some are just too minimal and I am not sure how to fill in the gaps.
Also, everytime I click on Run, I get this warning: Overridden in multiple layers
as shown below.