scenic.simulators.isaac.backends.base

Summary of Module Members

Module Attributes

WHEEL_CONTROLLERS

Values of wheelController handled by the built-in wheeled-robot support.

Functions

isWheeledRobot

positionArray

Convert a Scenic Vector or any 3-sequence to a numpy array.

rotationToWxyz

Convert a scipy Rotation to an Isaac/USD scalar-first quaternion array.

wxyzToRotation

Convert one or more Isaac/USD scalar-first quaternions to a scipy Rotation.

Classes

IsaacBackend

Interface implemented by Isaac Sim API backends.

Member Details

WHEEL_CONTROLLERS = frozenset({'ackermann', 'differential', 'holonomic'})

Values of wheelController handled by the built-in wheeled-robot support.

positionArray(position)[source]

Convert a Scenic Vector or any 3-sequence to a numpy array.

wxyzToRotation(quat_wxyz)[source]

Convert one or more Isaac/USD scalar-first quaternions to a scipy Rotation.

rotationToWxyz(rotation)[source]

Convert a scipy Rotation to an Isaac/USD scalar-first quaternion array.

class IsaacBackend[source]

Interface implemented by Isaac Sim API backends.

Methods raising NotImplementedError must be provided by each backend; the rest are shared helpers that only depend on USD (pxr) or on APIs common to every supported Isaac Sim release.

attachSimulationApp(app)[source]

Use an already-running app (e.g. the Isaac editor) instead of launching one.

kitUsdPath(path)[source]

Resolve an Isaac/... asset reference, URL, or local path for Kit.

A bz2-compressed local USD is decompressed into a cache first.

objectUsdPath(obj)[source]

Return the USD path to spawn for an object with usdPath/isaacAssetPath.

exportMeshToUsd(mesh, name, tmp_dir)[source]

Write a trimesh to tmp_dir as OBJ and convert it to a USD asset.

ensureEnvironmentMeshPaths(environmentUsdPath, environment_mesh_path=None, environment_info_path=None, *, headless=True, overwrite=False)[source]

Return (mesh, info) paths for an environment USD, converting it if needed.

The converted GLTF mesh and JSON prim metadata are what the Scenic model uses to reason about existing objects in the environment.

computePrimWorldBbox(prim_path)[source]

Return world-space bbox min, max, center, and size for a prim.

computeUsdAssetBbox(usd_path)[source]

Return the composed bbox of a USD asset referenced at the origin.

computePrimBbox(prim)[source]

Return world-space bbox min, max, center, and size for a USD prim.

scenicToIsaacOrientation(orientation, initial_rotation=None)[source]

Convert a Scenic Orientation to an Isaac Sim wxyz quaternion.

initial_rotation (yaw, pitch, roll) is applied first, to align an asset’s native frame with Scenic’s (see e.g. model.scenic’s built-in wheeled robots, whose USD assets are authored with local +X as forward instead of Scenic’s local +Y). The composition is done as a full rotation, not just on yaw, so it is correct for any combination of yaw, pitch, and roll in either orientation or initial_rotation.

isaacQuatToScenicEulerAngles(quat, initial_rotation=None)[source]

Convert an Isaac Sim wxyz quaternion to Scenic yaw, pitch, roll.

initial_rotation must be passed whenever the object was spawned with it (see scenicToIsaacOrientation), so the asset-frame correction is undone and the result is the object’s actual Scenic orientation rather than that orientation composed with the correction.

rotateVectorByWxyzQuat(quat_wxyz, vec)[source]

Rotate a vector by an Isaac/USD wxyz quaternion.

computeUsdScaleAndRootPosition(obj, prim_path, scenic_position, orientation)[source]

Compute the scale and root position for a spawned prim (see computeScaleAndRootPosition).

computeUsdAssetScaleAndRootPosition(obj, usd_path, scenic_position, orientation)[source]

Compute the scale and root position for a USD asset before it is spawned.

computeScaleAndRootPosition(obj, native_center, native_size, scenic_position, orientation)[source]

Compute the scale and root position so an asset matches Scenic’s dimensions.

Returns:

root_position – position to give the USD root prim local_scale: x/y/z scale to apply to the USD root prim native_size: measured unscaled USD bbox size native_center: measured unscaled USD bbox center relative to the root

manipulatorRootPosition(obj)[source]

Scenic positions an arm by its bounding box center; the USD root is at its base.