Utilities [omni.isaac.utils]

The surface gripper extension provides an interface to the utilities package to be used with omni.isaac.dynamic_control.

Math Utils

This submodule provides math bindings for vector operations, and other facilitators such as lerp functions.

add(arg0: carb._carb.Float3, arg1: carb._carb.Float3) carb._carb.Float3
Parameters
  • arg0 (carb.Float3) – 3D vector

  • arg1 (carb.Float3) – 3D vector

Returns

arg0 + arg1.

Return type

carb.Float3

cross(arg0: carb._carb.Float3, arg1: carb._carb.Float3) carb._carb.Float3

Performs Cross product between 3D vectors :param arg0: 3D vector :type arg0: carb.Float3 :param arg1: 3D vector :type arg1: carb.Float3

Returns

cross poduct arg0 x arg1.

Return type

carb.Float3

dot(*args, **kwargs)

Overloaded function.

  1. dot(arg0: carb._carb.Float3, arg1: carb._carb.Float3) -> float

Performs Dot product between 3D vectors
Args:

arg0 (carb.Float3): 3D vector

arg1 (carb.Float3): 3D vector

Returns:

carb.Float3: dot poduct arg0 * arg1.

  1. dot(arg0: carb._carb.Float4, arg1: carb._carb.Float4) -> float

Performs Dot product between 4D vectors
Args:

arg0 (carb.Float4): 4D vector

arg1 (carb.Float4): 4D vector

Returns:

carb.Float4: dot poduct arg0 * arg1.

get_basis_vector_x(arg0: carb._carb.Float4) carb._carb.Float3

Gets Basis vector X of quaternion

Parameters

arg0 (carb.Float4) – Quaternion

Returns

Basis Vector X

Return type

carb.Float3

get_basis_vector_y(arg0: carb._carb.Float4) carb._carb.Float3

Gets Basis vector Y of quaternion

Parameters

arg0 (carb.Float4) – Quaternion

Returns

Basis Vector Y

Return type

carb.Float3

get_basis_vector_z(arg0: carb._carb.Float4) carb._carb.Float3

Gets Basis vector Z of quaternion

Parameters

arg0 (carb.Float4) – Quaternion

Returns

Basis Vector Z

Return type

carb.Float3

inverse(*args, **kwargs)

Overloaded function.

  1. inverse(arg0: carb._carb.Float4) -> carb._carb.Float4

Gets Inverse Quaternion

Args:

arg0 (carb.Float4): quaternion

Returns:

carb.Float4: The inverse quaternion

  1. inverse(arg0: omni::isaac::dynamic_control::DcTransform) -> omni::isaac::dynamic_control::DcTransform

Gets Inverse Transform

Args:

Returns:

lerp(*args, **kwargs)

Overloaded function.

  1. lerp(arg0: carb._carb.Float3, arg1: carb._carb.Float3, arg2: float) -> carb._carb.Float3

    Performs Linear interpolation between points arg0 and arg1

    Args:

    arg0 (carb.Float3): Point

    arg1 (carb.Float3): Point

    arg2 (float): distance from 0 to 1, where 0 is closest to arg0, and 1 is closest to arg1

    Returns:

    carb.Float3: Interpolated point

  2. lerp(arg0: carb._carb.Float4, arg1: carb._carb.Float4, arg2: float) -> carb._carb.Float4

    Performs Linear interpolation between quaternions arg0 and arg1

    Args:

    arg0 (carb.Float4): Quaternion

    arg1 (carb.Float4): Quaternion

    arg2 (float): distance from 0 to 1, where 0 is closest to arg0, and 1 is closest to arg1

    Returns:

    carb.Float4: Interpolated quaternion

  3. lerp(arg0: omni::isaac::dynamic_control::DcTransform, arg1: omni::isaac::dynamic_control::DcTransform, arg2: float) -> omni::isaac::dynamic_control::DcTransform

    Performs Linear interpolation between points arg0 and arg1

    Args:

    arg0 (omni.isaac.dynamic_control._dynamic_control.Transform): Transform

    arg1 (omni.isaac.dynamic_control._dynamic_control.Transform): Transform

    arg2 (float): distance from 0 to 1, where 0 is closest to arg0, and 1 is closest to arg1

    Returns:

mul(*args, **kwargs)

Overloaded function.

  1. mul(arg0: carb._carb.Float3, arg1: float) -> carb._carb.Float3

Scales a 3D vector by a given value

Args:

arg0 (carb.Float3): 3D vector

arg1 (float): scale factor

Returns:

carb.Float3: scaled vector.

  1. mul(arg0: carb._carb.Float4, arg1: float) -> carb._carb.Float4

Scales a 4D vector by a given value

Args:

arg0 (carb.Float4): 4D vector

arg1 (float): scale factor

Returns:

carb.Float4: scaled vector.

  1. mul(arg0: carb._carb.Float4, arg1: carb._carb.Float4) -> carb._carb.Float4

Performs a Quaternion rotation between two 4D vectors

Args:

arg0 (carb.Float4): first 4D quaternion vector

arg1 (carb.Float4): second 4D quaternion vector

Returns:

carb.Float4: rotated 4D quaternion vector.

  1. mul(arg0: omni::isaac::dynamic_control::DcTransform, arg1: omni::isaac::dynamic_control::DcTransform) -> omni::isaac::dynamic_control::DcTransform

Performs a Forward Transform multiplication between the transforms

normalize(*args, **kwargs)

