Running python code with opened Isaac Sim

Hi,
I’m new to the Isaac Sim and I’m struggling a little bit with connecting Isaac Sim to my code to simulate my program.
I found couple of python utlity snippets here, which if I copy-paste to Window->Script Editor in Isaac Sim and hit Run, it works. Unfortunately, I don’t know how to run this code in current opened Isaac Sim outside of Isaac Sim Script editor (for example python file in terminal or in VS code). I tried to ./python.sh path/to/code.py but this ends up with the following error:

CARB_SETTINGS = carb.settings.acquire_settings_interface()
RuntimeError: Failed to acquire interface: carb::settings::ISettings (pluginName: nullptr)

Then I tried creating anaconda environment as described here, but if I try to run the same python code it cannot find carb package.

I noticed, code in python_samples folder is working with ./python.sh but it’s opening new Isaac Sim instance and it’s so sloooow to open new instance every time I want to try few new lines of code to learn with scripting in Isaac Sim.

Am I missing something? Is it possible to run code in opened Isaac Sim Instance?
Thank you!

PS: I think I’m not the only one struggling with this. I found this and he has the same problem.

PS: In the end, I would like to have a script, which adds obj file (container) into a scene on predefined place and fill this container with another obj file with multiple instances. Than run another script, which can control robot (read and write joints position, speed, etc) and reading data from sensors (camera, etc.)

1 Like

Hi @email5

Maybe it is not the best practice but if you don’t want to open a new Isaac Sim instance each time you can try programming in a custom extension…

Automatic code reloading works with extensions. If you check the documentation (Native Workstation Deployment — Omniverse Robotics documentation), the example is an extension (located in an extension folder: exts )

exts/omni.isaac.samples/omni/isaac/samples/scripts

A quote from the Extension Discovery service in Omniverse:

“The Extension system monitors specified extension search folders (or direct paths) for changes. It automatically syncs all changed/added/removed extensions”

The following extensions are good starting point:

  • PATH_TO_ISAAC_SIM/kit/exts/omni.example.hello (simple)
  • PATH_TO_ISAAC_SIM/exts/omni.isaac.samples (advanced)

Just make a copy of the folder and change internally folder names and .toml config file to use them as your custom extension

Thank you so much for your answer. I appreciate it is now described in documentation in Required Tutorials: 3. Hello world.