We have now released v0.3.0! Please use the latest version for the best experience.

orbit.sim.schemas

Contents

orbit.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.

Caution

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/kit/extsPhysics/omni.usd.schema.physics/plugins/UsdPhysics/resources/UsdPhysics/schema.usda

  • _isaac_sim/kit/extsPhysics/omni.usd.schema.physx/plugins/PhysxSchema/resources/PhysxSchema/schema.usda

Classes

ArticulationRootPropertiesCfg

Properties to apply to the root of an articulation.

RigidBodyPropertiesCfg

Properties to apply to a rigid body.

CollisionPropertiesCfg

Properties to apply to colliders in a rigid body.

MassPropertiesCfg

Properties to define explicit mass properties of a rigid body.

JointDrivePropertiesCfg

Properties to define the drive mechanism of a joint.

FixedTendonPropertiesCfg

Properties to define fixed tendons of an articulation.

Functions

define_articulation_root_properties(...[, stage])

Apply the articulation root schema on the input prim and set its properties.

modify_articulation_root_properties(...[, stage])

Modify PhysX parameters for an articulation root prim.

define_rigid_body_properties(prim_path, cfg)

Apply the rigid body schema on the input prim and set its properties.

modify_rigid_body_properties(prim_path, cfg)

Modify PhysX parameters for a rigid body prim.

activate_contact_sensors(prim_path[, ...])

Activate the contact sensor on all rigid bodies under a specified prim path.

define_collision_properties(prim_path, cfg)

Apply the collision schema on the input prim and set its properties.

modify_collision_properties(prim_path, cfg)

Modify PhysX properties of collider prim.

define_mass_properties(prim_path, cfg[, stage])

Apply the mass schema on the input prim and set its properties.

modify_mass_properties(prim_path, cfg[, stage])

Set properties for the mass of a rigid body prim.

modify_joint_drive_properties(prim_path, ...)

Modify PhysX parameters for a joint prim.

modify_fixed_tendon_properties(prim_path, cfg)

Modify PhysX parameters for a fixed tendon attachment prim.

Articulation Root#

class omni.isaac.orbit.sim.schemas.ArticulationRootPropertiesCfg[source]#

Properties to apply to the root of an articulation.

See modify_articulation_root_properties() for more information.

Note

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:

articulation_enabled

Whether to enable or disable articulation.

enabled_self_collisions

Whether to enable or disable self-collisions.

solver_position_iteration_count

Solver position iteration counts for the body.

solver_velocity_iteration_count

Solver position iteration counts for the body.

sleep_threshold

Mass-normalized kinetic energy threshold below which an actor may go to sleep.

stabilization_threshold

The mass-normalized kinetic energy threshold below which an articulation may participate in stabilization.

fix_root_link

Whether to fix the root link of the articulation.

articulation_enabled: bool | None#

Whether to enable or disable articulation.

enabled_self_collisions: bool | None#

Whether to enable or disable self-collisions.

solver_position_iteration_count: int | None#

Solver position iteration counts for the body.

solver_velocity_iteration_count: int | None#

Solver position iteration counts for the body.

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.

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.

Note

This is a non-USD schema property. It is handled by the modify_articulation_root_properties() function.

omni.isaac.orbit.sim.schemas.define_articulation_root_properties(prim_path: str, cfg: schemas_cfg.ArticulationRootPropertiesCfg, stage: Usd.Stage | None = None)[source]#

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.

Parameters:
  • 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.

Raises:
  • ValueError – When the prim path is not valid.

  • TypeError – When the prim already has conflicting API schemas.

omni.isaac.orbit.sim.schemas.modify_articulation_root_properties(prim_path: str, cfg: schemas_cfg.ArticulationRootPropertiesCfg, stage: Usd.Stage | None = None) bool[source]#

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.

Caution

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.

Note

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.

Parameters:
  • 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.

Returns:

True if the properties were successfully set, False otherwise.

Raises:

NotImplementedError – When the root prim is not a rigid body and a fixed joint is to be created.

Rigid Body#

class omni.isaac.orbit.sim.schemas.RigidBodyPropertiesCfg[source]#

Properties to apply to a rigid body.

