Isaac Cloner [omni.isaac.cloner]

Base Cloner

class Cloner

This class provides a set of simple APIs to make duplication of objects simple. Objects can be cloned using this class to create copies of the same object, placed at user-specified locations in the scene.

Note that the cloning process is performed in a for-loop, so performance should be expected to follow linear scaling with an increase of clones.

clone(source_prim_path: str, prim_paths: List[str], positions: Optional[numpy.ndarray] = None, orientations: Optional[numpy.ndarray] = None, replicate_physics: bool = False, base_env_path: Optional[str] = None, root_path: Optional[str] = None)
Clones a source prim at user-specified destination paths.

Clones will be placed at user-specified positions and orientations.

Parameters
  • source_prim_path (str) – Path of source object.

  • prim_paths (List[str]) – List of destination paths.

  • positions (np.ndarray) – Numpy array containing target positions of clones. Dimension must equal length of prim_paths. Defaults to None. Clones will be placed at (0, 0, 0) if not specified.

  • orientations (np.ndarray) – Numpy array containing target orientations of clones. Dimension must equal length of prim_paths. Defaults to None. Clones will have identity orientation (1, 0, 0, 0) if not specified.

  • replicate_physics (bool) – Uses omni.physics replication. This will replicate physics properties directly for paths beginning with root_path and skip physics parsing for anything under the base_env_path.

  • base_env_path (str) – Path to namespace for all environments. Required if replicate_physics=True and define_base_env() not called.

  • root_path (str) – Prefix path for each environment. Required if replicate_physics=True and generate_paths() not called.

Raises

Exception – Raises exception if source prim path is not valid.

define_base_env(base_env_path: str)

Creates a USD Scope at base_env_path. This is designed to be the parent that holds all clones.

Parameters

base_env_path (str) – Path to create the USD Scope at.

filter_collisions(physicsscene_path: str, collision_root_path: str, prim_paths: List[str], global_paths: List[str] = [])

Filters collisions between clones. Clones will not collide with each other, but can collide with objects specified in global_paths.

Parameters
  • physicsscene_path (str) – Path to PhysicsScene object in stage.

  • collision_root_path (str) – Path to place collision groups under.

  • prim_paths (List[str]) – Paths of objects to filter out collision.

  • global_paths (List[str]) – Paths of objects to generate collision (e.g. ground plane).

generate_paths(root_path: str, num_paths: int)

Generates a list of paths under the root path specified.

Parameters
  • root_path (str) – Base path where new paths will be created under.

  • num_paths (int) – Number of paths to generate.

Returns

A list of paths

Return type

paths (List[str])

Grid Cloner

class Cloner

This class provides a set of simple APIs to make duplication of objects simple. Objects can be cloned using this class to create copies of the same object, placed at user-specified locations in the scene.

Note that the cloning process is performed in a for-loop, so performance should be expected to follow linear scaling with an increase of clones.

clone(source_prim_path: str, prim_paths: List[str], positions: Optional[numpy.ndarray] = None, orientations: Optional[numpy.ndarray] = None, replicate_physics: bool = False, base_env_path: Optional[str] = None, root_path: Optional[str] = None)
Clones a source prim at user-specified destination paths.

Clones will be placed at user-specified positions and orientations.

Parameters
  • source_prim_path (str) – Path of source object.

  • prim_paths (List[str]) – List of destination paths.

  • positions (np.ndarray) – Numpy array containing target positions of clones. Dimension must equal length of prim_paths. Defaults to None. Clones will be placed at (0, 0, 0) if not specified.

  • orientations (np.ndarray) – Numpy array containing target orientations of clones. Dimension must equal length of prim_paths. Defaults to None. Clones will have identity orientation (1, 0, 0, 0) if not specified.

  • replicate_physics (bool) – Uses omni.physics replication. This will replicate physics properties directly for paths beginning with root_path and skip physics parsing for anything under the base_env_path.

  • base_env_path (str) – Path to namespace for all environments. Required if replicate_physics=True and define_base_env() not called.

  • root_path (str) – Prefix path for each environment. Required if replicate_physics=True and generate_paths() not called.

Raises

Exception – Raises exception if source prim path is not valid.

define_base_env(base_env_path: str)

Creates a USD Scope at base_env_path. This is designed to be the parent that holds all clones.

Parameters

base_env_path (str) – Path to create the USD Scope at.

filter_collisions(physicsscene_path: str, collision_root_path: str, prim_paths: List[str], global_paths: List[str] = [])

Filters collisions between clones. Clones will not collide with each other, but can collide with objects specified in global_paths.

Parameters
  • physicsscene_path (str) – Path to PhysicsScene object in stage.

  • collision_root_path (str) – Path to place collision groups under.

  • prim_paths (List[str]) – Paths of objects to filter out collision.

  • global_paths (List[str]) – Paths of objects to generate collision (e.g. ground plane).

generate_paths(root_path: str, num_paths: int)

Generates a list of paths under the root path specified.

Parameters
  • root_path (str) – Base path where new paths will be created under.

  • num_paths (int) – Number of paths to generate.

Returns

A list of paths

Return type

paths (List[str])

class GridCloner(spacing: float, num_per_row: int = - 1)

This is a specialized Cloner class that will automatically generate clones in a grid fashion.

clone(source_prim_path: str, prim_paths: List[str], position_offsets: Optional[numpy.ndarray] = None, orientation_offsets: Optional[numpy.ndarray] = None, replicate_physics: bool = False, base_env_path: Optional[str] = None, root_path: Optional[str] = None)

Creates clones in a grid fashion. Positions of clones are computed automatically.

Parameters
  • source_prim_path (str) – Path of source object.

  • prim_paths (List[str]) – List of destination paths.

  • position_offsets (np.ndarray) – Positions to be applied as local translations on top of computed clone position. Defaults to None, no offset will be applied.

  • orientation_offsets (np.ndarray) – Orientations to be applied as local rotations for each clone. Defaults to None, no offset will be applied.

  • replicate_physics (bool) – Uses omni.physics replication. This will replicate physics properties directly for paths beginning with root_path and skip physics parsing for anything under the base_env_path.

  • base_env_path (str) – Path to namespace for all environments. Required if replicate_physics=True and define_base_env() not called.

  • root_path (str) – Prefix path for each environment. Required if replicate_physics=True and generate_paths() not called.

Returns

Computed positions of all clones.

Return type

positions (List)

define_base_env(base_env_path: str)

Creates a USD Scope at base_env_path. This is designed to be the parent that holds all clones.

Parameters

base_env_path (str) – Path to create the USD Scope at.

filter_collisions(physicsscene_path: str, collision_root_path: str, prim_paths: List[str], global_paths: List[str] = [])

Filters collisions between clones. Clones will not collide with each other, but can collide with objects specified in global_paths.

Parameters
  • physicsscene_path (str) – Path to PhysicsScene object in stage.

  • collision_root_path (str) – Path to place collision groups under.

  • prim_paths (List[str]) – Paths of objects to filter out collision.

  • global_paths (List[str]) – Paths of objects to generate collision (e.g. ground plane).

generate_paths(root_path: str, num_paths: int)

Generates a list of paths under the root path specified.

Parameters
  • root_path (str) – Base path where new paths will be created under.

  • num_paths (int) – Number of paths to generate.

Returns

A list of paths

Return type

paths (List[str])