Overloaded function.

  1. normalize(arg0: carb._carb.Float3) -> carb._carb.Float3

    Gets normalized 3D vector

    Args:

    arg0 (carb.Float3): 3D Vector

    Returns:

    carb.Float3: Normalized 3D Vector

  2. normalize(arg0: carb._carb.Float4) -> carb._carb.Float4

    Gets normalized 4D vector Args:

    arg0 (carb.Float4): 4D Vector

    Returns:

    carb.Float4: Normalized 4D Vector

rotate(arg0: carb._carb.Float4, arg1: carb._carb.Float3) carb._carb.Float3

rotates the 3D vector arg1 by the quaternion arg0

Parameters
  • arg0 (carb.Float4) – quaternion

  • arg1 (carb.Float3) – 3D Vector

Returns

Rotated 3D Vector

Return type

carb.Float3

slerp(*args, **kwargs)

Overloaded function.

  1. slerp(arg0: carb._carb.Float4, arg1: carb._carb.Float4, arg2: float) -> carb._carb.Float4

    Performs Spherical Linear interpolation between quaternions arg0 and arg1

    Args:

    arg0 (carb.Float4): Quaternion

    arg1 (carb.Float4): Quaternion

    arg2 (float): distance from 0 to 1, where 0 is closest to arg0, and 1 is closest to arg1

    Returns:

    carb.Float4: Interpolated quaternion

  2. slerp(arg0: omni::isaac::dynamic_control::DcTransform, arg1: omni::isaac::dynamic_control::DcTransform, arg2: float) -> omni::isaac::dynamic_control::DcTransform

    Performs Spherical Linear interpolation between points arg0 and arg1

    Args:

    arg0 (omni.isaac.dynamic_control._dynamic_control.Transform): Transform

    arg1 (omni.isaac.dynamic_control._dynamic_control.Transform): Transform

    arg2 (float): distance from 0 to 1, where 0 is closest to arg0, and 1 is closest to arg1

    Returns:

transform_inv(*args, **kwargs)

Overloaded function.

  1. transform_inv(arg0: omni::isaac::dynamic_control::DcTransform, arg1: omni::isaac::dynamic_control::DcTransform) -> omni::isaac::dynamic_control::DcTransform

    Computes local Transform of arg1 with respect to arg0: inv(arg0)*arg1

    Args:

    arg0 (omni.isaac.dynamic_control._dynamic_control.Transform): origin Transform

    arg1 (omni.isaac.dynamic_control._dynamic_control.Transform): Transform

    Returns:

    omni.isaac.dynamic_control._dynamic_control.Transform: resulting transform of inv(arg0)*arg1

  2. transform_inv(arg0: pxrInternal_v0_22__pxrReserved__::GfTransform, arg1: pxrInternal_v0_22__pxrReserved__::GfTransform) -> pxrInternal_v0_22__pxrReserved__::GfTransform

    Computes local Transform of arg1 with respect to arg0: inv(arg0)*arg1

    Args:

    arg0 (pxr.Transform): origin Transform

    arg1 (pxr.Transform): Transform

    Returns:

    oxr.Transform: resulting transform of inv(arg0)*arg1

set_scale(arg0: int, arg1: str, arg2: carb._carb.Float3) None

Set scale for an object in the stage

Parameters
  • arg0 (omni.isaac.dynamic_control._dynamic_control) – handle to dynamic control api

  • arg1 (int) – Stage ID

  • arg2 (carb::Float3) – scale

set_transform(arg0: int, arg1: str, arg2: carb._carb.Float3, arg3: carb._carb.Float4) None

Set transform for an object in the stage, handles physics objects if simulation is running using dynamic control

Parameters
  • arg0 (omni.isaac.dynamic_control._dynamic_control) – handle to dynamic control api

  • arg1 (int) – Stage ID

  • arg2 (carb::Float4) – translation

  • arg2 – rotation

Commands

class IsaacSimDestroyPrim(prim_path: str)

Bases: omni.kit.commands.command.Command

Command to set a delete a prim. This variant has less overhead than other commands as it doesn’t store an undo operation

Typical usage example:

omni.kit.commands.execute(
    "IsaacSimDestroyPrim",
    prim_path="/World/Prim,
)
class IsaacSimScalePrim(prim_path: str, scale: carb._carb.Float3 = (0, 0, 0))

Bases: omni.kit.commands.command.Command

Command to set a scale of a prim

Typical usage example:

omni.kit.commands.execute(
    "IsaacSimScalePrim",
    prim_path="/World/Prim,
    scale=(1.5, 1.5, 1.5),
)
class IsaacSimSpawnPrim(usd_path: str, prim_path: str, translation: carb._carb.Float3 = (0, 0, 0), rotation: carb._carb.Float4 = (0, 0, 0, 1))

Bases: omni.kit.commands.command.Command

Command to spawn a new prim in the stage and set its transform. This uses dynamic_control to properly handle physics objects and articulation

Typical usage example:

omni.kit.commands.execute(
    "IsaacSimSpawnPrim",
    usd_path="/path/to/file.usd",
    prim_path="/World/Prim,
    translation=(0, 0, 0),
    rotation=(0, 0, 0, 1),
)
class IsaacSimTeleportPrim(prim_path: str, translation: carb._carb.Float3 = (0, 0, 0), rotation: carb._carb.Float4 = (0, 0, 0, 1))

Bases: omni.kit.commands.command.Command

Command to set a transform of a prim. This uses dynamic_control to properly handle physics objects and articulation

Typical usage example:

omni.kit.commands.execute(
    "IsaacSimTeleportPrim",
    prim_path="/World/Prim,
    translation=(0, 0, 0),
    rotation=(0, 0, 0, 1),
)