[DomainRandomization] omni.isaac.dr's commands unregistered

Hi,

So I was trying to make use of DomainRandomization class in Isaac Sim 2020.2, which is defined here:
ISAAC_SIM/_build/linux-x86_64/release/exts/omni.isaac.synthetic_utils/omni/isaac/synthetic_utils/scripts/domainrandomization.py

When I invoked create_light_comp() function, I hit this error:

[Error] [carb.python] Can't execute command: "CreateLightComponentCommand", it wasn't registered or ambigious.

It seems the command was not successfully registered, though I could see it done here:

ISAAC_SIM/_build/linux-x86_64/release/exts/omni.isaac.dr/omni/isaac/dr/scripts/commands.py

And similar to all other commands defined in the module.

Then I tried printing omni.kit.commands.get_commands(), which does not inlude omni.isaac.dr's commands.

Does it happen in your machine?

Thanks.

Oh, so I tried adding this line into ISAAC_SIM/_build/linux-x86_64/release/exts/omni.isaac.dr/omni/isaac/dr/__init__.py:

from .scripts.commands import *

then the command could be invoked successfully. But I guess there might have some more official way to do it.

Besides, why don’t we just use

omni.kit.commands.register_all_commands_in_module(__name__)

as in here:
ISAAC_SIM/_build/target-deps/kit_sdk_release/_build/linux-x86_64/release/extsPhysics/omni.physx/omni/physx/scripts/commands.py ?

Hi Tadinu, I am not sure of the exact steps that you followed. The steps I followed are:

  • Launch Isaac Sim: ISAAC_SIM/_build/linux-x86_64/release/isaac-sim.sh
  • Paste the below script in script editor ( Windows->Script Editor ) and press Command->Execute in the script editor window to run the script
from omni.isaac.synthetic_utils.scripts import domainrandomization as dr

dr_class = dr.DomainRandomization()
dr_class.create_light_comp()

The script runs successfully without any error and creates a light component with default values.

Hi @sdebnath,

Yeah, actually I just prefer invoking an external script as part of a package, which might not be very convenient as being done inside the internal Sim script editor.
I suppose that it is set up somehow differently from the provided setup_python_env.sh so that I could see it does not have issues with API usage, like ones as running the script externally.

Besides, due to aiming at building a headless application, I was trying to instantiate the Sim from an external python script, without having to launch the Sim manually in advance.

Anyway, with that tweak above I could invoke the commands now, just curious if you have some other way.
Thanks.