scenic.simulators.isaac.utils

Helpers shared by the Isaac Sim model, simulators, and backends.

Summary of Module Members

Module Attributes

CONVERTED_MESH_SUFFIX

a self-contained binary glTF, bz2-compressed.

Functions

assetStem

The stem of an asset path, ignoring compression: a/b.usd.bz2 -> b.

colorToArray

compressFile

bz2-compress source into target (default: source + .bz2).

convertedMeshPaths

Names of the converted mesh and info JSON for an asset in output_dir.

decompressedPath

Return a plain-file path for path, decompressing a .bz2 file if needed.

defaultEnvironmentMeshPaths

Where the converted mesh and info JSON for an environment USD are cached.

environmentOutputsCurrent

Whether cached conversion outputs exist and are newer than a local source USD.

existingObjects

Return each registered existing Isaac object once.

getExistingObj

Return the ExistingIsaacSimObject for a prim path (or name) in the environment.

hasUrlScheme

Whether path is a URL rather than a local file path.

isCompressed

isIsaacAssetReference

Whether path is relative to the Isaac assets root (Isaac/...).

isPlanar

loadAssetMesh

Load a converted asset mesh (e.g. foo_usd.glb.bz2) as one volumetric mesh.

meshToObjFrame

Rotate a Z-up mesh into the Y-up frame the OBJ asset converter assumes.

planeToMesh

Extrude a planar mesh into a thin volume so it has a well-defined interior.

resolvedPath

uncompressedName

The file name of path without a trailing .bz2.

vectorToArray

writeMesh

Export a trimesh mesh or scene to path, bz2-compressing if it ends in .bz2.

Classes

EnvironmentMeshCache

Persistent cache for repaired Scenic meshes from a converted environment.

Member Details

uncompressedName(path)[source]

The file name of path without a trailing .bz2.

assetStem(path)[source]

The stem of an asset path, ignoring compression: a/b.usd.bz2 -> b.

compressFile(source, target=None, *, remove_source=False)[source]

bz2-compress source into target (default: source + .bz2).

decompressedPath(path)[source]

Return a plain-file path for path, decompressing a .bz2 file if needed.

Compressed files are decompressed once into ~/.cache/scenic/isaac and reused while the compressed file is unchanged. Since the decompressed copy lives elsewhere, a compressed USD must be self-contained (e.g. flattened).

isIsaacAssetReference(path)[source]

Whether path is relative to the Isaac assets root (Isaac/...).

hasUrlScheme(path)[source]

Whether path is a URL rather than a local file path.

A one-character scheme is a Windows drive letter (C:\assets\room.usd), which urlparse() happily reports as the scheme c.

CONVERTED_MESH_SUFFIX = '.glb.bz2'

a self-contained binary glTF, bz2-compressed.

Type:

Suffix of converted meshes

convertedMeshPaths(source, output_dir)[source]

Names of the converted mesh and info JSON for an asset in output_dir.

defaultEnvironmentMeshPaths(environmentUsdPath)[source]

Where the converted mesh and info JSON for an environment USD are cached.

Local USDs are converted next to the source (in a _converted folder); Isaac asset references and URLs are cached under ~/.cache/scenic.

environmentOutputsCurrent(environmentUsdPath, mesh_path, info_path)[source]

Whether cached conversion outputs exist and are newer than a local source USD.

writeMesh(mesh, path)[source]

Export a trimesh mesh or scene to path, bz2-compressing if it ends in .bz2.

The format is taken from the extension (.glb recommended: unlike .gltf it is a single self-contained file).

loadAssetMesh(path)[source]

Load a converted asset mesh (e.g. foo_usd.glb.bz2) as one volumetric mesh.

Suitable for MeshShape: the mesh is repaired if it has no well-defined volume. trimesh handles the compression.

meshToObjFrame(mesh)[source]

Rotate a Z-up mesh into the Y-up frame the OBJ asset converter assumes.

planeToMesh(mesh)[source]

Extrude a planar mesh into a thin volume so it has a well-defined interior.

class EnvironmentMeshCache(environment_mesh_path, environment_info_path)[source]

Persistent cache for repaired Scenic meshes from a converted environment.

Repairing every prim of a large environment into a watertight volume is slow, so results are stored next to the converted mesh and reused while the mesh and info files are unchanged.

getExistingObj(objName)[source]

Return the ExistingIsaacSimObject for a prim path (or name) in the environment.

existingObjects()[source]

Return each registered existing Isaac object once.