See modify_rigid_body_properties() for more information.

Note

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:

rigid_body_enabled

Whether to enable or disable the rigid body.

kinematic_enabled

Determines whether the body is kinematic or not.

disable_gravity

Disable gravity for the actor.

linear_damping

Linear damping for the body.

angular_damping

Angular damping for the body.

max_linear_velocity

Maximum linear velocity for rigid bodies (in m/s).

max_angular_velocity

Maximum angular velocity for rigid bodies (in deg/s).

max_depenetration_velocity

Maximum depenetration velocity permitted to be introduced by the solver (in m/s).

max_contact_impulse

The limit on the impulse that may be applied at a contact.

enable_gyroscopic_forces

Enables computation of gyroscopic forces on the rigid body.

retain_accelerations

Carries over forces/accelerations over sub-steps.

solver_position_iteration_count

Solver position iteration counts for the body.

solver_velocity_iteration_count

Solver position iteration counts for the body.

sleep_threshold

Mass-normalized kinetic energy threshold below which an actor may go to sleep.

stabilization_threshold

The mass-normalized kinetic energy threshold below which an actor may participate in stabilization.

rigid_body_enabled: bool | None#

Whether to enable or disable the rigid body.

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.

disable_gravity: bool | None#

Disable gravity for the actor.

linear_damping: float | None#

Linear damping for the body.

angular_damping: float | None#

Angular damping for the body.

max_linear_velocity: float | None#

Maximum linear velocity for rigid bodies (in m/s).

max_angular_velocity: float | None#

Maximum angular velocity for rigid bodies (in deg/s).

max_depenetration_velocity: float | None#

Maximum depenetration velocity permitted to be introduced by the solver (in m/s).

max_contact_impulse: float | None#

The limit on the impulse that may be applied at a contact.

enable_gyroscopic_forces: bool | None#

Enables computation of gyroscopic forces on the rigid body.

retain_accelerations: bool | None#

Carries over forces/accelerations over sub-steps.

solver_position_iteration_count: int | None#

Solver position iteration counts for the body.

solver_velocity_iteration_count: int | None#

Solver position iteration counts for the body.

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 actor may participate in stabilization.

omni.isaac.orbit.sim.schemas.define_rigid_body_properties(prim_path: str, cfg: schemas_cfg.RigidBodyPropertiesCfg, stage: Usd.Stage | None = None)[source]#

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.

Parameters:
  • 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.

Raises:
  • ValueError – When the prim path is not valid.

  • TypeError – When the prim already has conflicting API schemas.

omni.isaac.orbit.sim.schemas.modify_rigid_body_properties(prim_path: str, cfg: schemas_cfg.RigidBodyPropertiesCfg, stage: Usd.Stage | None = None) bool[source]#

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.

Note

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.

Parameters:
  • 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.

Returns:

True if the properties were successfully set, False otherwise.

omni.isaac.orbit.sim.schemas.activate_contact_sensors(prim_path: str, threshold: float = 0.0, stage: pxr.Usd.Stage | None = None)[source]#

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.

Parameters:
  • 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.

Raises:
  • ValueError – If the input prim path is not valid.

  • ValueError – If there are no rigid bodies under the prim path.

Collision#

class omni.isaac.orbit.sim.schemas.CollisionPropertiesCfg[source]#

Properties to apply to colliders in a rigid body.

See modify_collision_properties() for more information.

Note

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:

collision_enabled

Whether to enable or disable collisions.

contact_offset

Contact offset for the collision shape (in m).

rest_offset

Rest offset for the collision shape (in m).

torsional_patch_radius

Radius of the contact patch for applying torsional friction (in m).

min_torsional_patch_radius

Minimum radius of the contact patch for applying torsional friction (in m).

collision_enabled: bool | None#

Whether to enable or disable collisions.

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.

torsional_patch_radius: float | None#

Radius of the contact patch for applying torsional friction (in m).

It is used to approximate rotational friction introduced by the compression of contacting surfaces. If the radius is zero, no torsional friction is applied.

min_torsional_patch_radius: float | None#

Minimum radius of the contact patch for applying torsional friction (in m).

