How to add two replicator items?

I want to use it to implement a random number generator that generates random numbers between (89,91) or (-1,1). How should I write it?

Features like the following, but writing them like this is illegal

 rep.modify.pose(
                    position=rep.distribution.uniform((-2, -2, 0), (2, 2, 0)),
                    rotation=rep.distribution.uniform((0, 0, -2), (0, 0, 2))  + rep.distribution.choice([(0, 0, 90), (0, 0, 0), (0, 0,-90)]),
                )

Hi there,

as far as I know adding distribution is not supported, you could write your own custom distribution omnigraph node, or you could use a pre-computed list of random values and use that with choice:

import random
import omni.replicator.core as rep

NUM_VALUES = 100
custom_random_values = [(0, 0, val) for _ in range(NUM_VALUES) for val in [random.uniform(-2, 2) + random.choice([-90, 0, 90])]]

# rotation=rep.distribution.choice(custom_random_values)
1 Like

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