Getting the following error while using rep.distribution.choice
:
[Error] [omni.graph.core.plugin] /Replicator/SDGPipeline/OgnSampleChoice: Assertion raised in compute - AttributeData '__resolved_outputs:samples' of type 'double3[]' required array of elements of length 3, got 1d array of size 3
File "/home/atai/.local/share/ov/pkg/deps/28c70d9b2f0e7eb6e8d60682fea71057/extscache/omni.replicator.core-1.7.7+104.2.lx64.r.cp37/omni/replicator/core/ogn/python/_impl/nodes/OgnSampleChoice.py", line 115, in compute
db.outputs.samples = samples
File "/home/atai/.local/share/ov/pkg/deps/28c70d9b2f0e7eb6e8d60682fea71057/extscache/omni.replicator.core-1.7.7+104.2.lx64.r.cp37/omni/replicator/core/ogn/OgnSampleChoiceDatabase.py", line 168, in __setattr__
super().__setattr__(item, new_value)
File "/var/tmp/packman/chk/kit-sdk/104.2+release.295.529af2e4.tc.linux-x86_64.release/exts/omni.graph/omni/graph/core/_impl/database.py", line 657, in __setattr__
super().__setattr__(item, new_value)
File "/home/atai/.local/share/ov/pkg/deps/28c70d9b2f0e7eb6e8d60682fea71057/extscache/omni.replicator.core-1.7.7+104.2.lx64.r.cp37/omni/replicator/core/ogn/OgnSampleChoiceDatabase.py", line 143, in samples
self.samples.value = value_to_set
File "/var/tmp/packman/chk/kit-sdk/104.2+release.295.529af2e4.tc.linux-x86_64.release/exts/omni.graph/omni/graph/core/_impl/utils.py", line 385, in wrapper_non_const
return func(self, *args, **kwargs)
File "/var/tmp/packman/chk/kit-sdk/104.2+release.295.529af2e4.tc.linux-x86_64.release/exts/omni.graph/omni/graph/core/_impl/runtime.py", line 126, in value
self.helper.set(new_value, on_gpu=self._on_gpu)
File "/var/tmp/packman/chk/kit-sdk/104.2+release.295.529af2e4.tc.linux-x86_64.release/exts/omni.graph/omni/graph/core/_impl/attribute_values.py", line 115, in set
self._data.set(new_value, on_gpu=on_gpu)
You can reproduce the error by running following code:
import omni.replicator.core as rep
with rep.new_layer():
torus = rep.create.torus(semantics=[("class", "torus")], position=(0, -200 , 100))
sphere = rep.create.sphere(semantics=[("class", "sphere")], position=(0, 100, 100))
cube = rep.create.cube(semantics=[("class", "cube")], position=(100, -200, 100))
with rep.trigger.on_frame(num_frames=10):
prims = rep.get.prims(semantics=[("class", "torus"), ("class", "sphere"), ("class", "cube")])
with prims:
rep.modify.pose(
position = rep.distribution.uniform((-200,-200,-200), (200, 200, 200)),
rotation=rep.distribution.uniform((-90,-180, 0), (-90, 180, 0)),
scale = rep.distribution.choice(choices=[0.8, 1, 1.2, 1.5]), # Error line
)
rep.orchestrator.run()