omni.isaac.orbit.sim.schemas.define_collision_properties(prim_path: str, cfg: schemas_cfg.CollisionPropertiesCfg, stage: Usd.Stage | None = None)[source]#

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.

Parameters:
  • 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.

Raises:

ValueError – When the prim path is not valid.

omni.isaac.orbit.sim.schemas.modify_collision_properties(prim_path: str, cfg: schemas_cfg.CollisionPropertiesCfg, stage: Usd.Stage | None = None) bool[source]#

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.

Note

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.

Parameters:
  • 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.

Returns:

True if the properties were successfully set, False otherwise.

Mass#

class omni.isaac.orbit.sim.schemas.MassPropertiesCfg[source]#

Properties to define explicit mass properties of a rigid body.

See modify_mass_properties() for more information.

Note

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:

mass

The mass of the rigid body (in kg).

density

The density of the rigid body (in kg/m^3).

mass: float | None#

The mass of the rigid body (in kg).

Note

If non-zero, the mass is ignored and the density is used to compute the mass.

density: float | None#

The density of the rigid body (in kg/m^3).

The density indirectly defines the mass of the rigid body. It is generally computed using the collision approximation of the body.

omni.isaac.orbit.sim.schemas.define_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, stage: Usd.Stage | None = None)[source]#

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.

Parameters:
  • 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.

Raises:

ValueError – When the prim path is not valid.

omni.isaac.orbit.sim.schemas.modify_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, stage: Usd.Stage | None = None) bool[source]#

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.

Caution

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.

Note

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.

Parameters:
  • 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.

Returns:

True if the properties were successfully set, False otherwise.

Joint Drive#

class omni.isaac.orbit.sim.schemas.JointDrivePropertiesCfg[source]#

Properties to define the drive mechanism of a joint.

See modify_joint_drive_properties() for more information.

Note

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:

drive_type

Joint drive type to apply.

drive_type: Literal['force', 'acceleration'] | None#

Joint drive type to apply.

If the drive type is “force”, then the joint is driven by a force. If the drive type is “acceleration”, then the joint is driven by an acceleration (usually used for kinematic joints).

omni.isaac.orbit.sim.schemas.modify_joint_drive_properties(prim_path: str, drive_props: schemas_cfg.JointDrivePropertiesCfg, stage: Usd.Stage | None = None) bool[source]#

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.

Caution

We highly recommend modifying joint properties of articulations through the functionalities in the omni.isaac.orbit.actuators module. The methods here are for setting simulation low-level properties only.

Parameters:
  • 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.

Returns:

True if the properties were successfully set, False otherwise.

Raises:

ValueError – If the input prim path is not valid.

Fixed Tendon#

class omni.isaac.orbit.sim.schemas.FixedTendonPropertiesCfg[source]#

Properties to define fixed tendons of an articulation.

See modify_fixed_tendon_properties() for more information.

Note

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:

tendon_enabled

Whether to enable or disable the tendon.

stiffness

Spring stiffness term acting on the tendon's length.

damping

The damping term acting on both the tendon length and the tendon-length limits.

limit_stiffness

Limit stiffness term acting on the tendon's length limits.

offset

Length offset term for the tendon.

rest_length

Spring rest length of the tendon.

tendon_enabled: bool | None#

Whether to enable or disable the tendon.

stiffness: float | None#

Spring stiffness term acting on the tendon’s length.

damping: float | None#

The damping term acting on both the tendon length and the tendon-length limits.

limit_stiffness: float | None#

Limit stiffness term acting on the tendon’s length limits.

offset: float | None#

Length offset term for the tendon.

It defines an amount to be added to the accumulated length computed for the tendon. This allows the application to actuate the tendon by shortening or lengthening it.

rest_length: float | None#

Spring rest length of the tendon.

omni.isaac.orbit.sim.schemas.modify_fixed_tendon_properties(prim_path: str, cfg: schemas_cfg.FixedTendonPropertiesCfg, stage: Usd.Stage | None = None) bool[source]#

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.

Note

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.

Parameters:
  • 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.

Returns:

True if the properties were successfully set, False otherwise.

Raises:

ValueError – If the input prim path is not valid.