Core API Hello World not working

Hello I am attempting to run the Core API Hello World tutorial but vscode says it cannot find omni.isaac.core although it can find omni.isaac.examples.
I know this isn’t just a linter bug because when I ctrl+s the cube I add is not being added.

This is my code

# Copyright (c) 2020-2021, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.

from omni.isaac.examples.base_sample import BaseSample
import numpy as np
from omni.isaac.core.objects import DynamicCuboid
# Note: checkout the required tutorials at https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html


class HelloWorld(BaseSample):
    def __init__(self) -> None:
        super().__init__()
        return

    def setup_scene(self):

        world = self.get_world()
        world.scene.add_default_ground_plane()

        fancy_cube = world.scene.add(

            DynamicCuboid(

                prim_path="/World/random_cube", # The prim path of the cube in the USD stage

                name="fancy_cube", # The unique name used to retrieve the object from the scene later on

                position=np.array([0, 0, 1.0]), # Using the current stage units which is in meters by default.

                scale=np.array([0.5015, 0.5015, 0.5015]), # most arguments accept mainly numpy arrays.

                color=np.array([0, 0, 1.0]), # RGB channels, going from 0-1

            ))
        return

    async def setup_post_load(self):
        return

    async def setup_pre_reset(self):
        return

    async def setup_post_reset(self):
        return

    def world_cleanup(self):
        return

settings.json

{
    "ros.distro": "humble"
}

There’s no launch.json or tasks.json

Is this normal for the hello world example?
Is there somewhere I can install the correct version?
I am on ubuntu 22.04 using a conda environment for python, although even a python install outside conda didn’t work either.

Thank you

@mittelmandaniel presumably you are following the Hello World tutorial from here, i wonder if any of the following docs would be relevant:

  1. 5. Python Environment Installation — Omniverse IsaacSim latest documentation
  2. Debugging With Visual Studio Code — Omniverse IsaacSim latest documentation
  3. Python Environment — Omniverse IsaacSim latest documentation

Yes I looked at those but the .vscode file they reference only contains a setting.json and is missing the features described.

When I look at Python Environment — Omniverse IsaacSim latest documentation

I could attempt to copy the contents and just make new files, but it’s unclear what the workspace should be here as the stage and all related files are in omni.isaac.examples.

I would really appreciate some help figuring that out.

Edit: Will attempt to follow instructions above Python Environment — Omniverse IsaacSim latest documentation

Sorry I seemed to have missed it

Edit Edit: wait nevermind the instructions at the top are not for running vscode?
Should I still run python.sh? It looks like it’s for running python programs straight in the terminal.
Sorry for all the questions I’m new and trying to learn

Update: I ran python_setup.sh and conda_setup.sh in the terminal and now when I load the example the cube is added.
Although vs-code’s linter is still bugging out, I’ll check if this is fixed once I make the conda environment from the .yml

It was not fixed
So I went to the vscode section and attempted the settings.json over

"python.defaultInterpreterPath": "$/home/daniel/.local/share/ov/pkg/isaac_sim-2022.2.1/kit/python/bin/python3",

Note: The command is defaultInterpreterPath now not pythonPath like in the docs.

It didn’t work although.
This shouldn’t really do anything though as I’m using the conda env
It seems like there’s also a python.analysis.extrapaths argument that’s supposed to be there but the docs did not specify what the argument is supposed to be.

this is outside of my experience and expertise, i am afraid. so i’ll defer to the mods/devs and/or other helpful community members.

New findings and my solution:

This seems to also be a problem here 1. Hello World — Omniverse IsaacSim latest documentation in section 1.4 in the video.

Additionally this seems to have been mentioned here: VSCode setup for Isaac Sim although the solution did not fully fix the problem.

So finally here was my two solutions.

Open the folder containing all the omni.XXXX files (for me this was the ext folder)
Then add

“python.analysis.extraPaths”: [
“./omni.isaac.core”
]

To the settings.json in the .vscode folder in there.

This allows the linter to analyze it and fixes the problem.

Alternatively though you can just be in the omni.isaac.examples folder looking at your example exactly as the UI links you to
and then add
“python.analysis.extraPaths”: [
“…/omni.isaac.core”
]

1 Like

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