Error messages when adding specific Domain Randomization components via API

For a project I’m working on I’m trying to create a dataset using the Isaac Sim python API.
I’ve decided to use the sample dataset generator script (under offline_generation) as my starting point.

There I’ve added a class method to add DR components to the scene, and have been able to get a lighting component working. However, both trying to implement a transform component or a visibility component still gives me error messages.

Transform component:

for the transform component I added the following function:

    for i in range(cam_ymin, cam_ymax):
        
        camera_points_list.append(Gf.Vec3f(-250, i, 500))

    result, prim = omni.kit.commands.execute(
        "CreateTransformComponentCommand",
        prim_paths="/Root/Camera_01",
        target_points=camera_points_list,
        enable_sequential_behavior=False
        )

This gives me the following error:

2021-09-16 10:44:06 [252,788ms] [Error] [carb.python] Failed to execute a command: CreateTransformComponentCommand.

File “testing/general_testing.py”, line 324, in

args.scenario, args.writer_mode, args.data_dir, args.max_queue_size, args.train_size, args.classes

File “testing/general_testing.py”, line 66, in __init__

self._setup_world(scenario_path)

File “testing/general_testing.py”, line 133, in _setup_world

self.setup_dr()

File “testing/general_testing.py”, line 116, in setup_dr

enable_sequential_behavior=False

File “/isaac-sim/kit/extscore/omni.kit.commands/omni/kit/commands/command.py”, line 196, in execute

return omni.kit.undo.execute(command, name, kwargs)

[…skipped…]

File “/isaac-sim/kit/extscore/omni.kit.commands/omni/kit/undo/undo.py”, line 76, in execute

result = command.do()

File “/isaac-sim/exts/omni.isaac.dr/omni/isaac/dr/scripts/commands.py”, line 366, in do

rel_paths.AddTarget(path)

<class ‘pxr.Tf.ErrorException’>

Error in ‘pxrInternal_v0_20__pxrReserved__::Sdf_ListEditor::ValidateEdit [with TypePolicy = pxrInternal_v0_20__pxrReserved_::SdfPathKeyPolicy]’ at line 278 in file /buildAgent/work/ca6c508eae419cf8/USD/pxr/usd/sdf/listEditor.h : 'Relationship target paths must be absolute prim, property or mapper paths’

It seems the prim path is incorrect, but I checked it multiple times. I also tested it with a mesh in the scene instead of the camera, but that led to the same error.

Visibility component:

for the visibility component I added the following function:

    result, prim = omni.kit.commands.execute(
        'CreateVisibilityComponentCommand',
        prim_paths=['/Root/Group_05/SM_PaletteA_359/SM_PaletteA_01'],
        num_visible_range=(0, 0),
        duration=1.0,
        include_children=True,
        seed=12345
    )

This gives me the following error:

2021-09-16 10:25:46 [237,605ms] [Error] [omni.usd] Runtime Error: in _SetValueImpl at line 6028 of /buildAgent/work/ca6c508eae419cf8/USD/pxr/usd/usd/stage.cpp – Empty typeName for </Root/Group_05/SM_PaletteA_359/SM_PaletteA_01/subset.visibility>

for reference, the lighting component which does work:

light_prim_path = “/Root/SM_LampCeilingA_23/RectLight”
result, prim = omni.kit.commands.execute(
“CreateLightComponentCommand”,
light_paths=[light_prim_path],
first_color_range=(1, 1., 1.),
second_color_range=(1.0, 1.0, 1.0),
intensity_range=(0, 70000.0),
temperature_range=(1500.0, 6500.0),
enable_temperature=True,
duration=1.0,
include_children=False,
)

I’ve looked through the forums but wasn’t able to find any other posts with these error messages.

If some extra info is needed, just let me know.

The script I’m using:
general_testing.py (17.3 KB)

prim_paths="/Root/Camera_01",

should be a list

prim_paths=["/Root/Camera_01"],

Will file the visibility issue as a bug to see if that has not been fixed for the next release already.