Isaac Sim - Replicator

Hello,

I’m starting a study on the Replicator and I made this simple code to randomize the position and rotations of an object, at the moment I would like to export the images (this works) and also the rotation value applied during the function, how could I do this ?

Ideally this would be the image and a sequential list of each position and rotation, equivalent to the output images.

Code:

import omni.replicator.core as rep

with rep.new_layer():

#adiciona objeto que sofrera variacoes
cube = '/World/Cube'

#funcao de randomizacao
def get_shapes():
    shapes = rep.get.prims(semantics=[('class', 'cube_teste')])
    with shapes:

        rep.modify.pose(
            position=rep.distribution.uniform((0,0, 0), (0.4, -10, 0)),
            rotation=rep.distribution.uniform((89, -0.2, 0), (89, 0.2, 0)),      
        )
    return shapes.node

rep.randomizer.register(get_shapes)

# Setup randomization
with rep.trigger.on_frame(num_frames=10):
    rep.randomizer.get_shapes()

Hi there,

you could either use the data from the 3d bbox annotator to get the transformations:

Or you can access the prim data from stage between each write. In which case you should use rep.orchestrator.step() to trigger the writer which will also make sure that the stage is in sync with the renderer. You can take a look at the varius example snippets using the step() function:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.