omni.isaac.lab.sim.schemas#
Sub-module containing utilities for schemas used in Omniverse.
We wrap the USD schemas for PhysX and USD Physics in a more convenient API for setting the parameters from Python. This is done so that configuration objects can define the schema properties to set and make it easier to tune the physics parameters without requiring to open Omniverse Kit and manually set the parameters into the respective USD attributes.
小心
Schema properties cannot be applied on prims that are prototypes as they are read-only prims. This particularly affects instanced assets where some of the prims (usually the visual and collision meshes) are prototypes so that the instancing can be done efficiently.
In such cases, it is assumed that the prototypes have sim-ready properties on them that don’t need to be modified. Trying to set properties into prototypes will throw a warning saying that the prim is a prototype and the properties cannot be set.
The schemas are defined in the following links:
Locally, the schemas are defined in the following files:
_isaac_sim/extsPhysics/omni.usd.schema.physics/plugins/UsdPhysics/resources/UsdPhysics/schema.usda
_isaac_sim/extsPhysics/omni.usd.schema.physx/plugins/PhysxSchema/resources/generatedSchema.usda
Classes
Properties to apply to the root of an articulation. |
|
Properties to apply to a rigid body. |
|
Properties to apply to colliders in a rigid body. |
|
Properties to define explicit mass properties of a rigid body. |
|
Properties to define the drive mechanism of a joint. |
|
Properties to define fixed tendons of an articulation. |
|
Properties to apply to a deformable body. |
Functions
|
Apply the articulation root schema on the input prim and set its properties. |
|
Modify PhysX parameters for an articulation root prim. |
|
Apply the rigid body schema on the input prim and set its properties. |
|
Modify PhysX parameters for a rigid body prim. |
|
Activate the contact sensor on all rigid bodies under a specified prim path. |
|
Apply the collision schema on the input prim and set its properties. |
|
Modify PhysX properties of collider prim. |
|
Apply the mass schema on the input prim and set its properties. |
|
Set properties for the mass of a rigid body prim. |
|
Modify PhysX parameters for a joint prim. |
|
Modify PhysX parameters for a fixed tendon attachment prim. |
|
Apply the deformable body schema on the input prim and set its properties. |
|
Modify PhysX parameters for a deformable body prim. |
Articulation Root#
- class omni.isaac.lab.sim.schemas.ArticulationRootPropertiesCfg[源代码]#
Properties to apply to the root of an articulation.
See
modify_articulation_root_properties()
for more information.备注
If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is.
Attributes:
Whether to enable or disable articulation.
Whether to enable or disable self-collisions.
Solver position iteration counts for the body.
Solver position iteration counts for the body.
Mass-normalized kinetic energy threshold below which an actor may go to sleep.
The mass-normalized kinetic energy threshold below which an articulation may participate in stabilization.
Whether to fix the root link of the articulation.
- sleep_threshold: float | None#
Mass-normalized kinetic energy threshold below which an actor may go to sleep.
- stabilization_threshold: float | None#
The mass-normalized kinetic energy threshold below which an articulation may participate in stabilization.
- fix_root_link: bool | None#
Whether to fix the root link of the articulation.
If set to None, the root link is not modified.
If the articulation already has a fixed root link, this flag will enable or disable the fixed joint.
If the articulation does not have a fixed root link, this flag will create a fixed joint between the world frame and the root link. The joint is created with the name “FixedJoint” under the articulation prim.
备注
This is a non-USD schema property. It is handled by the
modify_articulation_root_properties()
function.
- omni.isaac.lab.sim.schemas.define_articulation_root_properties(prim_path: str, cfg: schemas_cfg.ArticulationRootPropertiesCfg, stage: Usd.Stage | None = None)[源代码]#
Apply the articulation root schema on the input prim and set its properties.
See
modify_articulation_root_properties()
for more details on how the properties are set.- 参数:
prim_path – The prim path where to apply the articulation root schema.
cfg – The configuration for the articulation root.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 抛出:
ValueError – When the prim path is not valid.
TypeError – When the prim already has conflicting API schemas.
- omni.isaac.lab.sim.schemas.modify_articulation_root_properties(prim_path: str, cfg: schemas_cfg.ArticulationRootPropertiesCfg, stage: Usd.Stage | None = None) bool [源代码]#
Modify PhysX parameters for an articulation root prim.
The articulation root marks the root of an articulation tree. For floating articulations, this should be on the root body. For fixed articulations, this API can be on a direct or indirect parent of the root joint which is fixed to the world.
The schema comprises of attributes that belong to the ArticulationRootAPI and PhysxArticulationAPI. schemas. The latter contains the PhysX parameters for the articulation root.
The properties are applied to the articulation root prim. The common properties (such as solver position and velocity iteration counts, sleep threshold, stabilization threshold) take precedence over those specified in the rigid body schemas for all the rigid bodies in the articulation.
小心
When the attribute
schemas_cfg.ArticulationRootPropertiesCfg.fix_root_link
is set to True, a fixed joint is created between the root link and the world frame (if it does not already exist). However, to deal with physics parser limitations, the articulation root schema needs to be applied to the parent of the root link.备注
This function is decorated with
apply_nested()
that set the properties to all the prims (that have the schema applied on them) under the input prim path.- 参数:
prim_path – The prim path to the articulation root.
cfg – The configuration for the articulation root.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 返回:
True if the properties were successfully set, False otherwise.
- 抛出:
NotImplementedError – When the root prim is not a rigid body and a fixed joint is to be created.
Rigid Body#
- class omni.isaac.lab.sim.schemas.RigidBodyPropertiesCfg[源代码]#
Properties to apply to a rigid body.
See
modify_rigid_body_properties()
for more information.备注
If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is.
Attributes:
Whether to enable or disable the rigid body.
Determines whether the body is kinematic or not.
Disable gravity for the actor.
Linear damping for the body.
Angular damping for the body.
Maximum linear velocity for rigid bodies (in m/s).
Maximum angular velocity for rigid bodies (in deg/s).
Maximum depenetration velocity permitted to be introduced by the solver (in m/s).
The limit on the impulse that may be applied at a contact.
Enables computation of gyroscopic forces on the rigid body.
Carries over forces/accelerations over sub-steps.
Solver position iteration counts for the body.
Solver position iteration counts for the body.
Mass-normalized kinetic energy threshold below which an actor may go to sleep.
The mass-normalized kinetic energy threshold below which an actor may participate in stabilization.
- kinematic_enabled: bool | None#
Determines whether the body is kinematic or not.
A kinematic body is a body that is moved through animated poses or through user defined poses. The simulation still derives velocities for the kinematic body based on the external motion.
For more information on kinematic bodies, please refer to the documentation.
- max_depenetration_velocity: float | None#
Maximum depenetration velocity permitted to be introduced by the solver (in m/s).
- omni.isaac.lab.sim.schemas.define_rigid_body_properties(prim_path: str, cfg: schemas_cfg.RigidBodyPropertiesCfg, stage: Usd.Stage | None = None)[源代码]#
Apply the rigid body schema on the input prim and set its properties.
See
modify_rigid_body_properties()
for more details on how the properties are set.- 参数:
prim_path – The prim path where to apply the rigid body schema.
cfg – The configuration for the rigid body.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 抛出:
ValueError – When the prim path is not valid.
TypeError – When the prim already has conflicting API schemas.
- omni.isaac.lab.sim.schemas.modify_rigid_body_properties(prim_path: str, cfg: schemas_cfg.RigidBodyPropertiesCfg, stage: Usd.Stage | None = None) bool [源代码]#
Modify PhysX parameters for a rigid body prim.
A rigid body is a single body that can be simulated by PhysX. It can be either dynamic or kinematic. A dynamic body responds to forces and collisions. A kinematic body can be moved by the user, but does not respond to forces. They are similar to having static bodies that can be moved around.
The schema comprises of attributes that belong to the RigidBodyAPI and PhysxRigidBodyAPI. schemas. The latter contains the PhysX parameters for the rigid body.
备注
This function is decorated with
apply_nested()
that sets the properties to all the prims (that have the schema applied on them) under the input prim path.- 参数:
prim_path – The prim path to the rigid body.
cfg – The configuration for the rigid body.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 返回:
True if the properties were successfully set, False otherwise.
- omni.isaac.lab.sim.schemas.activate_contact_sensors(prim_path: str, threshold: float = 0.0, stage: pxr.Usd.Stage = None)[源代码]#
Activate the contact sensor on all rigid bodies under a specified prim path.
This function adds the PhysX contact report API to all rigid bodies under the specified prim path. It also sets the force threshold beyond which the contact sensor reports the contact. The contact reporting API can only be added to rigid bodies.
- 参数:
prim_path – The prim path under which to search and prepare contact sensors.
threshold – The threshold for the contact sensor. Defaults to 0.0.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 抛出:
ValueError – If the input prim path is not valid.
ValueError – If there are no rigid bodies under the prim path.
Collision#
- class omni.isaac.lab.sim.schemas.CollisionPropertiesCfg[源代码]#
Properties to apply to colliders in a rigid body.
See
modify_collision_properties()
for more information.备注
If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is.
Attributes:
Whether to enable or disable collisions.
Contact offset for the collision shape (in m).
Rest offset for the collision shape (in m).
Radius of the contact patch for applying torsional friction (in m).
Minimum radius of the contact patch for applying torsional friction (in m).
- contact_offset: float | None#
Contact offset for the collision shape (in m).
The collision detector generates contact points as soon as two shapes get closer than the sum of their contact offsets. This quantity should be non-negative which means that contact generation can potentially start before the shapes actually penetrate.
- rest_offset: float | None#
Rest offset for the collision shape (in m).
The rest offset quantifies how close a shape gets to others at rest, At rest, the distance between two vertically stacked objects is the sum of their rest offsets. If a pair of shapes have a positive rest offset, the shapes will be separated at rest by an air gap.
- omni.isaac.lab.sim.schemas.define_collision_properties(prim_path: str, cfg: schemas_cfg.CollisionPropertiesCfg, stage: Usd.Stage | None = None)[源代码]#
Apply the collision schema on the input prim and set its properties.
See
modify_collision_properties()
for more details on how the properties are set.- 参数:
prim_path – The prim path where to apply the rigid body schema.
cfg – The configuration for the collider.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 抛出:
ValueError – When the prim path is not valid.
- omni.isaac.lab.sim.schemas.modify_collision_properties(prim_path: str, cfg: schemas_cfg.CollisionPropertiesCfg, stage: Usd.Stage | None = None) bool [源代码]#
Modify PhysX properties of collider prim.
These properties are based on the UsdPhysics.CollisionAPI and PhysxSchema.PhysxCollisionAPI schemas. For more information on the properties, please refer to the official documentation.
Tuning these parameters influence the contact behavior of the rigid body. For more information on tune them and their effect on the simulation, please refer to the PhysX documentation.
备注
This function is decorated with
apply_nested()
that sets the properties to all the prims (that have the schema applied on them) under the input prim path.- 参数:
prim_path – The prim path of parent.
cfg – The configuration for the collider.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 返回:
True if the properties were successfully set, False otherwise.
Mass#
- class omni.isaac.lab.sim.schemas.MassPropertiesCfg[源代码]#
Properties to define explicit mass properties of a rigid body.
See
modify_mass_properties()
for more information.备注
If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is.
Attributes:
- omni.isaac.lab.sim.schemas.define_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, stage: Usd.Stage | None = None)[源代码]#
Apply the mass schema on the input prim and set its properties.
See
modify_mass_properties()
for more details on how the properties are set.- 参数:
prim_path – The prim path where to apply the rigid body schema.
cfg – The configuration for the mass properties.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 抛出:
ValueError – When the prim path is not valid.
- omni.isaac.lab.sim.schemas.modify_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, stage: Usd.Stage | None = None) bool [源代码]#
Set properties for the mass of a rigid body prim.
These properties are based on the UsdPhysics.MassAPI schema. If the mass is not defined, the density is used to compute the mass. However, in that case, a collision approximation of the rigid body is used to compute the density. For more information on the properties, please refer to the documentation.
小心
The mass of an object can be specified in multiple ways and have several conflicting settings that are resolved based on precedence. Please make sure to understand the precedence rules before using this property.
备注
This function is decorated with
apply_nested()
that sets the properties to all the prims (that have the schema applied on them) under the input prim path.- 参数:
prim_path – The prim path of the rigid body.
cfg – The configuration for the mass properties.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 返回:
True if the properties were successfully set, False otherwise.
Joint Drive#
- class omni.isaac.lab.sim.schemas.JointDrivePropertiesCfg[源代码]#
Properties to define the drive mechanism of a joint.
See
modify_joint_drive_properties()
for more information.备注
If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is.
Attributes:
Joint drive type to apply.
- omni.isaac.lab.sim.schemas.modify_joint_drive_properties(prim_path: str, drive_props: schemas_cfg.JointDrivePropertiesCfg, stage: Usd.Stage | None = None) bool [源代码]#
Modify PhysX parameters for a joint prim.
This function checks if the input prim is a prismatic or revolute joint and applies the joint drive schema on it. If the joint is a tendon (i.e., it has the PhysxTendonAxisAPI schema applied on it), then the joint drive schema is not applied.
Based on the configuration, this method modifies the properties of the joint drive. These properties are based on the UsdPhysics.DriveAPI schema. For more information on the properties, please refer to the official documentation.
小心
We highly recommend modifying joint properties of articulations through the functionalities in the
omni.isaac.lab.actuators
module. The methods here are for setting simulation low-level properties only.- 参数:
prim_path – The prim path where to apply the joint drive schema.
drive_props – The configuration for the joint drive.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 返回:
True if the properties were successfully set, False otherwise.
- 抛出:
ValueError – If the input prim path is not valid.
Fixed Tendon#
- class omni.isaac.lab.sim.schemas.FixedTendonPropertiesCfg[源代码]#
Properties to define fixed tendons of an articulation.
See
modify_fixed_tendon_properties()
for more information.备注
If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is.
Attributes:
Whether to enable or disable the tendon.
Spring stiffness term acting on the tendon's length.
The damping term acting on both the tendon length and the tendon-length limits.
Limit stiffness term acting on the tendon's length limits.
Length offset term for the tendon.
Spring rest length of the tendon.
- damping: float | None#
The damping term acting on both the tendon length and the tendon-length limits.
- omni.isaac.lab.sim.schemas.modify_fixed_tendon_properties(prim_path: str, cfg: schemas_cfg.FixedTendonPropertiesCfg, stage: Usd.Stage | None = None) bool [源代码]#
Modify PhysX parameters for a fixed tendon attachment prim.
A fixed tendon can be used to link multiple degrees of freedom of articulation joints through length and limit constraints. For instance, it can be used to set up an equality constraint between a driven and passive revolute joints.
The schema comprises of attributes that belong to the PhysxTendonAxisRootAPI schema.
备注
This function is decorated with
apply_nested()
that sets the properties to all the prims (that have the schema applied on them) under the input prim path.- 参数:
prim_path – The prim path to the tendon attachment.
cfg – The configuration for the tendon attachment.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 返回:
True if the properties were successfully set, False otherwise.
- 抛出:
ValueError – If the input prim path is not valid.
Deformable Body#
- class omni.isaac.lab.sim.schemas.DeformableBodyPropertiesCfg[源代码]#
Properties to apply to a deformable body.
A deformable body is a body that can deform under forces. The configuration allows users to specify the properties of the deformable body, such as the solver iteration counts, damping, and self-collision.
An FEM-based deformable body is created by providing a collision mesh and simulation mesh. The collision mesh is used for collision detection and the simulation mesh is used for simulation. The collision mesh is usually a simplified version of the simulation mesh.
Based on the above, the PhysX team provides APIs to either set the simulation and collision mesh directly (by specifying the points) or to simplify the collision mesh based on the simulation mesh. The simplification process involves remeshing the collision mesh and simplifying it based on the target triangle count.
Since specifying the collision mesh points directly is not a common use case, we only expose the parameters to simplify the collision mesh based on the simulation mesh. If you want to provide the collision mesh points, please open an issue on the repository and we can add support for it.
See
modify_deformable_body_properties()
for more information.备注
If the values are
None
, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is.Attributes:
Enables deformable body.
Enables kinematic body.
Whether to enable or disable self-collisions for the deformable body based on the rest position distances.
Penetration value that needs to get exceeded before contacts for self collision are generated.
Threshold vertex velocity (in m/s) under which sleep damping is applied in addition to velocity damping.
Coefficient for the additional damping term if fertex velocity drops below setting threshold.
The velocity threshold (in m/s) under which the vertex becomes a candidate for sleeping in the next step.
Number of the solver positional iterations per step.
Coefficient for artificial damping on the vertex velocity.
The target resolution for the hexahedral mesh used for simulation.
Whether or not to simplify the collision mesh before creating a soft body out of it.
Whether or not the collision mesh should be remeshed before simplification.
The resolution used for remeshing.
The target triangle count used for the simplification.
Whether or not the simplification should force the output mesh to conform to the input mesh.
Contact offset for the collision shape (in m).
Rest offset for the collision shape (in m).
Maximum depenetration velocity permitted to be introduced by the solver (in m/s).
- kinematic_enabled: bool#
Enables kinematic body. Defaults to False, which means that the body is not kinematic.
Similar to rigid bodies, this allows setting user-driven motion for the deformable body. For more information, please refer to the documentation.
- self_collision: bool | None#
Whether to enable or disable self-collisions for the deformable body based on the rest position distances.
- self_collision_filter_distance: float | None#
Penetration value that needs to get exceeded before contacts for self collision are generated.
This parameter must be greater than of equal to twice the
rest_offset
value.This value has an effect only if
self_collision
is enabled.
- settling_threshold: float | None#
Threshold vertex velocity (in m/s) under which sleep damping is applied in addition to velocity damping.
- sleep_damping: float | None#
Coefficient for the additional damping term if fertex velocity drops below setting threshold.
- sleep_threshold: float | None#
The velocity threshold (in m/s) under which the vertex becomes a candidate for sleeping in the next step.
- solver_position_iteration_count: int | None#
Number of the solver positional iterations per step. Range is [1,255]
- vertex_velocity_damping: float | None#
Coefficient for artificial damping on the vertex velocity.
This parameter can be used to approximate the effect of air drag on the deformable body.
- simulation_hexahedral_resolution: int#
The target resolution for the hexahedral mesh used for simulation. Defaults to 10.
备注
This value is ignored if the user provides the simulation mesh points directly. However, we assume that most users will not provide the simulation mesh points directly. If you want to provide the simulation mesh directly, please set this value to
None
.
- collision_simplification: bool#
Whether or not to simplify the collision mesh before creating a soft body out of it. Defaults to True.
备注
This flag is ignored if the user provides the simulation mesh points directly. However, we assume that most users will not provide the simulation mesh points directly. Hence, this flag is enabled by default.
If you want to provide the simulation mesh points directly, please set this flag to False.
- collision_simplification_remeshing: bool#
Whether or not the collision mesh should be remeshed before simplification. Defaults to True.
This parameter is ignored if
collision_simplification
is False.
- collision_simplification_remeshing_resolution: int#
The resolution used for remeshing. Defaults to 0, which means that a heuristic is used to determine the resolution.
This parameter is ignored if
collision_simplification_remeshing
is False.
- collision_simplification_target_triangle_count: int#
The target triangle count used for the simplification. Defaults to 0, which means that a heuristic based on the
simulation_hexahedral_resolution
is used to determine the target count.This parameter is ignored if
collision_simplification
is False.
- collision_simplification_force_conforming: bool#
Whether or not the simplification should force the output mesh to conform to the input mesh. Defaults to True.
The flag indicates that the tretrahedralizer used to generate the collision mesh should produce tetrahedra that conform to the triangle mesh. If False, the simplifier uses the output from the tretrahedralizer used.
This parameter is ignored if
collision_simplification
is False.
- contact_offset: float | None#
Contact offset for the collision shape (in m).
The collision detector generates contact points as soon as two shapes get closer than the sum of their contact offsets. This quantity should be non-negative which means that contact generation can potentially start before the shapes actually penetrate.
- rest_offset: float | None#
Rest offset for the collision shape (in m).
The rest offset quantifies how close a shape gets to others at rest, At rest, the distance between two vertically stacked objects is the sum of their rest offsets. If a pair of shapes have a positive rest offset, the shapes will be separated at rest by an air gap.
- omni.isaac.lab.sim.schemas.define_deformable_body_properties(prim_path: str, cfg: schemas_cfg.DeformableBodyPropertiesCfg, stage: Usd.Stage | None = None)[源代码]#
Apply the deformable body schema on the input prim and set its properties.
See
modify_deformable_body_properties()
for more details on how the properties are set.备注
If the input prim is not a mesh, this function will traverse the prim and find the first mesh under it. If no mesh or multiple meshes are found, an error is raised. This is because the deformable body schema can only be applied to a single mesh.
- 参数:
prim_path – The prim path where to apply the deformable body schema.
cfg – The configuration for the deformable body.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 抛出:
ValueError – When the prim path is not valid.
ValueError – When the prim has no mesh or multiple meshes.
- omni.isaac.lab.sim.schemas.modify_deformable_body_properties(prim_path: str, cfg: schemas_cfg.DeformableBodyPropertiesCfg, stage: Usd.Stage | None = None)[源代码]#
Modify PhysX parameters for a deformable body prim.
A deformable body is a single body that can be simulated by PhysX. Unlike rigid bodies, deformable bodies support relative motion of the nodes in the mesh. Consequently, they can be used to simulate deformations under applied forces.
PhysX soft body simulation employs Finite Element Analysis (FEA) to simulate the deformations of the mesh. It uses two tetrahedral meshes to represent the deformable body:
Simulation mesh: This mesh is used for the simulation and is the one that is deformed by the solver.
Collision mesh: This mesh only needs to match the surface of the simulation mesh and is used for collision detection.
For most applications, we assume that the above two meshes are computed from the “render mesh” of the deformable body. The render mesh is the mesh that is visible in the scene and is used for rendering purposes. It is composed of triangles and is the one that is used to compute the above meshes based on PhysX cookings.
The schema comprises of attributes that belong to the PhysxDeformableBodyAPI. schemas containing the PhysX parameters for the deformable body.
小心
The deformable body schema is still under development by the Omniverse team. The current implementation works with the PhysX schemas shipped with Isaac Sim 4.0.0 onwards. It may change in future releases.
备注
This function is decorated with
apply_nested()
that sets the properties to all the prims (that have the schema applied on them) under the input prim path.- 参数:
prim_path – The prim path to the deformable body.
cfg – The configuration for the deformable body.
stage – The stage where to find the prim. Defaults to None, in which case the current stage is used.
- 返回:
True if the properties were successfully set, False otherwise.