omni.isaac.lab.sim.spawners#
Sub-module containing utilities for creating prims in Omniverse.
Spawners are used to create prims into Omniverse simulator. At their core, they are calling the USD Python API or Omniverse Kit Commands to create prims. However, they also provide a convenient interface for creating prims from their respective config classes.
There are two main ways of using the spawners:
Using the function from the module
import omni.isaac.lab.sim as sim_utils from omni.isaac.lab.utils.assets import ISAACLAB_NUCLEUS_DIR # spawn from USD file cfg = sim_utils.UsdFileCfg(usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/FrankaEmika/panda_instanceable.usd") prim_path = "/World/myAsset" # spawn using the function from the module sim_utils.spawn_from_usd(prim_path, cfg)
Using the func reference in the config class
import omni.isaac.lab.sim as sim_utils from omni.isaac.lab.utils.assets import ISAACLAB_NUCLEUS_DIR # spawn from USD file cfg = sim_utils.UsdFileCfg(usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/FrankaEmika/panda_instanceable.usd") prim_path = "/World/myAsset" # use the `func` reference in the config class cfg.func(prim_path, cfg)
For convenience, we recommend using the second approach, as it allows to easily change the config class and the function call in a single line of code.
Depending on the type of prim, the spawning-functions can also deal with the creation of prims
over multiple prim path. These need to be provided as a regex prim path expressions, which are
resolved based on the parent prim paths using the omni.isaac.lab.sim.utils.clone()
function decorator.
For example:
/World/Table_[1,2]/Robot
will create the prims/World/Table_1/Robot
and/World/Table_2/Robot
only if the parent prim/World/Table_1
and/World/Table_2
exist./World/Robot_[1,2]
will NOT create the prims/World/Robot_1
and/World/Robot_2
as the prim path expression can be resolved to multiple prims.
Submodules
Sub-module for spawning primitive shapes in the simulation. |
|
Sub-module for spawning meshes in the simulation. |
|
Sub-module for spawners that spawn lights in the simulation. |
|
Sub-module for spawners that spawn sensors in the simulation. |
|
Sub-module for spawners that spawn assets from files. |
|
Sub-module for spawners that spawn USD-based and PhysX-based materials. |
|
Sub-module for wrapping spawner configurations. |
Classes
Configuration parameters for spawning an asset. |
|
Configuration parameters for spawning a rigid asset. |
|
Configuration parameters for spawning a deformable asset. |
Spawners#
- class omni.isaac.lab.sim.spawners.SpawnerCfg[source]#
Configuration parameters for spawning an asset.
Spawning an asset is done by calling the
func
function. The function takes in the prim path to spawn the asset at, the configuration instance and transformation, and returns the prim path of the spawned asset.The function is typically decorated with
omni.isaac.lab.sim.spawner.utils.clone()
decorator that checks if input prim path is a regex expression and spawns the asset at all matching prims. For this, the decorator uses the Cloner API from Isaac Sim and handles thecopy_from_source
parameter.Attributes:
Function to use for spawning the asset.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
- func: Callable[[...], pxr.Usd.Prim]#
Function to use for spawning the asset.
The function takes in the prim path (or expression) to spawn the asset at, the configuration instance and transformation, and returns the source prim spawned.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- class omni.isaac.lab.sim.spawners.RigidObjectSpawnerCfg[source]#
Bases:
SpawnerCfg
Configuration parameters for spawning a rigid asset.
Note
By default, all properties are set to None. This means that no properties will be added or modified to the prim outside of the properties available by default when spawning the prim.
Attributes:
Mass properties.
Function to use for spawning the asset.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- func: Callable[..., Usd.Prim]#
Function to use for spawning the asset.
The function takes in the prim path (or expression) to spawn the asset at, the configuration instance and transformation, and returns the source prim spawned.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- class omni.isaac.lab.sim.spawners.DeformableObjectSpawnerCfg[source]#
Bases:
SpawnerCfg
Configuration parameters for spawning a deformable asset.
Unlike rigid objects, deformable objects are affected by forces and can deform when subjected to external forces. This class is used to configure the properties of the deformable object.
Deformable bodies don’t have a separate collision mesh. The collision mesh is the same as the visual mesh. The collision properties such as rest and collision offsets are specified in the
deformable_props
.Note
By default, all properties are set to None. This means that no properties will be added or modified to the prim outside of the properties available by default when spawning the prim.
Attributes:
Function to use for spawning the asset.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
- func: Callable[..., Usd.Prim]#
Function to use for spawning the asset.
The function takes in the prim path (or expression) to spawn the asset at, the configuration instance and transformation, and returns the source prim spawned.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
Shapes#
Sub-module for spawning primitive shapes in the simulation.
NVIDIA Omniverse provides various primitive shapes that can be used to create USDGeom prims. Based on the configuration, the spawned prim can be:
a visual mesh (no physics)
a static collider (no rigid body)
a rigid body (with collision and rigid body properties).
Classes
Configuration parameters for a USD Geometry or Geom prim. |
|
Configuration parameters for a capsule prim. |
|
Configuration parameters for a cone prim. |
|
Configuration parameters for a cuboid prim. |
|
Configuration parameters for a cylinder prim. |
|
Configuration parameters for a sphere prim. |
- class omni.isaac.lab.sim.spawners.shapes.ShapeCfg[source]#
Configuration parameters for a USD Geometry or Geom prim.
Attributes:
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- omni.isaac.lab.sim.spawners.shapes.spawn_capsule(prim_path: str, cfg: shapes_cfg.CapsuleCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USDGeom-based capsule prim with the given attributes.
For more information, see USDGeomCapsule.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.shapes.CapsuleCfg[source]#
Bases:
ShapeCfg
Configuration parameters for a capsule prim.
See
spawn_capsule()
for more information.Attributes:
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
Radius of the capsule (in m).
Height of the capsule (in m).
Axis of the capsule.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- omni.isaac.lab.sim.spawners.shapes.spawn_cone(prim_path: str, cfg: shapes_cfg.ConeCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USDGeom-based cone prim with the given attributes.
For more information, see USDGeomCone.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.shapes.ConeCfg[source]#
Bases:
ShapeCfg
Configuration parameters for a cone prim.
See
spawn_cone()
for more information.Attributes:
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
Radius of the cone (in m).
Height of the v (in m).
Axis of the cone.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- omni.isaac.lab.sim.spawners.shapes.spawn_cuboid(prim_path: str, cfg: shapes_cfg.CuboidCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USDGeom-based cuboid prim with the given attributes.
For more information, see USDGeomCube.
Note
Since USD only supports cubes, we set the size of the cube to the minimum of the given size and scale the cube accordingly.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
If a prim already exists at the given path. –
- class omni.isaac.lab.sim.spawners.shapes.CuboidCfg[source]#
Bases:
ShapeCfg
Configuration parameters for a cuboid prim.
See
spawn_cuboid()
for more information.Attributes:
Size of the cuboid.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- omni.isaac.lab.sim.spawners.shapes.spawn_cylinder(prim_path: str, cfg: shapes_cfg.CylinderCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USDGeom-based cylinder prim with the given attributes.
For more information, see USDGeomCylinder.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.shapes.CylinderCfg[source]#
Bases:
ShapeCfg
Configuration parameters for a cylinder prim.
See
spawn_cylinder()
for more information.Attributes:
Radius of the cylinder (in m).
Height of the cylinder (in m).
Axis of the cylinder.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- omni.isaac.lab.sim.spawners.shapes.spawn_sphere(prim_path: str, cfg: shapes_cfg.SphereCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USDGeom-based sphere prim with the given attributes.
For more information, see USDGeomSphere.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.shapes.SphereCfg[source]#
Bases:
ShapeCfg
Configuration parameters for a sphere prim.
See
spawn_sphere()
for more information.Attributes:
Radius of the sphere (in m).
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
Meshes#
Sub-module for spawning meshes in the simulation.
NVIDIA Omniverse deals with meshes as USDGeomMesh prims. This sub-module provides various configurations to spawn different types of meshes. Based on the configuration, the spawned prim can be:
a visual mesh (no physics)
a static collider (no rigid or deformable body)
a deformable body (with deformable properties)
Note
While rigid body properties can be set on a mesh, it is recommended to use the
omni.isaac.lab.sim.spawners.shapes
module to spawn rigid bodies. This is because USD shapes
are more optimized for physics simulations.
Classes
Configuration parameters for a USD Geometry or Geom prim. |
|
Configuration parameters for a capsule mesh prim. |
|
Configuration parameters for a cone mesh prim. |
|
Configuration parameters for a cuboid mesh prim with deformable properties. |
|
Configuration parameters for a cylinder mesh prim with deformable properties. |
|
Configuration parameters for a sphere mesh prim with deformable properties. |
- class omni.isaac.lab.sim.spawners.meshes.MeshCfg[source]#
Configuration parameters for a USD Geometry or Geom prim.
This class is similar to
ShapeCfg
but is specifically for meshes.Meshes support both rigid and deformable properties. However, their schemas are applied at different levels in the USD hierarchy based on the type of the object. These are described below:
Deformable body properties: Applied to the mesh prim:
{prim_path}/geometry/mesh
.Collision properties: Applied to the mesh prim:
{prim_path}/geometry/mesh
.Rigid body properties: Applied to the parent prim:
{prim_path}
.
where
{prim_path}
is the path to the prim in the USD stage and{prim_path}/geometry/mesh
is the path to the mesh prim.Note
There are mututally exclusive parameters for rigid and deformable properties. If both are set, then an error will be raised. This also holds if collision and deformable properties are set together.
Attributes:
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: materials.VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: materials.PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- omni.isaac.lab.sim.spawners.meshes.spawn_mesh_capsule(prim_path: str, cfg: meshes_cfg.MeshCapsuleCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USD-Mesh capsule prim with the given attributes.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.meshes.MeshCapsuleCfg[source]#
Bases:
MeshCfg
Configuration parameters for a capsule mesh prim.
See
spawn_capsule()
for more information.Attributes:
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
Radius of the capsule (in m).
Height of the capsule (in m).
Axis of the capsule.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: materials.VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: materials.PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- axis: Literal['X', 'Y', 'Z']#
Axis of the capsule. Defaults to “Z”.
- omni.isaac.lab.sim.spawners.meshes.spawn_mesh_cone(prim_path: str, cfg: meshes_cfg.MeshConeCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USD-Mesh cone prim with the given attributes.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.meshes.MeshConeCfg[source]#
Bases:
MeshCfg
Configuration parameters for a cone mesh prim.
See
spawn_cone()
for more information.Attributes:
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
Radius of the cone (in m).
Height of the v (in m).
Axis of the cone.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: materials.VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: materials.PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- axis: Literal['X', 'Y', 'Z']#
Axis of the cone. Defaults to “Z”.
- omni.isaac.lab.sim.spawners.meshes.spawn_mesh_cuboid(prim_path: str, cfg: meshes_cfg.MeshCuboidCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USD-Mesh cuboid prim with the given attributes.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.meshes.MeshCuboidCfg[source]#
Bases:
MeshCfg
Configuration parameters for a cuboid mesh prim with deformable properties.
See
spawn_mesh_cuboid()
for more information.Attributes:
Size of the cuboid (in m).
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: materials.VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: materials.PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- omni.isaac.lab.sim.spawners.meshes.spawn_mesh_cylinder(prim_path: str, cfg: meshes_cfg.MeshCylinderCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USD-Mesh cylinder prim with the given attributes.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.meshes.MeshCylinderCfg[source]#
Bases:
MeshCfg
Configuration parameters for a cylinder mesh prim with deformable properties.
See
spawn_cylinder()
for more information.Attributes:
Radius of the cylinder (in m).
Height of the cylinder (in m).
Axis of the cylinder.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
- axis: Literal['X', 'Y', 'Z']#
Axis of the cylinder. Defaults to “Z”.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: materials.VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: materials.PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
- omni.isaac.lab.sim.spawners.meshes.spawn_mesh_sphere(prim_path: str, cfg: meshes_cfg.MeshSphereCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USD-Mesh sphere prim with the given attributes.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.meshes.MeshSphereCfg[source]#
Bases:
MeshCfg
Configuration parameters for a sphere mesh prim with deformable properties.
See
spawn_mesh_sphere()
for more information.Attributes:
Radius of the sphere (in m).
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Path to the visual material to use for the prim.
Visual material properties.
Path to the physics material to use for the prim.
Physics material properties.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: materials.VisualMaterialCfg | None#
Visual material properties.
Note
If None, then no visual material will be added.
- physics_material_path: str#
Path to the physics material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if physics_material is not None.
- physics_material: materials.PhysicsMaterialCfg | None#
Physics material properties.
Note
If None, then no physics material will be added.
Lights#
Sub-module for spawners that spawn lights in the simulation.
There are various different kinds of lights that can be spawned into the USD stage. Please check the Omniverse documentation for lighting overview.
Classes
Configuration parameters for creating a light in the scene. |
|
Configuration parameters for creating a cylinder light in the scene. |
|
Configuration parameters for creating a disk light in the scene. |
|
Configuration parameters for creating a distant light in the scene. |
|
Configuration parameters for creating a dome light in the scene. |
|
Configuration parameters for creating a sphere light in the scene. |
- omni.isaac.lab.sim.spawners.lights.spawn_light(prim_path: str, cfg: lights_cfg.LightCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a light prim at the specified prim path with the specified configuration.
The created prim is based on the USD.LuxLight API.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration for the light source.
translation – The translation of the prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation of the prim as (w, x, y, z). Defaults to None, in which case this is set to identity.
- Raises:
ValueError – When a prim already exists at the specified prim path.
- class omni.isaac.lab.sim.spawners.lights.LightCfg[source]#
Configuration parameters for creating a light in the scene.
Please refer to the documentation on USD LuxLight for more information.
Note
The default values for the attributes are those specified in the their official documentation.
Attributes:
The prim type name for the light prim.
The color of emitted light, in energy-linear terms.
Enables color temperature.
Color temperature (in Kelvin) representing the white point.
Normalizes power by the surface area of the light.
Scales the power of the light exponentially as a power of 2.
Scales the power of the light linearly.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
- color: tuple[float, float, float]#
The color of emitted light, in energy-linear terms. Defaults to white.
- color_temperature: float#
Color temperature (in Kelvin) representing the white point. The valid range is [1000, 10000]. Defaults to 6500K.
The color temperature corresponds to the warmth or coolness of light. Warmer light has a lower color temperature, while cooler light has a higher color temperature.
Note
It only takes effect when
enable_color_temperature
is true.
- normalize: bool#
Normalizes power by the surface area of the light. Defaults to false.
This makes it easier to independently adjust the power and shape of the light, by causing the power to not vary with the area or angular size of the light.
- exposure: float#
Scales the power of the light exponentially as a power of 2. Defaults to 0.0.
The result is multiplied against the intensity.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- class omni.isaac.lab.sim.spawners.lights.CylinderLightCfg[source]#
Configuration parameters for creating a cylinder light in the scene.
A cylinder light is a light source that emits light from a cylinder. It is useful for simulating fluorescent lights. For more information, please refer to the documentation on USDLux CylinderLight.
Note
The default values for the attributes are those specified in the their official documentation.
Attributes:
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
The color of emitted light, in energy-linear terms.
Enables color temperature.
Color temperature (in Kelvin) representing the white point.
Normalizes power by the surface area of the light.
Scales the power of the light exponentially as a power of 2.
Scales the power of the light linearly.
The prim type name for the light prim.
Length of the cylinder (in m).
Radius of the cylinder (in m).
Treats the cylinder as a line source, i.e. a zero-radius cylinder.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- color: tuple[float, float, float]#
The color of emitted light, in energy-linear terms. Defaults to white.
- color_temperature: float#
Color temperature (in Kelvin) representing the white point. The valid range is [1000, 10000]. Defaults to 6500K.
The color temperature corresponds to the warmth or coolness of light. Warmer light has a lower color temperature, while cooler light has a higher color temperature.
Note
It only takes effect when
enable_color_temperature
is true.
- normalize: bool#
Normalizes power by the surface area of the light. Defaults to false.
This makes it easier to independently adjust the power and shape of the light, by causing the power to not vary with the area or angular size of the light.
- class omni.isaac.lab.sim.spawners.lights.DiskLightCfg[source]#
Configuration parameters for creating a disk light in the scene.
A disk light is a light source that emits light from a disk. It is useful for simulating fluorescent lights. For more information, please refer to the documentation on USDLux DiskLight.
Note
The default values for the attributes are those specified in the their official documentation.
Attributes:
The prim type name for the light prim.
Radius of the disk (in m).
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
The color of emitted light, in energy-linear terms.
Enables color temperature.
Color temperature (in Kelvin) representing the white point.
Normalizes power by the surface area of the light.
Scales the power of the light exponentially as a power of 2.
Scales the power of the light linearly.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- color: tuple[float, float, float]#
The color of emitted light, in energy-linear terms. Defaults to white.
- color_temperature: float#
Color temperature (in Kelvin) representing the white point. The valid range is [1000, 10000]. Defaults to 6500K.
The color temperature corresponds to the warmth or coolness of light. Warmer light has a lower color temperature, while cooler light has a higher color temperature.
Note
It only takes effect when
enable_color_temperature
is true.
- normalize: bool#
Normalizes power by the surface area of the light. Defaults to false.
This makes it easier to independently adjust the power and shape of the light, by causing the power to not vary with the area or angular size of the light.
- class omni.isaac.lab.sim.spawners.lights.DistantLightCfg[source]#
Configuration parameters for creating a distant light in the scene.
A distant light is a light source that is infinitely far away, and emits parallel rays of light. It is useful for simulating sun/moon light. For more information, please refer to the documentation on USDLux DistantLight.
Note
The default values for the attributes are those specified in the their official documentation.
Attributes:
The prim type name for the light prim.
Angular size of the light (in degrees).
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
The color of emitted light, in energy-linear terms.
Enables color temperature.
Color temperature (in Kelvin) representing the white point.
Normalizes power by the surface area of the light.
Scales the power of the light exponentially as a power of 2.
Scales the power of the light linearly.
- angle: float#
Angular size of the light (in degrees). Defaults to 0.53 degrees.
As an example, the Sun is approximately 0.53 degrees as seen from Earth. Higher values broaden the light and therefore soften shadow edges.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- color: tuple[float, float, float]#
The color of emitted light, in energy-linear terms. Defaults to white.
- color_temperature: float#
Color temperature (in Kelvin) representing the white point. The valid range is [1000, 10000]. Defaults to 6500K.
The color temperature corresponds to the warmth or coolness of light. Warmer light has a lower color temperature, while cooler light has a higher color temperature.
Note
It only takes effect when
enable_color_temperature
is true.
- normalize: bool#
Normalizes power by the surface area of the light. Defaults to false.
This makes it easier to independently adjust the power and shape of the light, by causing the power to not vary with the area or angular size of the light.
- class omni.isaac.lab.sim.spawners.lights.DomeLightCfg[source]#
Configuration parameters for creating a dome light in the scene.
A dome light is a light source that emits light inwards from all directions. It is also possible to attach a texture to the dome light, which will be used to emit light. For more information, please refer to the documentation on USDLux DomeLight.
Note
The default values for the attributes are those specified in the their official documentation.
Attributes:
The prim type name for the light prim.
A color texture to use on the dome, such as an HDR (high dynamic range) texture intended for IBL (image based lighting).
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
The color of emitted light, in energy-linear terms.
Enables color temperature.
Color temperature (in Kelvin) representing the white point.
Normalizes power by the surface area of the light.
Scales the power of the light exponentially as a power of 2.
Scales the power of the light linearly.
The parametrization format of the color map file.
Whether the dome light is visible in the primary ray.
- texture_file: str | None#
A color texture to use on the dome, such as an HDR (high dynamic range) texture intended for IBL (image based lighting). Defaults to None.
If None, the dome will emit a uniform color.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- color: tuple[float, float, float]#
The color of emitted light, in energy-linear terms. Defaults to white.
- color_temperature: float#
Color temperature (in Kelvin) representing the white point. The valid range is [1000, 10000]. Defaults to 6500K.
The color temperature corresponds to the warmth or coolness of light. Warmer light has a lower color temperature, while cooler light has a higher color temperature.
Note
It only takes effect when
enable_color_temperature
is true.
- normalize: bool#
Normalizes power by the surface area of the light. Defaults to false.
This makes it easier to independently adjust the power and shape of the light, by causing the power to not vary with the area or angular size of the light.
- exposure: float#
Scales the power of the light exponentially as a power of 2. Defaults to 0.0.
The result is multiplied against the intensity.
- texture_format: Literal['automatic', 'latlong', 'mirroredBall', 'angular', 'cubeMapVerticalCross']#
The parametrization format of the color map file. Defaults to “automatic”.
Valid values are:
"automatic"
: Tries to determine the layout from the file itself. For example, Renderman texture files embed an explicit parameterization."latlong"
: Latitude as X, longitude as Y."mirroredBall"
: An image of the environment reflected in a sphere, using an implicitly orthogonal projection."angular"
: Similar to mirroredBall but the radial dimension is mapped linearly to the angle, providing better sampling at the edges."cubeMapVerticalCross"
: A cube map with faces laid out as a vertical cross.
- class omni.isaac.lab.sim.spawners.lights.SphereLightCfg[source]#
Configuration parameters for creating a sphere light in the scene.
A sphere light is a light source that emits light outward from a sphere. For more information, please refer to the documentation on USDLux SphereLight.
Note
The default values for the attributes are those specified in the their official documentation.
Attributes:
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
The color of emitted light, in energy-linear terms.
Enables color temperature.
Color temperature (in Kelvin) representing the white point.
Normalizes power by the surface area of the light.
Scales the power of the light exponentially as a power of 2.
Scales the power of the light linearly.
The prim type name for the light prim.
Radius of the sphere.
Treats the sphere as a point source, i.e. a zero-radius sphere.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- color: tuple[float, float, float]#
The color of emitted light, in energy-linear terms. Defaults to white.
- color_temperature: float#
Color temperature (in Kelvin) representing the white point. The valid range is [1000, 10000]. Defaults to 6500K.
The color temperature corresponds to the warmth or coolness of light. Warmer light has a lower color temperature, while cooler light has a higher color temperature.
Note
It only takes effect when
enable_color_temperature
is true.
- normalize: bool#
Normalizes power by the surface area of the light. Defaults to false.
This makes it easier to independently adjust the power and shape of the light, by causing the power to not vary with the area or angular size of the light.
Sensors#
Sub-module for spawners that spawn sensors in the simulation.
Currently, the following sensors are supported:
Camera: A USD camera prim with settings for pinhole or fisheye projections.
Classes
Configuration parameters for a USD camera prim with pinhole camera settings. |
|
Configuration parameters for a USD camera prim with fish-eye camera settings. |
- omni.isaac.lab.sim.spawners.sensors.spawn_camera(prim_path: str, cfg: sensors_cfg.PinholeCameraCfg | sensors_cfg.FisheyeCameraCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Create a USD camera prim with given projection type.
The function creates various attributes on the camera prim that specify the camera’s properties. These are later used by
omni.replicator.core
to render the scene with the given camera.Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to the origin.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case this is set to identity.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.sensors.PinholeCameraCfg[source]#
Configuration parameters for a USD camera prim with pinhole camera settings.
For more information on the parameters, please refer to the camera documentation.
- ..note ::
Focal length as well as the aperture sizes and offsets are set as a tenth of the world unit. In our case, the world unit is Meter s.t. all of these values are set in cm.
Note
The default values are taken from the Replicator camera function.
Attributes:
Type of projection to use for the camera.
Near and far clipping distances (in m).
Perspective focal length (in cm).
Distance from the camera to the focus plane (in m).
Lens aperture.
Horizontal aperture (in cm).
Vertical aperture (in mm).
Offsets Resolution/Film gate horizontally.
Offsets Resolution/Film gate vertically.
Locks the camera in the Omniverse viewport.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Methods:
from_intrinsic_matrix
(intrinsic_matrix, ...)Create a
PinholeCameraCfg
class instance from an intrinsic matrix.- projection_type: str#
Type of projection to use for the camera. Defaults to “pinhole”.
Note
Currently only “pinhole” is supported.
- clipping_range: tuple[float, float]#
Near and far clipping distances (in m). Defaults to (0.01, 1e6).
The minimum clipping range will shift the camera forward by the specified distance. Don’t set it too high to avoid issues for distance related data types (e.g.,
distance_to_image_plane
).
- focal_length: float#
Perspective focal length (in cm). Defaults to 24.0cm.
Longer lens lengths narrower FOV, shorter lens lengths wider FOV.
- focus_distance: float#
Distance from the camera to the focus plane (in m). Defaults to 400.0.
The distance at which perfect sharpness is achieved.
- f_stop: float#
Lens aperture. Defaults to 0.0, which turns off focusing.
Controls Distance Blurring. Lower Numbers decrease focus range, larger numbers increase it.
- horizontal_aperture: float#
Horizontal aperture (in cm). Defaults to 20.955 cm.
Emulates sensor/film width on a camera.
Note
The default value is the horizontal aperture of a 35 mm spherical projector.
- vertical_aperture: float | None#
Vertical aperture (in mm). Defaults to None.
Emulates sensor/film height on a camera. If None, then the vertical aperture is calculated based on the horizontal aperture and the aspect ratio of the image to maintain squared pixels. This is calculated as:
\[\text{vertical aperture} = \text{horizontal aperture} \times \frac{\text{height}}{\text{width}}\]
- lock_camera: bool#
Locks the camera in the Omniverse viewport. Defaults to True.
If True, then the camera remains fixed at its configured transform. This is useful when wanting to view the camera output on the GUI and not accidentally moving the camera through the GUI interactions.
- classmethod from_intrinsic_matrix(intrinsic_matrix: list[float], width: int, height: int, clipping_range: tuple[float, float] = (0.01, 1000000.0), focal_length: float = 24.0, focus_distance: float = 400.0, f_stop: float = 0.0, projection_type: str = 'pinhole', lock_camera: bool = True) PinholeCameraCfg [source]#
Create a
PinholeCameraCfg
class instance from an intrinsic matrix.The intrinsic matrix is a 3x3 matrix that defines the mapping between the 3D world coordinates and the 2D image. The matrix is defined as:
\[\begin{split}I_{cam} = \begin{bmatrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \\end{bmatrix},\end{split}\]where \(f_x\) and \(f_y\) are the focal length along x and y direction, while \(c_x\) and \(c_y\) are the principle point offsets along x and y direction respectively.
- Parameters:
intrinsic_matrix – Intrinsic matrix of the camera in row-major format. The matrix is defined as [f_x, 0, c_x, 0, f_y, c_y, 0, 0, 1]. Shape is (9,).
width – Width of the image (in pixels).
height – Height of the image (in pixels).
clipping_range – Near and far clipping distances (in m). Defaults to (0.01, 1e6).
focal_length – Perspective focal length (in cm). Defaults to 24.0 cm.
focus_distance – Distance from the camera to the focus plane (in m). Defaults to 400.0 m.
f_stop – Lens aperture. Defaults to 0.0, which turns off focusing.
projection_type – Type of projection to use for the camera. Defaults to “pinhole”.
lock_camera – Locks the camera in the Omniverse viewport. Defaults to True.
- Returns:
An instance of the
PinholeCameraCfg
class.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- class omni.isaac.lab.sim.spawners.sensors.FisheyeCameraCfg[source]#
Configuration parameters for a USD camera prim with fish-eye camera settings.
For more information on the parameters, please refer to the camera documentation.
Note
The default values are taken from the Replicator camera function.
Attributes:
Type of projection to use for the camera.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Near and far clipping distances (in m).
Perspective focal length (in cm).
Distance from the camera to the focus plane (in m).
Lens aperture.
Horizontal aperture (in cm).
Vertical aperture (in mm).
Offsets Resolution/Film gate horizontally.
Offsets Resolution/Film gate vertically.
Locks the camera in the Omniverse viewport.
Nominal width of fisheye lens model (in pixels).
Nominal height of fisheye lens model (in pixels).
Horizontal optical centre position of fisheye lens model (in pixels).
Vertical optical centre position of fisheye lens model (in pixels).
Maximum field of view of fisheye lens model (in degrees).
First component of fisheye polynomial.
Second component of fisheye polynomial.
Third component of fisheye polynomial.
Fourth component of fisheye polynomial.
Fifth component of fisheye polynomial.
Sixth component of fisheye polynomial.
- projection_type: Literal['fisheyePolynomial', 'fisheyeSpherical', 'fisheyeKannalaBrandtK3', 'fisheyeRadTanThinPrism', 'omniDirectionalStereo']#
Type of projection to use for the camera. Defaults to “fisheyePolynomial”.
Available options:
"fisheyePolynomial"
: Fisheye camera model with \(360^{\circ}\) spherical projection."fisheyeSpherical"
: Fisheye camera model with \(360^{\circ}\) full-frame projection."fisheyeKannalaBrandtK3"
: Fisheye camera model using the Kannala-Brandt K3 distortion model."fisheyeRadTanThinPrism"
: Fisheye camera model that combines radial and tangential distortions."omniDirectionalStereo"
: Fisheye camera model supporting \(360^{\circ}\) stereoscopic imaging.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- clipping_range: tuple[float, float]#
Near and far clipping distances (in m). Defaults to (0.01, 1e6).
The minimum clipping range will shift the camera forward by the specified distance. Don’t set it too high to avoid issues for distance related data types (e.g.,
distance_to_image_plane
).
- focal_length: float#
Perspective focal length (in cm). Defaults to 24.0cm.
Longer lens lengths narrower FOV, shorter lens lengths wider FOV.
- focus_distance: float#
Distance from the camera to the focus plane (in m). Defaults to 400.0.
The distance at which perfect sharpness is achieved.
- f_stop: float#
Lens aperture. Defaults to 0.0, which turns off focusing.
Controls Distance Blurring. Lower Numbers decrease focus range, larger numbers increase it.
- horizontal_aperture: float#
Horizontal aperture (in cm). Defaults to 20.955 cm.
Emulates sensor/film width on a camera.
Note
The default value is the horizontal aperture of a 35 mm spherical projector.
- vertical_aperture: float | None#
Vertical aperture (in mm). Defaults to None.
Emulates sensor/film height on a camera. If None, then the vertical aperture is calculated based on the horizontal aperture and the aspect ratio of the image to maintain squared pixels. This is calculated as:
\[\text{vertical aperture} = \text{horizontal aperture} \times \frac{\text{height}}{\text{width}}\]
- lock_camera: bool#
Locks the camera in the Omniverse viewport. Defaults to True.
If True, then the camera remains fixed at its configured transform. This is useful when wanting to view the camera output on the GUI and not accidentally moving the camera through the GUI interactions.
- fisheye_nominal_height: float#
Nominal height of fisheye lens model (in pixels). Defaults to 1216.0.
- fisheye_optical_centre_x: float#
Horizontal optical centre position of fisheye lens model (in pixels). Defaults to 970.94244.
- fisheye_optical_centre_y: float#
Vertical optical centre position of fisheye lens model (in pixels). Defaults to 600.37482.
From Files#
Sub-module for spawners that spawn assets from files.
Currently, the following spawners are supported:
UsdFileCfg
: Spawn an asset from a USD file.UrdfFileCfg
: Spawn an asset from a URDF file.GroundPlaneCfg
: Spawn a ground plane using the grid-world USD file.
Classes
URDF file to spawn asset from. |
|
USD file to spawn asset from. |
|
Create a ground plane prim. |
- omni.isaac.lab.sim.spawners.from_files.spawn_from_urdf(prim_path: str, cfg: from_files_cfg.UrdfFileCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Spawn an asset from a URDF file and override the settings with the given config.
It uses the
UrdfConverter
class to create a USD file from URDF. This file is then imported at the specified prim path.In case a prim already exists at the given prim path, then the function does not create a new prim or throw an error that the prim already exists. Instead, it just takes the existing prim and overrides the settings with the given config.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case the translation specified in the generated USD file is used.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case the orientation specified in the generated USD file is used.
- Returns:
The prim of the spawned asset.
- Raises:
FileNotFoundError – If the URDF file does not exist at the given path.
- class omni.isaac.lab.sim.spawners.from_files.UrdfFileCfg[source]#
URDF file to spawn asset from.
It uses the
UrdfConverter
class to create a USD file from URDF and spawns the imported USD file. Similar to theUsdFileCfg
, the generated USD file can be modified by specifying the respective properties in the configuration class.See
spawn_from_urdf()
for more information.Note
The configuration parameters include various properties. If not None, these properties are modified on the spawned prim in a nested manner.
If they are set to a value, then the properties are modified on the spawned prim in a nested manner. This is done by calling the respective function with the specified properties.
Attributes:
The absolute path to the asset file to convert into USD.
The output directory path to store the generated USD file.
The name of the generated usd file.
Force the conversion of the asset file to usd.
Make the generated USD file instanceable.
Import the inertia tensor from urdf.
Create a fix joint to the root/base link.
Consolidate links that are connected by fixed joints.
Activate self-collisions between links of the articulation.
The drive type used for joints.
Override the joint dynamics parsed from the URDF file.
The default stiffness of the joint drive.
The default damping of the joint drive.
Default density used for links.
Decompose a convex mesh into smaller pieces for a closer fit.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Scale of the asset.
Properties to apply to the articulation root.
Properties to apply to the fixed tendons (if any).
Properties to apply to a joint.
Path to the visual material to use for the prim.
Visual material properties to override the visual material properties in the URDF file.
- usd_dir: str | None#
The output directory path to store the generated USD file. Defaults to None.
If None, it is resolved as
/tmp/IsaacLab/usd_{date}_{time}_{random}
, where the parameters in braces are runtime generated.
- usd_file_name: str | None#
The name of the generated usd file. Defaults to None.
If None, it is resolved from the asset file name. For example, if the asset file name is
"my_asset.urdf"
, then the generated USD file name is"my_asset.usd"
.If the providing file name does not end with “.usd” or “.usda”, then the extension “.usd” is appended to the file name.
- force_usd_conversion: bool#
Force the conversion of the asset file to usd. Defaults to False.
If True, then the USD file is always generated. It will overwrite the existing USD file if it exists.
- make_instanceable: bool#
Make the generated USD file instanceable. Defaults to True.
Note
Instancing helps reduce the memory footprint of the asset when multiple copies of the asset are used in the scene. For more information, please check the USD documentation on scene-graph instancing.
- import_inertia_tensor: bool#
Import the inertia tensor from urdf. Defaults to True.
If the
"inertial"
tag is missing, then it is imported as an identity.
- self_collision: bool#
Activate self-collisions between links of the articulation. Defaults to False.
- default_drive_type: Literal['none', 'position', 'velocity']#
The drive type used for joints. Defaults to
"none"
.The drive type dictates the loaded joint PD gains and USD attributes for joint control:
"none"
: The joint stiffness and damping are set to 0.0."position"
: The joint stiff and damping are set based on the URDF file or provided configuration."velocity"
: The joint stiff is set to zero and damping is based on the URDF file or provided configuration.
- override_joint_dynamics: bool#
Override the joint dynamics parsed from the URDF file. Defaults to False.
- default_drive_damping: float#
The default damping of the joint drive. Defaults to 0.0.
Note
If
override_joint_dynamics
is True, the values parsed from the URDF joint tag"<dynamics><damping>"
are used. Otherwise, it is overridden by the configured value.
- link_density: float#
Default density used for links. Defaults to 0.
This setting is only effective if
"inertial"
properties are missing in the URDF.
- convex_decompose_mesh: bool#
Decompose a convex mesh into smaller pieces for a closer fit. Defaults to False.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- scale: tuple[float, float, float] | None#
Scale of the asset. Defaults to None, in which case the scale is not modified.
- articulation_props: schemas.ArticulationRootPropertiesCfg | None#
Properties to apply to the articulation root.
- fixed_tendons_props: schemas.FixedTendonsPropertiesCfg | None#
Properties to apply to the fixed tendons (if any).
- joint_drive_props: schemas.JointDrivePropertiesCfg | None#
Properties to apply to a joint.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: materials.VisualMaterialCfg | None#
Visual material properties to override the visual material properties in the URDF file.
Note
If None, then no visual material will be added.
- omni.isaac.lab.sim.spawners.from_files.spawn_from_usd(prim_path: str, cfg: from_files_cfg.UsdFileCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Spawn an asset from a USD file and override the settings with the given config.
In the case of a USD file, the asset is spawned at the default prim specified in the USD file. If a default prim is not specified, then the asset is spawned at the root prim.
In case a prim already exists at the given prim path, then the function does not create a new prim or throw an error that the prim already exists. Instead, it just takes the existing prim and overrides the settings with the given config.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case the translation specified in the USD file is used.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case the orientation specified in the USD file is used.
- Returns:
The prim of the spawned asset.
- Raises:
FileNotFoundError – If the USD file does not exist at the given path.
- class omni.isaac.lab.sim.spawners.from_files.UsdFileCfg[source]#
USD file to spawn asset from.
USD files are imported directly into the scene. However, given their complexity, there are various different operations that can be performed on them. For example, selecting variants, applying materials, or modifying existing properties.
To prevent the explosion of configuration parameters, the available operations are limited to the most common ones. These include:
Selecting variants: This is done by specifying the
variants
parameter.Creating and applying materials: This is done by specifying the
visual_material
parameter.Modifying existing properties: This is done by specifying the respective properties in the configuration class. For instance, to modify the scale of the imported prim, set the
scale
parameter.
See
spawn_from_usd()
for more information.Note
The configuration parameters include various properties. If not None, these properties are modified on the spawned prim in a nested manner.
If they are set to a value, then the properties are modified on the spawned prim in a nested manner. This is done by calling the respective function with the specified properties.
Attributes:
Path to the USD file to spawn asset from.
Variants to select from in the input USD file.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Scale of the asset.
Properties to apply to the articulation root.
Properties to apply to the fixed tendons (if any).
Properties to apply to a joint.
Path to the visual material to use for the prim.
Visual material properties to override the visual material properties in the URDF file.
- variants: object | dict[str, str] | None#
Variants to select from in the input USD file. Defaults to None, in which case no variants are applied.
This can either be a configclass object, in which case each attribute is used as a variant set name and its specified value, or a dictionary mapping between the two. Please check the
select_usd_variants()
function for more information.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- scale: tuple[float, float, float] | None#
Scale of the asset. Defaults to None, in which case the scale is not modified.
- articulation_props: schemas.ArticulationRootPropertiesCfg | None#
Properties to apply to the articulation root.
- fixed_tendons_props: schemas.FixedTendonsPropertiesCfg | None#
Properties to apply to the fixed tendons (if any).
- joint_drive_props: schemas.JointDrivePropertiesCfg | None#
Properties to apply to a joint.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: materials.VisualMaterialCfg | None#
Visual material properties to override the visual material properties in the URDF file.
Note
If None, then no visual material will be added.
- omni.isaac.lab.sim.spawners.from_files.spawn_ground_plane(prim_path: str, cfg: from_files_cfg.GroundPlaneCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Spawns a ground plane into the scene.
This function loads the USD file containing the grid plane asset from Isaac Sim. It may not work with other assets for ground planes. In those cases, please use the spawn_from_usd function.
Note
This function takes keyword arguments to be compatible with other spawners. However, it does not use any of the kwargs.
- Parameters:
prim_path – The path to spawn the asset at.
cfg – The configuration instance.
translation – The translation to apply to the prim w.r.t. its parent prim. Defaults to None, in which case the translation specified in the USD file is used.
orientation – The orientation in (w, x, y, z) to apply to the prim w.r.t. its parent prim. Defaults to None, in which case the orientation specified in the USD file is used.
- Returns:
The prim of the spawned asset.
- Raises:
ValueError – If the prim path already exists.
- class omni.isaac.lab.sim.spawners.from_files.GroundPlaneCfg[source]#
Create a ground plane prim.
This uses the USD for the standard grid-world ground plane from Isaac Sim by default.
Attributes:
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Path to the USD file to spawn asset from.
The color of the ground plane.
The size of the ground plane.
Physics material properties.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- color: tuple[float, float, float] | None#
The color of the ground plane. Defaults to (0.0, 0.0, 0.0).
If None, then the color remains unchanged.
- physics_material: RigidBodyMaterialCfg#
Physics material properties. Defaults to the default rigid body material.
Materials#
Sub-module for spawners that spawn USD-based and PhysX-based materials.
Materials are used to define the appearance and physical properties of objects in the simulation. In Omniverse, they are defined using NVIDIA’s Material Definition Language (MDL). MDL is based on the physically-based rendering (PBR) model, which is a set of equations that describe how light interacts with a surface. The PBR model is used to create realistic-looking materials.
While MDL is primarily used for defining the appearance of objects, it can be extended to define the physical properties of objects. For example, the friction and restitution coefficients of a rubber material. A physics material can be assigned to a physics object to define its physical properties. There are different kinds of physics materials, such as rigid body material, deformable material, and fluid material.
In order to apply a material to an object, we “bind” the geometry of the object to the material. For this, we use the USD Material Binding API. The material binding API takes in the path to the geometry and the path to the material, and binds them together.
For physics material, the material is bound to the physics object with the ‘physics’ purpose. When parsing physics material properties on an object, the following priority is used:
Material binding with a ‘physics’ purpose (physics material)
Material binding with no purpose (visual material)
Material binding with a ‘physics’ purpose on the Physics Scene prim.
Default values of material properties inside PhysX.
- Usage:
import omni.isaac.core.utils.prims as prim_utils import omni.isaac.lab.sim as sim_utils # create a visual material visual_material_cfg = sim_utils.GlassMdlCfg(glass_ior=1.0, thin_walled=True) visual_material_cfg.func("/World/Looks/glassMaterial", visual_material_cfg) # create a mesh prim cube_cfg = sim_utils.CubeCfg(size=[1.0, 1.0, 1.0]) cube_cfg.func("/World/Primitives/Cube", cube_cfg) # bind the cube to the visual material sim_utils.bind_visual_material("/World/Primitives/Cube", "/World/Looks/glassMaterial")
Classes
Configuration parameters for creating a visual material. |
|
Configuration parameters for creating a preview surface. |
|
Configuration parameters for loading an MDL material from a file. |
|
Configuration parameters for loading a glass MDL material. |
|
Configuration parameters for creating a physics material. |
|
Physics material parameters for rigid bodies. |
|
Physics material parameters for deformable bodies. |
Visual Materials#
- class omni.isaac.lab.sim.spawners.materials.VisualMaterialCfg[source]#
Configuration parameters for creating a visual material.
- omni.isaac.lab.sim.spawners.materials.spawn_preview_surface(prim_path: str, cfg: visual_materials_cfg.PreviewSurfaceCfg) Usd.Prim [source]#
Create a preview surface prim and override the settings with the given config.
A preview surface is a physically-based surface that handles simple shaders while supporting both specular and metallic workflows. All color inputs are in linear color space (RGB). For more information, see the documentation.
The function calls the USD command CreatePreviewSurfaceMaterialPrim to create the prim.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.materials.PreviewSurfaceCfg[source]#
Configuration parameters for creating a preview surface.
See
spawn_preview_surface()
for more information.Attributes:
The RGB diffusion color.
The RGB emission component of the surface.
The roughness for specular lobe.
The metallic component.
The opacity of the surface.
- diffuse_color: tuple[float, float, float]#
The RGB diffusion color. This is the base color of the surface. Defaults to a dark gray.
- emissive_color: tuple[float, float, float]#
The RGB emission component of the surface. Defaults to black.
- omni.isaac.lab.sim.spawners.materials.spawn_from_mdl_file(prim_path: str, cfg: visual_materials_cfg.MdlMaterialCfg) Usd.Prim [source]#
Load a material from its MDL file and override the settings with the given config.
NVIDIA’s Material Definition Language (MDL) is a language for defining physically-based materials. The MDL file format is a binary format that can be loaded by Omniverse and other applications such as Adobe Substance Designer. To learn more about MDL, see the documentation.
The function calls the USD command CreateMdlMaterialPrim to create the prim.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration instance.
- Returns:
The created prim.
- Raises:
ValueError – If a prim already exists at the given path.
- class omni.isaac.lab.sim.spawners.materials.MdlFileCfg[source]#
Configuration parameters for loading an MDL material from a file.
See
spawn_from_mdl_file()
for more information.Attributes:
The path to the MDL material.
Whether to project the UVW coordinates of the material.
Multiplier for the diffuse color of the material.
The scale of the texture.
- mdl_path: str#
The path to the MDL material.
NVIDIA Omniverse provides various MDL materials in the NVIDIA Nucleus. To use these materials, you can set the path of the material in the nucleus directory using the
{NVIDIA_NUCLEUS_DIR}
variable. This is internally resolved to the path of the NVIDIA Nucleus directory on the host machine through the attributeomni.isaac.lab.utils.assets.NVIDIA_NUCLEUS_DIR
.For example, to use the “Aluminum_Anodized” material, you can set the path to:
{NVIDIA_NUCLEUS_DIR}/Materials/Base/Metals/Aluminum_Anodized.mdl
.
- project_uvw: bool | None#
Whether to project the UVW coordinates of the material. Defaults to None.
If None, then the default setting in the MDL material will be used.
- class omni.isaac.lab.sim.spawners.materials.GlassMdlCfg[source]#
Configuration parameters for loading a glass MDL material.
This is a convenience class for loading a glass MDL material. For more information on glass materials, see the documentation.
Note
The default values are taken from the glass material in the NVIDIA Nucleus.
Attributes:
The path to the MDL material.
The RGB color or tint of the glass.
The amount of reflectivity of the surface.
Whether to perform thin-walled refraction.
The incidence of refraction to control how much light is bent when passing through the glass.
Physical Materials#
- class omni.isaac.lab.sim.spawners.materials.PhysicsMaterialCfg[source]#
Configuration parameters for creating a physics material.
Physics material are PhysX schemas that can be applied to a USD material prim to define the physical properties related to the material. For example, the friction coefficient, restitution coefficient, etc. For more information on physics material, please refer to the PhysX documentation.
- omni.isaac.lab.sim.spawners.materials.spawn_rigid_body_material(prim_path: str, cfg: physics_materials_cfg.RigidBodyMaterialCfg) Usd.Prim [source]#
Create material with rigid-body physics properties.
Rigid body materials are used to define the physical properties to meshes of a rigid body. These include the friction, restitution, and their respective combination modes. For more information on rigid body material, please refer to the documentation on PxMaterial.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration for the physics material.
- Returns:
The spawned rigid body material prim.
- Raises:
ValueError – When a prim already exists at the specified prim path and is not a material.
- class omni.isaac.lab.sim.spawners.materials.RigidBodyMaterialCfg[source]#
Physics material parameters for rigid bodies.
See
spawn_rigid_body_material()
for more information.Note
The default values are the default values used by PhysX 5.
Attributes:
The static friction coefficient.
The dynamic friction coefficient.
The restitution coefficient.
Whether to enable patch friction.
Determines the way friction will be combined during collisions.
Determines the way restitution coefficient will be combined during collisions.
Spring stiffness for a compliant contact model using implicit springs.
Damping coefficient for a compliant contact model using implicit springs.
- friction_combine_mode: Literal['average', 'min', 'multiply', 'max']#
Determines the way friction will be combined during collisions. Defaults to “average”.
Attention
When two physics materials with different combine modes collide, the combine mode with the higher priority will be used. The priority order is provided here.
- restitution_combine_mode: Literal['average', 'min', 'multiply', 'max']#
Determines the way restitution coefficient will be combined during collisions. Defaults to “average”.
Attention
When two physics materials with different combine modes collide, the combine mode with the higher priority will be used. The priority order is provided here.
- compliant_contact_stiffness: float#
Spring stiffness for a compliant contact model using implicit springs. Defaults to 0.0.
A higher stiffness results in behavior closer to a rigid contact. The compliant contact model is only enabled if the stiffness is larger than 0.
- compliant_contact_damping: float#
Damping coefficient for a compliant contact model using implicit springs. Defaults to 0.0.
Irrelevant if compliant contacts are disabled when
compliant_contact_stiffness
is set to zero and rigid contacts are active.
- omni.isaac.lab.sim.spawners.materials.spawn_deformable_body_material(prim_path: str, cfg: physics_materials_cfg.DeformableBodyMaterialCfg) Usd.Prim [source]#
Create material with deformable-body physics properties.
Deformable body materials are used to define the physical properties to meshes of a deformable body. These include the friction and deformable body properties. For more information on deformable body material, please refer to the documentation on PxFEMSoftBodyMaterial.
Note
This function is decorated with
clone()
that resolves prim path into list of paths if the input prim path is a regex pattern. This is done to support spawning multiple assets from a single and cloning the USD prim at the given path expression.- Parameters:
prim_path – The prim path or pattern to spawn the asset at. If the prim path is a regex pattern, then the asset is spawned at all the matching prim paths.
cfg – The configuration for the physics material.
- Returns:
The spawned deformable body material prim.
- Raises:
ValueError – When a prim already exists at the specified prim path and is not a material.
- class omni.isaac.lab.sim.spawners.materials.DeformableBodyMaterialCfg[source]#
Physics material parameters for deformable bodies.
See
spawn_deformable_body_material()
for more information.Note
The default values are the default values used by PhysX 5.
Attributes:
The material density.
The dynamic friction.
The Young's modulus, which defines the body's stiffness.
The Poisson's ratio which defines the body's volume preservation.
The elasticity damping for the deformable material.
The damping scale for the deformable material.
- density: float | None#
The material density. Defaults to None, in which case the simulation decides the default density.
- youngs_modulus: float#
The Young’s modulus, which defines the body’s stiffness. Defaults to 50000000.0.
The Young’s modulus is a measure of the material’s ability to deform under stress. It is measured in Pascals (Pa).
- poissons_ratio: float#
The Poisson’s ratio which defines the body’s volume preservation. Defaults to 0.45.
The Poisson’s ratio is a measure of the material’s ability to expand in the lateral direction when compressed in the axial direction. It is a dimensionless number between 0 and 0.5. Using a value of 0.5 will make the material incompressible.
Wrappers#
Sub-module for wrapping spawner configurations.
Unlike the other spawner modules, this module provides a way to wrap multiple spawner configurations into a single configuration. This is useful when the user wants to spawn multiple assets based on different configurations.
Classes
Configuration parameters for loading multiple assets from their individual configurations. |
|
Configuration parameters for loading multiple USD files. |
- omni.isaac.lab.sim.spawners.wrappers.spawn_multi_asset(prim_path: str, cfg: wrappers_cfg.MultiAssetSpawnerCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Spawn multiple assets based on the provided configurations.
This function spawns multiple assets based on the provided configurations. The assets are spawned in the order they are provided in the list. If the
random_choice
parameter is set to True, a random asset configuration is selected for each spawn.- Parameters:
prim_path – The prim path to spawn the assets.
cfg – The configuration for spawning the assets.
translation – The translation of the spawned assets. Default is None.
orientation – The orientation of the spawned assets in (w, x, y, z) order. Default is None.
- Returns:
The created prim at the first prim path.
- class omni.isaac.lab.sim.spawners.wrappers.MultiAssetSpawnerCfg[source]#
Configuration parameters for loading multiple assets from their individual configurations.
Specifying values for any properties at the configuration level will override the settings of individual assets’ configuration. For instance if the attribute
MultiAssetSpawnerCfg.mass_props
is specified, its value will overwrite the values of the mass properties in each configuration insideassets_cfg
(wherever applicable). This is done to simplify configuring similar properties globally. By default, all properties are set to None.The following is an exception to the above:
visible
: This parameter is ignored. Its value for the individual assets is used.semantic_tags
: If specified, it will be appended to each individual asset’s semantic tags.
Attributes:
List of asset configurations to spawn.
Whether to randomly select an asset configuration.
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
- assets_cfg: list[omni.isaac.lab.sim.spawners.spawner_cfg.SpawnerCfg]#
List of asset configurations to spawn.
- random_choice: bool#
Whether to randomly select an asset configuration. Default is True.
If False, the asset configurations are spawned in the order they are provided in the list. If True, a random asset configuration is selected for each spawn.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- omni.isaac.lab.sim.spawners.wrappers.spawn_multi_usd_file(prim_path: str, cfg: wrappers_cfg.MultiUsdFileCfg, translation: tuple[float, float, float] | None = None, orientation: tuple[float, float, float, float] | None = None) Usd.Prim [source]#
Spawn multiple USD files based on the provided configurations.
This function creates configuration instances corresponding the individual USD files and calls the
spawn_multi_asset()
method to spawn them into the scene.- Parameters:
prim_path – The prim path to spawn the assets.
cfg – The configuration for spawning the assets.
translation – The translation of the spawned assets. Default is None.
orientation – The orientation of the spawned assets in (w, x, y, z) order. Default is None.
- Returns:
The created prim at the first prim path.
- class omni.isaac.lab.sim.spawners.wrappers.MultiUsdFileCfg[source]#
Configuration parameters for loading multiple USD files.
Specifying values for any properties at the configuration level is applied to all the assets imported from their USD files.
Tip
It is recommended that all the USD based assets follow a similar prim-hierarchy.
Attributes:
Whether the spawned asset should be visible.
List of semantic tags to add to the spawned asset.
Whether to copy the asset from the source prim or inherit it.
Mass properties.
Deformable body properties.
Rigid body properties.
Properties to apply to all collision meshes.
Activate contact reporting on all rigid bodies.
Scale of the asset.
Properties to apply to the articulation root.
Properties to apply to the fixed tendons (if any).
Properties to apply to a joint.
Path to the visual material to use for the prim.
Visual material properties to override the visual material properties in the URDF file.
Variants to select from in the input USD file.
Path or a list of paths to the USD files to spawn asset from.
Whether to randomly select an asset configuration.
- semantic_tags: list[tuple[str, str]] | None#
List of semantic tags to add to the spawned asset. Defaults to None, which means no semantic tags will be added.
The semantic tags follow the Replicator Semantic tagging system. Each tag is a tuple of the form
(type, data)
, wheretype
is the type of the tag anddata
is the semantic label associated with the tag. For example, to annotate a spawned asset in the class avocado, the semantic tag would be[("class", "avocado")]
.You can specify multiple semantic tags by passing in a list of tags. For example, to annotate a spawned asset in the class avocado and the color green, the semantic tags would be
[("class", "avocado"), ("color", "green")]
.See also
For more information on the semantics filter, see the documentation for the semantics schema editor.
- copy_from_source: bool#
Whether to copy the asset from the source prim or inherit it. Defaults to True.
This parameter is only used when cloning prims. If False, then the asset will be inherited from the source prim, i.e. all USD changes to the source prim will be reflected in the cloned prims.
- mass_props: schemas.MassPropertiesCfg | None#
Mass properties.
- deformable_props: schemas.DeformableBodyPropertiesCfg | None#
Deformable body properties.
- rigid_props: schemas.RigidBodyPropertiesCfg | None#
Rigid body properties.
For making a rigid object static, set the
schemas.RigidBodyPropertiesCfg.kinematic_enabled
as True. This will make the object static and will not be affected by gravity or other forces.
- collision_props: schemas.CollisionPropertiesCfg | None#
Properties to apply to all collision meshes.
- activate_contact_sensors: bool#
Activate contact reporting on all rigid bodies. Defaults to False.
This adds the PhysxContactReporter API to all the rigid bodies in the given prim path and its children.
- scale: tuple[float, float, float] | None#
Scale of the asset. Defaults to None, in which case the scale is not modified.
- articulation_props: schemas.ArticulationRootPropertiesCfg | None#
Properties to apply to the articulation root.
- fixed_tendons_props: schemas.FixedTendonsPropertiesCfg | None#
Properties to apply to the fixed tendons (if any).
- joint_drive_props: schemas.JointDrivePropertiesCfg | None#
Properties to apply to a joint.
- visual_material_path: str#
Path to the visual material to use for the prim. Defaults to “material”.
If the path is relative, then it will be relative to the prim’s path. This parameter is ignored if visual_material is not None.
- visual_material: materials.VisualMaterialCfg | None#
Visual material properties to override the visual material properties in the URDF file.
Note
If None, then no visual material will be added.
- variants: object | dict[str, str] | None#
Variants to select from in the input USD file. Defaults to None, in which case no variants are applied.
This can either be a configclass object, in which case each attribute is used as a variant set name and its specified value, or a dictionary mapping between the two. Please check the
select_usd_variants()
function for more information.