Hi everybody,
first off, thanks for the great tooling around Omniverse and Isaac Sim!
I’ve stumbled across a few code paths in the Python API which do not work or do not work as expected. I was able to work around these issues, so this post might be helpful for others having similar issues.
Data about my system:
Isaac Sim: 2021.1.1
OS: Ubuntu 18.04.5
System: Azure T4 (as suggested in the docs)
So here’s what I’ve found so far:
- most ISAAC related modules should be imported after a object of
OmniKitHelper
has been instantiated - actually it is done correctly in the ISAAC Python samples, but the docs do not explicitly state that this paradigm should be respected
- the problem for me was that when I imported e.g.
from pxr import UsdGeom
before aOmniKitHelper
object was created, I got a few errors in the log output, but ISAAC Sim started just fine and seemed to be working - the issue got apparent when MDLs were involved in my scene, because they did not get loaded correctly anymore
=> I would suggest to emphasize this aspect (import after OmniKitHelper
was created) more in the samples and docs
In $HOME/.local/share/ov/pkg/isaac_sim-2021.1.1/exts/omni.isaac.synthetic_utils/omni/isaac/synthetic_utils/scripts/synthetic_data.py
- l.127,
get_pose
is missing a argument -
get_pose
is invoked in l.208gt[sensor] = self.sensor_helpers[sensor](viewport)
with viewport as argument - I would suggest to just add a unused argument to
get_pose
- however if that is done, the method crashes in l.134
prim_path = m[0]
- I found that the
prim_path
is actually stored at index1
- print output was
(1, '/World/fullmodel/rigid', 1, 'ilm', list( ... ), '')
- print output was
- similarly this applies to l.137
pose.append((str(prim_path), m[1], str(m[2]), np.array(prim_tf)))
, where class and label are stored at indices 2 and 3 respectively
Final snippet looks like this:
def get_pose(self, viewport):
"""Get pose of all objects with a semantic label.
"""
stage = omni.usd.get_context().get_stage()
mappings = self.generic_helper_lib.get_instance_mappings()
pose = []
for m in mappings:
prim_path = m[1]
prim = stage.GetPrimAtPath(prim_path)
prim_tf = UsdGeom.Xformable(prim).ComputeLocalToWorldTransform(0.0)
pose.append((str(prim_path), m[2], str(m[3]), np.array(prim_tf)))
return pose
In $HOME/.local/share/ov/pkg/isaac_sim-2021.1.1/exts/omni.isaac.synthetic_utils/omni/isaac/synthetic_utils/scripts/writer.py
- l.197
sensor_settings[name] = copy.deepcopy(sensor_settings_viewport)
module “copy” does not exist (not imported) - this path only gets executed when the parameter
sensor_settings
with the valueNone
(which is its default value) - if
sensor_settings
is notNone
, then there is no issue (that’s how it is done in the ISAAC Sim samples)
I hope this helpful to someone. In case of questions feel free to ask. I will also update this post if I come across other issues!