isaaclab.envs.mdp#
Sub-module with implementation of manager terms.
The functions can be provided to different managers that are responsible for the different aspects of the MDP. These include the observation, reward, termination, actions, events and curriculum managers.
The terms are defined under the envs module because they are used to define
the environment. However, they are not part of the environment directly, but
are used to define the environment through their managers.
Observations#
Common functions that can be used to create observation terms.
The functions can be passed to the isaaclab.managers.ObservationTermCfg object to enable
the observation introduced by the function.
Functions:
|
Root height in the simulation world frame. |
|
Root linear velocity in the asset's root frame. |
|
Root angular velocity in the asset's root frame. |
|
Gravity projection on the asset's root frame. |
|
Asset root position in the environment frame. |
|
Asset root orientation (x, y, z, w) in the environment frame. |
|
Asset root linear velocity in the environment frame. |
|
Asset root angular velocity in the environment frame. |
|
The flattened body poses of the asset w.r.t the env.scene.origin. |
|
The direction of gravity projected on to bodies of an Articulation. |
|
The joint positions of the asset. |
|
The joint positions of the asset w.r.t. |
|
The joint positions of the asset normalized with the asset's joint limits. |
|
The joint velocities of the asset. |
|
The joint velocities of the asset w.r.t. |
|
The joint applied effort of the robot. |
|
Height scan from the given sensor w.r.t. |
|
Incoming spatial wrench [N, N·m] on bodies of an articulation in the sensor convention. |
|
PVA sensor orientation in the simulation world frame. |
|
PVA sensor projected gravity in the sensor frame. |
|
IMU sensor angular velocity w.r.t. |
|
IMU sensor linear acceleration w.r.t. |
|
Images of a specific datatype from the camera sensor. |
|
The last input action to the environment. |
|
The generated command from command term in the command manager with the given name. |
|
The current time in the episode (in seconds). |
|
The maximum time remaining in the episode (in seconds). |
Classes:
Extracted image features from a pre-trained frozen encoder. |
|
Channel-stacked observation of the last |
- isaaclab.envs.mdp.observations.base_pos_z(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Root height in the simulation world frame.
- isaaclab.envs.mdp.observations.base_lin_vel(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Root linear velocity in the asset’s root frame.
- isaaclab.envs.mdp.observations.base_ang_vel(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Root angular velocity in the asset’s root frame.
- isaaclab.envs.mdp.observations.projected_gravity(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Gravity projection on the asset’s root frame.
- isaaclab.envs.mdp.observations.root_pos_w(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Asset root position in the environment frame.
- isaaclab.envs.mdp.observations.root_quat_w(env: ManagerBasedEnv, make_quat_unique: bool = False, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Asset root orientation (x, y, z, w) in the environment frame.
If
make_quat_uniqueis True, then returned quaternion is made unique by ensuring the quaternion has non-negative real component. This is because bothqand-qrepresent the same orientation.
- isaaclab.envs.mdp.observations.root_lin_vel_w(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Asset root linear velocity in the environment frame.
- isaaclab.envs.mdp.observations.root_ang_vel_w(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Asset root angular velocity in the environment frame.
- isaaclab.envs.mdp.observations.body_pose_w(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
The flattened body poses of the asset w.r.t the env.scene.origin.
Note: Only the bodies configured in
asset_cfg.body_idswill have their poses returned.
- isaaclab.envs.mdp.observations.body_projected_gravity_b(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
The direction of gravity projected on to bodies of an Articulation.
Note: Only the bodies configured in
asset_cfg.body_idswill have their poses returned.
- isaaclab.envs.mdp.observations.joint_pos(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
The joint positions of the asset.
Note: Only the joints configured in
asset_cfg.joint_idswill have their positions returned.
- isaaclab.envs.mdp.observations.joint_pos_rel(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
The joint positions of the asset w.r.t. the default joint positions.
Note: Only the joints configured in
asset_cfg.joint_idswill have their positions returned.
- isaaclab.envs.mdp.observations.joint_pos_limit_normalized(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
The joint positions of the asset normalized with the asset’s joint limits.
Note: Only the joints configured in
asset_cfg.joint_idswill have their normalized positions returned.
- isaaclab.envs.mdp.observations.joint_vel(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False))[source]#
The joint velocities of the asset.
Note: Only the joints configured in
asset_cfg.joint_idswill have their velocities returned.
- isaaclab.envs.mdp.observations.joint_vel_rel(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False))[source]#
The joint velocities of the asset w.r.t. the default joint velocities.
Note: Only the joints configured in
asset_cfg.joint_idswill have their velocities returned.
- isaaclab.envs.mdp.observations.joint_effort(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
The joint applied effort of the robot.
NOTE: Only the joints configured in
asset_cfg.joint_idswill have their effort returned.
- isaaclab.envs.mdp.observations.height_scan(env: ManagerBasedEnv, sensor_cfg: SceneEntityCfg, offset: float = 0.5) torch.Tensor[source]#
Height scan from the given sensor w.r.t. the sensor’s frame.
The provided offset (Defaults to 0.5) is subtracted from the returned values.
- isaaclab.envs.mdp.observations.body_incoming_wrench(env: ManagerBasedEnv, sensor_cfg: SceneEntityCfg) torch.Tensor[source]#
Incoming spatial wrench [N, N·m] on bodies of an articulation in the sensor convention.
This is the 6-D wrench (force followed by torque) applied to the body link by the incoming joint force.
- isaaclab.envs.mdp.observations.pva_orientation(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='pva', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
PVA sensor orientation in the simulation world frame.
- isaaclab.envs.mdp.observations.pva_projected_gravity(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='pva', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
PVA sensor projected gravity in the sensor frame.
- isaaclab.envs.mdp.observations.imu_ang_vel(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='imu', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
IMU sensor angular velocity w.r.t. environment origin expressed in the sensor frame [rad/s].
- isaaclab.envs.mdp.observations.imu_lin_acc(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='imu', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
IMU sensor linear acceleration w.r.t. the environment origin expressed in sensor frame [m/s^2].
- isaaclab.envs.mdp.observations.image(env: ManagerBasedEnv, sensor_cfg: SceneEntityCfg = SceneEntityCfg(name='tiled_camera', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False), data_type: str = 'rgb', convert_perspective_to_orthogonal: bool = False, normalize: bool = True, permute: bool = False, clone: bool = True) torch.Tensor[source]#
Images of a specific datatype from the camera sensor.
If the flag
normalizeis True, post-processing of the images are performed based on their data-types:“rgb”: Scales the image to (0, 1) and subtracts with the mean of the current image batch.
“depth” or “distance_to_camera” or “distance_to_plane”: Replaces infinity values with zero.
- Parameters:
env¶ – The environment the cameras are placed within.
sensor_cfg¶ – The desired sensor to read from. Defaults to SceneEntityCfg(“tiled_camera”).
data_type¶ – The data type to pull from the desired camera. Defaults to “rgb”.
convert_perspective_to_orthogonal¶ – Whether to orthogonalize perspective depth images. This is used only when the data type is “distance_to_camera”. Defaults to False.
normalize¶ – Whether to normalize the images. This depends on the selected data type. Defaults to True.
permute¶ – Whether to permute the image to (num_envs, channel, height, width). Defaults to False.
clone¶ – Whether to return a fresh clone of the result. Defaults to True (defensive: protects against downstream in-place mutation of the camera buffer). Callers that immediately copy the result into their own storage (e.g. a frame-stack buffer) can pass
Falseto skip the redundant allocation.
- Returns:
The images produced at the last time-step
- class isaaclab.envs.mdp.observations.image_features[source]#
Extracted image features from a pre-trained frozen encoder.
This term uses models from the model zoo in PyTorch and extracts features from the images.
It calls the
image()function to get the images and then processes them using the model zoo.A user can provide their own model zoo configuration to use different models for feature extraction. The model zoo configuration should be a dictionary that maps different model names to a dictionary that defines the model, preprocess and inference functions. The dictionary should have the following entries:
“model”: A callable that returns the model when invoked without arguments.
“reset”: A callable that resets the model. This is useful when the model has a state that needs to be reset.
“inference”: A callable that, when given the model and the images, returns the extracted features.
If the model zoo configuration is not provided, the default model zoo configurations are used. The default model zoo configurations include the models from Theia [SSM+24] and ResNet [HZRS16]. These models are loaded from Hugging-Face transformers and PyTorch torchvision respectively.
- Parameters:
sensor_cfg¶ – The sensor configuration to poll. Defaults to SceneEntityCfg(“tiled_camera”).
data_type¶ – The sensor data type. Defaults to “rgb”.
convert_perspective_to_orthogonal¶ – Whether to orthogonalize perspective depth images. This is used only when the data type is “distance_to_camera”. Defaults to False.
model_zoo_cfg¶ – A user-defined dictionary that maps different model names to their respective configurations. Defaults to None. If None, the default model zoo configurations are used.
model_name¶ – The name of the model to use for inference. Defaults to “resnet18”.
model_device¶ – The device to store and infer the model on. This is useful when offloading the computation from the environment simulation device. Defaults to the environment device.
inference_kwargs¶ – Additional keyword arguments to pass to the inference function. Defaults to None, which means no additional arguments are passed.
- Returns:
The extracted features tensor. Shape is (num_envs, feature_dim).
- Raises:
ValueError – When the model name is not found in the provided model zoo configuration.
ValueError – When the model name is not found in the default model zoo configuration.
Methods:
- __init__(cfg: ObservationTermCfg, env: ManagerBasedEnv)[source]#
Initialize the manager term.
- reset(env_ids: torch.Tensor | None = None)[source]#
Resets the manager term.
- Parameters:
env_ids¶ – The environment ids. Defaults to None, in which case all environments are considered.
- class isaaclab.envs.mdp.observations.stacked_image[source]#
Channel-stacked observation of the last
frame_stackcamera frames.Maintains a per-env rolling history of camera frames in a
CircularBufferand returns them concatenated along the channel dimension in oldest-to-newest order. Useful for camera-based RL tasks whose rendering backend does not supply implicit temporal information (e.g., the Newton Warp renderer, which lacks temporal anti-aliasing).On the first call after construction or per-env reset, all history slots for the affected envs are filled with the current frame so the policy never sees zero-padded warmup data.
- Parameters:
sensor_cfg¶ – The sensor configuration to poll. Defaults to SceneEntityCfg(“tiled_camera”).
data_type¶ – The sensor data type. Defaults to “rgb”.
frame_stack¶ – Number of frames to stack along the channel dim. Must be >= 1. Defaults to 1 (single-frame passthrough).
convert_perspective_to_orthogonal¶ – Whether to orthogonalize perspective depth images. Used only when
data_type == "distance_to_camera". Defaults to False.normalize¶ – Whether to normalize the images. See
image()for per-data-type behavior. Defaults to True.
- Returns:
Stacked image tensor. Shape is
(num_envs, H, W, frame_stack * C)where the firstCchannels are the oldest frame and the lastCchannels are the newest.
Methods:
- __init__(cfg: ObservationTermCfg, env: ManagerBasedEnv)[source]#
Initialize the manager term.
- reset(env_ids: torch.Tensor | None = None)[source]#
Resets the manager term.
- Parameters:
env_ids¶ – The environment ids. Defaults to None, in which case all environments are considered.
- isaaclab.envs.mdp.observations.last_action(env: ManagerBasedEnv, action_name: str | None = None) torch.Tensor[source]#
The last input action to the environment.
The name of the action term for which the action is required. If None, the entire action tensor is returned.
- isaaclab.envs.mdp.observations.generated_commands(env: ManagerBasedRLEnv, command_name: str | None = None) torch.Tensor[source]#
The generated command from command term in the command manager with the given name.
- isaaclab.envs.mdp.observations.current_time_s(env: ManagerBasedRLEnv) torch.Tensor[source]#
The current time in the episode (in seconds).
- isaaclab.envs.mdp.observations.remaining_time_s(env: ManagerBasedRLEnv) torch.Tensor[source]#
The maximum time remaining in the episode (in seconds).
Actions#
Various action terms that can be used in the environment.
Classes:
Configuration for the base joint action term. |
|
Configuration for the joint position action term. |
|
Configuration for the relative joint position action term. |
|
Configuration for the joint velocity action term. |
|
Configuration for the joint effort action term. |
|
Configuration for the bounded joint position action term. |
|
Configuration for the exponential moving average (EMA) joint position action term. |
|
Configuration for the base binary joint action term. |
|
Configuration for the binary joint position action term. |
|
Configuration for the binary joint velocity action term. |
|
Configuration for the absolute binary joint position action term. |
|
Configuration for the non-holonomic action term with dummy joints at the base. |
|
Configuration for inverse differential kinematics action term. |
|
Configuration for operational space controller action term. |
|
Configuration for the binary surface gripper action term. |
- class isaaclab.envs.mdp.actions.actions_cfg.JointActionCfg[source]#
Bases:
ActionTermCfgConfiguration for the base joint action term.
See
JointActionfor more details.Attributes:
List of joint names or regex expressions that the action will be mapped to.
Scale factor for the action (float or dict of regex expressions).
Offset factor for the action (float or dict of regex expressions).
Whether to preserve the order of the joint names in the action output.
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
- scale: float | dict[str, float]#
Scale factor for the action (float or dict of regex expressions). Defaults to 1.0.
- offset: float | dict[str, float]#
Offset factor for the action (float or dict of regex expressions). Defaults to 0.0.
- preserve_order: bool#
Whether to preserve the order of the joint names in the action output. Defaults to False.
- class isaaclab.envs.mdp.actions.actions_cfg.JointPositionActionCfg[source]#
Bases:
JointActionCfgConfiguration for the joint position action term.
See
JointPositionActionfor more details.Attributes:
Whether to use default joint positions configured in the articulation asset as offset.
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
List of joint names or regex expressions that the action will be mapped to.
Scale factor for the action (float or dict of regex expressions).
Offset factor for the action (float or dict of regex expressions).
Whether to preserve the order of the joint names in the action output.
- use_default_offset: bool#
Whether to use default joint positions configured in the articulation asset as offset. Defaults to True.
If True, this flag results in overwriting the values of
offsetto the default joint positions from the articulation asset.
- asset_name: str#
The name of the scene entity.
This is the name defined in the scene configuration file. See the
InteractiveSceneCfgclass for more details.
- clip: dict[str, tuple] | None#
Clip range for the action (dict of regex expressions). Defaults to None.
- scale: float | dict[str, float]#
Scale factor for the action (float or dict of regex expressions). Defaults to 1.0.
- class isaaclab.envs.mdp.actions.actions_cfg.RelativeJointPositionActionCfg[source]#
Bases:
JointActionCfgConfiguration for the relative joint position action term.
See
RelativeJointPositionActionfor more details.Attributes:
Whether to ignore the offset defined in articulation asset.
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
List of joint names or regex expressions that the action will be mapped to.
Scale factor for the action (float or dict of regex expressions).
Offset factor for the action (float or dict of regex expressions).
Whether to preserve the order of the joint names in the action output.
- use_zero_offset: bool#
Whether to ignore the offset defined in articulation asset. Defaults to True.
If True, this flag results in overwriting the values of
offsetto zero.
- asset_name: str#
The name of the scene entity.
This is the name defined in the scene configuration file. See the
InteractiveSceneCfgclass for more details.
- clip: dict[str, tuple] | None#
Clip range for the action (dict of regex expressions). Defaults to None.
- scale: float | dict[str, float]#
Scale factor for the action (float or dict of regex expressions). Defaults to 1.0.
- class isaaclab.envs.mdp.actions.actions_cfg.JointVelocityActionCfg[source]#
Bases:
JointActionCfgConfiguration for the joint velocity action term.
See
JointVelocityActionfor more details.Attributes:
Whether to use default joint velocities configured in the articulation asset as offset.
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
List of joint names or regex expressions that the action will be mapped to.
Scale factor for the action (float or dict of regex expressions).
Offset factor for the action (float or dict of regex expressions).
Whether to preserve the order of the joint names in the action output.
- use_default_offset: bool#
Whether to use default joint velocities configured in the articulation asset as offset. Defaults to True.
This overrides the settings from
offsetif set to True.
- asset_name: str#
The name of the scene entity.
This is the name defined in the scene configuration file. See the
InteractiveSceneCfgclass for more details.
- clip: dict[str, tuple] | None#
Clip range for the action (dict of regex expressions). Defaults to None.
- scale: float | dict[str, float]#
Scale factor for the action (float or dict of regex expressions). Defaults to 1.0.
- class isaaclab.envs.mdp.actions.actions_cfg.JointEffortActionCfg[source]#
Bases:
JointActionCfgConfiguration for the joint effort action term.
See
JointEffortActionfor more details.Attributes:
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
List of joint names or regex expressions that the action will be mapped to.
Scale factor for the action (float or dict of regex expressions).
Offset factor for the action (float or dict of regex expressions).
Whether to preserve the order of the joint names in the action output.
- asset_name: str#
The name of the scene entity.
This is the name defined in the scene configuration file. See the
InteractiveSceneCfgclass for more details.
- clip: dict[str, tuple] | None#
Clip range for the action (dict of regex expressions). Defaults to None.
- scale: float | dict[str, float]#
Scale factor for the action (float or dict of regex expressions). Defaults to 1.0.
- class isaaclab.envs.mdp.actions.actions_cfg.JointPositionToLimitsActionCfg[source]#
Bases:
ActionTermCfgConfiguration for the bounded joint position action term.
See
JointPositionToLimitsActionfor more details.Attributes:
List of joint names or regex expressions that the action will be mapped to.
Scale factor for the action (float or dict of regex expressions).
Whether to rescale the action to the joint limits.
Whether to preserve the order of the joint names in the action output.
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
- scale: float | dict[str, float]#
Scale factor for the action (float or dict of regex expressions). Defaults to 1.0.
- rescale_to_limits: bool#
Whether to rescale the action to the joint limits. Defaults to True.
If True, the input actions are rescaled to the joint limits, i.e., the action value in the range [-1, 1] corresponds to the joint lower and upper limits respectively.
Note
This operation is performed after applying the scale factor.
- preserve_order: bool#
Whether to preserve the order of the joint names in the action output. Defaults to False.
- class isaaclab.envs.mdp.actions.actions_cfg.EMAJointPositionToLimitsActionCfg[source]#
Bases:
JointPositionToLimitsActionCfgConfiguration for the exponential moving average (EMA) joint position action term.
See
EMAJointPositionToLimitsActionfor more details.Attributes:
The weight for the moving average (float or dict of regex expressions).
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
List of joint names or regex expressions that the action will be mapped to.
Scale factor for the action (float or dict of regex expressions).
Whether to rescale the action to the joint limits.
Whether to preserve the order of the joint names in the action output.
- alpha: float | dict[str, float]#
The weight for the moving average (float or dict of regex expressions). Defaults to 1.0.
If set to 1.0, the processed action is applied directly without any moving average window.
- asset_name: str#
The name of the scene entity.
This is the name defined in the scene configuration file. See the
InteractiveSceneCfgclass for more details.
- clip: dict[str, tuple] | None#
Clip range for the action (dict of regex expressions). Defaults to None.
- scale: float | dict[str, float]#
Scale factor for the action (float or dict of regex expressions). Defaults to 1.0.
- rescale_to_limits: bool#
Whether to rescale the action to the joint limits. Defaults to True.
If True, the input actions are rescaled to the joint limits, i.e., the action value in the range [-1, 1] corresponds to the joint lower and upper limits respectively.
Note
This operation is performed after applying the scale factor.
- class isaaclab.envs.mdp.actions.actions_cfg.BinaryJointActionCfg[source]#
Bases:
ActionTermCfgConfiguration for the base binary joint action term.
See
BinaryJointActionfor more details.Attributes:
List of joint names or regex expressions that the action will be mapped to.
The joint command to move to open configuration.
The joint command to move to close configuration.
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
- class isaaclab.envs.mdp.actions.actions_cfg.BinaryJointPositionActionCfg[source]#
Bases:
BinaryJointActionCfgConfiguration for the binary joint position action term.
See
BinaryJointPositionActionfor more details.Attributes:
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
List of joint names or regex expressions that the action will be mapped to.
The joint command to move to open configuration.
The joint command to move to close configuration.
- asset_name: str#
The name of the scene entity.
This is the name defined in the scene configuration file. See the
InteractiveSceneCfgclass for more details.
- class isaaclab.envs.mdp.actions.actions_cfg.BinaryJointVelocityActionCfg[source]#
Bases:
BinaryJointActionCfgConfiguration for the binary joint velocity action term.
See
BinaryJointVelocityActionfor more details.Attributes:
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
List of joint names or regex expressions that the action will be mapped to.
The joint command to move to open configuration.
The joint command to move to close configuration.
- asset_name: str#
The name of the scene entity.
This is the name defined in the scene configuration file. See the
InteractiveSceneCfgclass for more details.
- class isaaclab.envs.mdp.actions.actions_cfg.AbsBinaryJointPositionActionCfg[source]#
Bases:
ActionTermCfgConfiguration for the absolute binary joint position action term.
This action term is used for robust grasping by converting continuous gripper joint position actions into binary open/close commands. Unlike directly applying continuous gripper joint position actions, this class applies a threshold-based decision mechanism to determine whether to open or close the gripper.
The action works by: 1. Taking a continuous input action value 2. Comparing it against a configurable threshold 3. Mapping the result to either open or close commands based on the threshold comparison 4. Applying the corresponding gripper open/close commands
This approach provides more predictable and stable grasping behavior compared to directly applying continuous gripper joint position actions.
See
AbsBinaryJointPositionActionfor more details.Attributes:
List of joint names or regex expressions that the action will be mapped to.
The joint command to move to open configuration.
The joint command to move to close configuration.
The threshold for the binary action.
Whether to use positive (Open actions > Close actions) threshold.
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
- positive_threshold: bool#
Whether to use positive (Open actions > Close actions) threshold. Defaults to True.
- class isaaclab.envs.mdp.actions.actions_cfg.NonHolonomicActionCfg[source]#
Bases:
ActionTermCfgConfiguration for the non-holonomic action term with dummy joints at the base.
See
NonHolonomicActionfor more details.Attributes:
Name of the body which has the dummy mechanism connected to.
The dummy joint name in the x direction.
The dummy joint name in the y direction.
The dummy joint name in the yaw direction.
Scale factor for the action.
Offset factor for the action.
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
- class isaaclab.envs.mdp.actions.actions_cfg.DifferentialInverseKinematicsActionCfg[source]#
Bases:
ActionTermCfgConfiguration for inverse differential kinematics action term.
See
DifferentialInverseKinematicsActionfor more details.Classes:
The offset pose from parent frame to child frame.
Attributes:
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
List of joint names or regex expressions that the action will be mapped to.
Name of the body or frame for which IK is performed.
Offset of target frame w.r.t.
Scale factor for the action.
The configuration for the differential IK controller.
- class OffsetCfg[source]#
Bases:
objectThe offset pose from parent frame to child frame.
On many robots, end-effector frames are fictitious frames that do not have a corresponding rigid body. In such cases, it is easier to define this transform w.r.t. their parent rigid body. For instance, for the Franka Emika arm, the end-effector is defined at an offset to the the “panda_hand” frame.
Attributes:
- asset_name: str#
The name of the scene entity.
This is the name defined in the scene configuration file. See the
InteractiveSceneCfgclass for more details.
- clip: dict[str, tuple] | None#
Clip range for the action (dict of regex expressions). Defaults to None.
- body_offset: OffsetCfg | None#
Offset of target frame w.r.t. to the body frame. Defaults to None, in which case no offset is applied.
- controller: DifferentialIKControllerCfg#
The configuration for the differential IK controller.
- class isaaclab.envs.mdp.actions.actions_cfg.OperationalSpaceControllerActionCfg[source]#
Bases:
ActionTermCfgConfiguration for operational space controller action term.
See
OperationalSpaceControllerActionfor more details.Attributes:
The name of the scene entity.
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
List of joint names or regex expressions that the action will be mapped to.
Name of the body or frame for which motion/force control is performed.
Offset of target frame w.r.t.
The path of a
RigidObject, relative to the sub-environment, representing task frame.The configuration for the operational space controller.
Scale factor for the position targets.
Scale factor for the orientation (quad for
pose_absor axis-angle forpose_rel).Scale factor for the wrench targets.
Scale factor for the stiffness commands.
Scale factor for the damping ratio commands.
"none","zero","default","center".Classes:
The offset pose from parent frame to child frame.
- asset_name: str#
The name of the scene entity.
This is the name defined in the scene configuration file. See the
InteractiveSceneCfgclass for more details.
- clip: dict[str, tuple] | None#
Clip range for the action (dict of regex expressions). Defaults to None.
- class OffsetCfg[source]#
Bases:
objectThe offset pose from parent frame to child frame.
On many robots, end-effector frames are fictitious frames that do not have a corresponding rigid body. In such cases, it is easier to define this transform w.r.t. their parent rigid body. For instance, for the Franka Emika arm, the end-effector is defined at an offset to the the “panda_hand” frame.
Attributes:
- body_offset: OffsetCfg | None#
Offset of target frame w.r.t. to the body frame. Defaults to None, in which case no offset is applied.
- task_frame_rel_path: str#
The path of a
RigidObject, relative to the sub-environment, representing task frame. Defaults to None.
- controller_cfg: OperationalSpaceControllerCfg#
The configuration for the operational space controller.
- class isaaclab.envs.mdp.actions.actions_cfg.SurfaceGripperBinaryActionCfg[source]#
Bases:
ActionTermCfgConfiguration for the binary surface gripper action term.
See
SurfaceGripperBinaryActionfor more details.Attributes:
Whether to visualize debug information.
Clip range for the action (dict of regex expressions).
Name of the surface gripper asset in the scene.
The command value to open the gripper.
The command value to close the gripper.
Events#
Common functions that can be used to enable different events.
Events include anything related to altering the simulation state. This includes changing the physics materials, applying external forces, and resetting the state of the asset.
The functions can be passed to the isaaclab.managers.EventTermCfg object to enable
the event introduced by the function.
Functions:
|
Randomize the scale of a rigid body asset in the USD stage. |
|
Randomize the external forces and torques applied to the bodies. |
|
Push the asset by setting the root velocity to a random value within the given ranges. |
Reset the asset root position and velocities sampled randomly within the given ranges and the asset root orientation sampled randomly from the SO(3). |
|
|
Reset the asset root state by sampling a random valid pose from the terrain. |
|
Reset the robot joints by scaling the default position and velocity by the given ranges. |
|
Reset the robot joints with offsets around the default position and velocity by the given ranges. |
|
Reset the asset nodal state to a random position and velocity uniformly within the given ranges. |
|
Reset the scene to the default state specified in the scene configuration. |
Classes:
Randomize the physics materials on all geometries of the asset. |
|
Randomize the mass of the bodies by adding, scaling, or setting random values. |
|
Randomize the inertia tensor of rigid bodies by adding, scaling, or setting values. |
|
Randomize the center of mass (CoM) of rigid bodies by adding a random value sampled from the given ranges. |
|
Randomize the collider parameters of rigid bodies by setting random values. |
|
Randomize gravity by adding, scaling, or setting random values. |
|
Randomize the actuator gains in an articulation by adding, scaling, or setting random values. |
|
Randomize the simulated joint parameters of an articulation by adding, scaling, or setting random values. |
|
Randomize the simulated fixed tendon parameters of an articulation by adding, scaling, or setting random values. |
|
Reset the asset root state to a random position and velocity uniformly within the given ranges. |
|
Reset an articulation's joints to a random position in the given limit ranges. |
|
Randomize the visual texture of bodies on an asset using Replicator API. |
|
Randomize the visual color of bodies on an asset using Replicator API. |
- isaaclab.envs.mdp.events.randomize_rigid_body_scale(env: ManagerBasedEnv, env_ids: torch.Tensor | None, scale_range: tuple[float, float] | dict[str, tuple[float, float]], asset_cfg: SceneEntityCfg, relative_child_path: str | None = None)[source]#
Randomize the scale of a rigid body asset in the USD stage.
This function modifies the “xformOp:scale” property of all the prims corresponding to the asset.
It takes a tuple or dictionary for the scale ranges. If it is a tuple, then the scaling along individual axis is performed equally. If it is a dictionary, the scaling is independent across each dimension. The keys of the dictionary are
x,y, andz. The values are tuples of the form(min, max).If the dictionary does not contain a key, the range is set to one for that axis.
Relative child path can be used to randomize the scale of a specific child prim of the asset. For example, if the asset at prim path expression
/World/envs/env_.*/Objecthas a child with the path/World/envs/env_.*/Object/mesh, then the relative child path should bemeshor/mesh.Attention
Since this function modifies USD properties that are parsed by the physics engine once the simulation starts, the term should only be used before the simulation starts playing. This corresponds to the event mode named “usd”. Using it at simulation time, may lead to unpredictable behaviors.
Note
When randomizing the scale of individual assets, please make sure to set
isaaclab.scene.InteractiveSceneCfg.replicate_physicsto False. This ensures that physics parser will parse the individual asset properties separately.
- class isaaclab.envs.mdp.events.randomize_rigid_body_material[source]#
Randomize the physics materials on all geometries of the asset.
This function creates a set of physics materials with random static friction, dynamic friction, and restitution values and assigns them to the geometries of the asset.
For articulations,
SceneEntityCfg.body_idsselects bodies in public articulation order. The backend implementations convert those IDs to backend shape ranges; callers must not pre-swizzle body IDs.Automatically detects the active physics backend (PhysX, Newton, or OVPhysX) and delegates to the appropriate backend-specific implementation:
PhysX: Uses the 3-tuple material format (static_friction, dynamic_friction, restitution) with bucket-based assignment (limited to 64000 unique materials). Applied via the PhysX tensor API (
root_view.set_material_properties).Newton: Samples friction (mu) and restitution continuously per shape (no bucket limitation). Newton uses a single friction coefficient, so
dynamic_friction_rangeandnum_bucketsare ignored. Applied directly to Newton’s view-level bindings. The Kamino solver shares contact materials across shapes and environments, so it instead samples one value per build-time material group and broadcasts it to every environment.OVPhysX: Runs the PhysX solver, so the same 3-tuple, bucket-based assignment is used, written through the
OvPhysxViewon the per-shapeshape_friction_and_restitutionbinding. Articulation body subsets are addressed through rigid-body material bindings for the selected links.
If the flag
make_consistentis set toTrue, the dynamic friction is set to be less than or equal to the static friction (PhysX and OVPhysX only). This obeys the physics constraint on friction values.Attention
On PhysX, this function uses CPU tensors to assign the material properties. It is recommended to use this function only during the initialization of the environment.
Note
PhysX only allows 64000 unique physics materials in the scene. If the number of materials exceeds this limit, the simulation will crash. Due to this reason, we sample the materials only once during initialization. Afterwards, these materials are randomly assigned to the geometries of the asset.
Methods:
__init__(cfg, env)Initialize the term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the term.
- Parameters:
- Raises:
ValueError – If the asset is not a RigidObject or an Articulation.
- class isaaclab.envs.mdp.events.randomize_rigid_body_mass[source]#
Randomize the mass of the bodies by adding, scaling, or setting random values.
This function allows randomizing the mass of the bodies of the asset. The function samples random values from the given distribution parameters and adds, scales, or sets the values into the physics simulation based on the operation.
If the
recompute_inertiaflag is set toTrue, the function recomputes the inertia tensor of the bodies after setting the mass. This is useful when the mass is changed significantly, as the inertia tensor depends on the mass. It assumes the body is a uniform density object. If the body is not a uniform density object, the inertia tensor may not be accurate.Tip
This function uses CPU tensors to assign the body masses. It is recommended to use this function only during the initialization of the environment.
Methods:
__init__(cfg, env)Initialize the term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the term.
- Parameters:
- Raises:
TypeError – If params is not a tuple of two numbers.
ValueError – If the operation is not supported.
ValueError – If the lower bound is negative or zero when not allowed.
ValueError – If the upper bound is less than the lower bound.
- class isaaclab.envs.mdp.events.randomize_rigid_body_inertia[source]#
Randomize the inertia tensor of rigid bodies by adding, scaling, or setting values.
This function modifies body inertia tensors independently of mass. The inertia tensor is a 3x3 symmetric matrix stored as 9 elements:
[Ixx, Ixy, Ixz, Iyx, Iyy, Iyz, Izx, Izy, Izz].Two modes are supported via the
diagonal_onlyparameter:diagonal_only=True (default): Only modifies diagonal elements (Ixx, Iyy, Izz at indices 0, 4, 8). This is useful for adding numerical stability (armature/regularization) without changing rotational coupling between axes. The diagonal elements represent resistance to rotation about each principal axis.
diagonal_only=False: Modifies all 9 elements of the inertia tensor. This can simulate manufacturing variations or asymmetric mass distributions. Off-diagonal elements represent coupling between rotations about different axes.
Note
Unlike
randomize_rigid_body_masswhich recomputes inertia based on mass ratios, this function modifies inertia directly without affecting mass.Methods:
__init__(cfg, env)Initialize the term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the term.
- Parameters:
- Raises:
ValueError – If the operation is not supported.
ValueError – If the lower bound is negative or zero when not allowed for scale operation.
ValueError – If the upper bound is less than the lower bound.
- class isaaclab.envs.mdp.events.randomize_rigid_body_com[source]#
Randomize the center of mass (CoM) of rigid bodies by adding a random value sampled from the given ranges.
This class tracks the original CoM values and randomizes from those defaults on each call, ensuring repeatable randomization across resets.
Automatically detects the active physics backend:
PhysX: Passes the full CoM pose (position + quaternion) to
set_coms_index.Newton: Passes position-only (vec3) to
set_coms_index. Note that on Newton (MuJoCo Warp), runtime CoM changes may cause simulation instability becausenotify_model_changed(BODY_INERTIAL_PROPERTIES)does not fully recompute the mass matrix afterbody_iposchanges. Use with caution until this is fixed upstream.
Methods:
__init__(cfg, env)Initialize the term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the term.
- class isaaclab.envs.mdp.events.randomize_rigid_body_collider_offsets[source]#
Randomize the collider parameters of rigid bodies by setting random values.
This function allows randomizing the collider parameters of the asset, such as rest and contact offsets. These correspond to the physics engine collider properties that affect collision checking.
Automatically detects the active physics backend (PhysX or Newton) and delegates to the appropriate backend-specific implementation:
PhysX: Uses rest offset and contact offset directly via the PhysX tensor API (
root_view.set_rest_offsets/root_view.set_contact_offsets).Newton: Maps PhysX concepts to Newton’s geometry properties. PhysX
rest_offsetmaps to Newtonshape_margin, and PhysXcontact_offsetis converted to Newtonshape_gapviagap = contact_offset - margin.
The function samples random values from the given distribution parameters and applies them as absolute values to the collider properties. If the distribution parameters are not provided for a particular property, the function does not modify it.
Tip
This function uses CPU tensors (PhysX) or GPU tensors (Newton) to assign the collision properties. It is recommended to use this function only during the initialization of the environment.
Methods:
__init__(cfg, env)Initialize the term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the term.
- Parameters:
- Raises:
ValueError – If the asset is not a RigidObject or an Articulation.
- class isaaclab.envs.mdp.events.randomize_physics_scene_gravity[source]#
Randomize gravity by adding, scaling, or setting random values.
Automatically detects the active physics backend (PhysX, OvPhysX, or Newton) and applies the appropriate gravity randomization strategy:
PhysX: samples a single gravity vector and sets it scene-wide via the PhysX simulation view. All environments share the same gravity.
OvPhysX: samples a single gravity vector and applies a sealed OvStage control update. All environments share the same gravity.
Newton: samples per-environment gravity vectors and writes them in-place to the Newton model’s per-world gravity array on GPU.
The distribution parameters are tuples of two lists with three floats each, representing the lower and upper bounds for the x, y, and z gravity components [m/s^2].
Methods:
__init__(cfg, env)Initialize the manager term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the manager term.
- class isaaclab.envs.mdp.events.randomize_actuator_gains[source]#
Randomize the actuator gains in an articulation by adding, scaling, or setting random values.
This function allows randomizing the actuator stiffness and damping gains.
The function samples random values from the given distribution parameters and applies the operation to the joint properties. It then sets the values into the actuator models. If the distribution parameters are not provided for a particular property, the function does not modify the property.
Tip
For implicit actuators, this function uses CPU tensors to assign the actuator gains into the simulation. In such cases, it is recommended to use this function only during the initialization of the environment.
Methods:
__init__(cfg, env)Initialize the term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the term.
- Parameters:
- Raises:
TypeError – If params is not a tuple of two numbers.
ValueError – If the operation is not supported.
ValueError – If the lower bound is negative or zero when not allowed.
ValueError – If the upper bound is less than the lower bound.
- class isaaclab.envs.mdp.events.randomize_joint_parameters[source]#
Randomize the simulated joint parameters of an articulation by adding, scaling, or setting random values.
This function allows randomizing the joint parameters of the asset. These correspond to the physics engine joint properties that affect the joint behavior. The properties include the joint friction coefficient, armature, and joint position limits.
The function samples random values from the given distribution parameters and applies the operation to the joint properties. It then sets the values into the physics simulation. If the distribution parameters are not provided for a particular property, the function does not modify the property.
Tip
This function uses CPU tensors to assign the joint properties. It is recommended to use this function only during the initialization of the environment.
Methods:
__init__(cfg, env)Initialize the term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the term.
- Parameters:
- Raises:
TypeError – If params is not a tuple of two numbers.
ValueError – If the operation is not supported.
ValueError – If the lower bound is negative or zero when not allowed.
ValueError – If the upper bound is less than the lower bound.
- class isaaclab.envs.mdp.events.randomize_fixed_tendon_parameters[source]#
Randomize the simulated fixed tendon parameters of an articulation by adding, scaling, or setting random values.
This function allows randomizing the fixed tendon parameters of the asset. These correspond to the physics engine tendon properties that affect the joint behavior.
The function samples random values from the given distribution parameters and applies the operation to the tendon properties. It then sets the values into the physics simulation. If the distribution parameters are not provided for a particular property, the function does not modify the property.
Methods:
__init__(cfg, env)Initialize the term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the term.
- Parameters:
- Raises:
TypeError – If params is not a tuple of two numbers.
ValueError – If the operation is not supported.
ValueError – If the lower bound is negative or zero when not allowed.
ValueError – If the upper bound is less than the lower bound.
- isaaclab.envs.mdp.events.apply_external_force_torque(env: ManagerBasedEnv, env_ids: torch.Tensor, force_range: tuple[float, float], torque_range: tuple[float, float], asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False))[source]#
Randomize the external forces and torques applied to the bodies.
This function creates a set of random forces and torques sampled from the given ranges. The number of forces and torques is equal to the number of bodies times the number of environments. The forces and torques are applied to the bodies by calling
asset.set_external_force_and_torque. The forces and torques are only applied whenasset.write_data_to_sim()is called in the environment.
- isaaclab.envs.mdp.events.push_by_setting_velocity(env: ManagerBasedEnv, env_ids: torch.Tensor, velocity_range: dict[str, tuple[float, float]], asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False))[source]#
Push the asset by setting the root velocity to a random value within the given ranges.
This creates an effect similar to pushing the asset with a random impulse that changes the asset’s velocity. It samples the root velocity from the given ranges and sets the velocity into the physics simulation.
The function takes a dictionary of velocity ranges for each axis and rotation. The keys of the dictionary are
x,y,z,roll,pitch, andyaw. The values are tuples of the form(min, max). If the dictionary does not contain a key, the velocity is set to zero for that axis.
- class isaaclab.envs.mdp.events.reset_root_state_uniform[source]#
Reset the asset root state to a random position and velocity uniformly within the given ranges.
This term randomizes the root position and velocity of the asset.
It samples the root position from the given ranges and adds them to the default root position, before setting them into the physics simulation.
It samples the root orientation from the given ranges and sets them into the physics simulation.
It samples the root velocity from the given ranges and sets them into the physics simulation.
The term takes a dictionary of pose and velocity ranges for each axis and rotation. The keys of the dictionary are
x,y,z,roll,pitch, andyaw. The values are tuples of the form(min, max). If the dictionary does not contain a key, the position or velocity is set to zero for that axis.The range dictionaries are materialized as device tensors once at construction.
Methods:
__init__(cfg, env)Initialize the manager term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the manager term.
- isaaclab.envs.mdp.events.reset_root_state_with_random_orientation(env: ManagerBasedEnv, env_ids: torch.Tensor, pose_range: dict[str, tuple[float, float]], velocity_range: dict[str, tuple[float, float]], asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False))[source]#
Reset the asset root position and velocities sampled randomly within the given ranges and the asset root orientation sampled randomly from the SO(3).
This function randomizes the root position and velocity of the asset.
It samples the root position from the given ranges and adds them to the default root position, before setting them into the physics simulation.
It samples the root orientation uniformly from the SO(3) and sets them into the physics simulation.
It samples the root velocity from the given ranges and sets them into the physics simulation.
The function takes a dictionary of position and velocity ranges for each axis and rotation:
pose_range- a dictionary of position ranges for each axis. The keys of the dictionary arex,y, andz. The orientation is sampled uniformly from the SO(3).velocity_range- a dictionary of velocity ranges for each axis and rotation. The keys of the dictionary arex,y,z,roll,pitch, andyaw.
The values are tuples of the form
(min, max). If the dictionary does not contain a particular key, the position is set to zero for that axis.
- isaaclab.envs.mdp.events.reset_root_state_from_terrain(env: ManagerBasedEnv, env_ids: torch.Tensor, pose_range: dict[str, tuple[float, float]], velocity_range: dict[str, tuple[float, float]], asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False))[source]#
Reset the asset root state by sampling a random valid pose from the terrain.
This function samples a random valid pose(based on flat patches) from the terrain and sets the root state of the asset to this position. The function also samples random velocities from the given ranges and sets them into the physics simulation.
The function takes a dictionary of position and velocity ranges for each axis and rotation:
pose_range- a dictionary of pose ranges for each axis. The keys of the dictionary areroll,pitch, andyaw. The position is sampled from the flat patches of the terrain.velocity_range- a dictionary of velocity ranges for each axis and rotation. The keys of the dictionary arex,y,z,roll,pitch, andyaw.
The values are tuples of the form
(min, max). If the dictionary does not contain a particular key, the position is set to zero for that axis.Note
The function expects the terrain to have valid flat patches under the key “init_pos”. The flat patches are used to sample the random pose for the robot.
- Raises:
ValueError – If the terrain does not have valid flat patches under the key “init_pos”.
- isaaclab.envs.mdp.events.reset_joints_by_scale(env: ManagerBasedEnv, env_ids: torch.Tensor, position_range: tuple[float, float], velocity_range: tuple[float, float], asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False))[source]#
Reset the robot joints by scaling the default position and velocity by the given ranges.
This function samples random values from the given ranges and scales the default joint positions and velocities by these values. The scaled values are then set into the physics simulation.
- isaaclab.envs.mdp.events.reset_joints_by_offset(env: ManagerBasedEnv, env_ids: torch.Tensor, position_range: tuple[float, float], velocity_range: tuple[float, float], asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False))[source]#
Reset the robot joints with offsets around the default position and velocity by the given ranges.
This function samples random values from the given ranges and biases the default joint positions and velocities by these values. The biased values are then set into the physics simulation.
- class isaaclab.envs.mdp.events.reset_joints_within_limits_range[source]#
Reset an articulation’s joints to a random position in the given limit ranges.
This function samples random values for the joint position and velocities from the given limit ranges. The values are then set into the physics simulation.
The parameters to the function are:
position_range- a dictionary of position ranges for each joint. The keys of the dictionary are the joint names (or regular expressions) of the asset.velocity_range- a dictionary of velocity ranges for each joint. The keys of the dictionary are the joint names (or regular expressions) of the asset.use_default_offset- a boolean flag to indicate if the ranges are offset by the default joint state. Defaults to False.asset_cfg- the configuration of the asset to reset. Defaults to the entity named “robot” in the scene.operation- whether the ranges are scaled values of the joint limits, or absolute limits.Defaults to “abs”.
The dictionary values are a tuple of the form
(a, b). Based on the operation, these values are interpreted differently:If the operation is “abs”, the values are the absolute minimum and maximum values for the joint, i.e. the joint range becomes
[a, b].If the operation is “scale”, the values are the scaling factors for the joint limits, i.e. the joint range becomes
[a * min_joint_limit, b * max_joint_limit].
If the
aor thebvalue isNone, the joint limits are used instead.Note
If the dictionary does not contain a key, the joint position or joint velocity is set to the default value for that joint.
Methods:
__init__(cfg, env)Initialize the manager term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the manager term.
- isaaclab.envs.mdp.events.reset_nodal_state_uniform(env: ManagerBasedEnv, env_ids: torch.Tensor, position_range: dict[str, tuple[float, float]], velocity_range: dict[str, tuple[float, float]], asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False))[source]#
Reset the asset nodal state to a random position and velocity uniformly within the given ranges.
This function randomizes the nodal position and velocity of the asset.
It samples the root position from the given ranges and adds them to the default nodal position, before setting them into the physics simulation.
It samples the root velocity from the given ranges and sets them into the physics simulation.
The function takes a dictionary of position and velocity ranges for each axis. The keys of the dictionary are
x,y,z. The values are tuples of the form(min, max). If the dictionary does not contain a key, the position or velocity is set to zero for that axis.
- isaaclab.envs.mdp.events.reset_scene_to_default(env: ManagerBasedEnv, env_ids: torch.Tensor, reset_joint_targets: bool = False)[source]#
Reset the scene to the default state specified in the scene configuration.
If
reset_joint_targetsis True, the joint position and velocity targets of the articulations are also reset to their default values. This might be useful for some cases to clear out any previously set targets. However, this is not the default behavior as based on our experience, it is not always desired to reset targets to default values, especially when the targets should be handled by action terms and not event terms.
- class isaaclab.envs.mdp.events.randomize_visual_texture_material[source]#
Randomize the visual texture of bodies on an asset using Replicator API.
This function randomizes the visual texture of the bodies of the asset using the Replicator API. The function samples random textures from the given texture paths and applies them to the bodies of the asset. The textures are projected onto the bodies and rotated by the given angles.
Note
The function assumes that the asset follows the prim naming convention as: “{asset_prim_path}/{body_name}/visuals” where the body name is the name of the body to which the texture is applied. This is the default prim ordering when importing assets from the asset converters in Isaac Lab.
Note
When randomizing the texture of individual assets, please make sure to set
isaaclab.scene.InteractiveSceneCfg.replicate_physicsto False. This ensures that physics parser will parse the individual asset properties separately.Methods:
__init__(cfg, env)Initialize the term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the term.
- class isaaclab.envs.mdp.events.randomize_visual_color[source]#
Randomize the visual color of bodies on an asset using Replicator API.
This function randomizes the visual color of the bodies of the asset using the Replicator API. The function samples random colors from the given colors and applies them to the bodies of the asset.
The function assumes that the asset follows the prim naming convention as: “{asset_prim_path}/{mesh_name}” where the mesh name is the name of the mesh to which the color is applied. For instance, if the asset has a prim path “/World/asset” and a mesh named “body_0/mesh”, the prim path for the mesh would be “/World/asset/body_0/mesh”.
The colors can be specified as a list of tuples of the form
(r, g, b)or as a dictionary with the keysr,g,band values as tuples of the form(low, high). If a dictionary is used, the function will sample random colors from the given ranges.Note
When randomizing the color of individual assets, please make sure to set
isaaclab.scene.InteractiveSceneCfg.replicate_physicsto False. This ensures that physics parser will parse the individual asset properties separately.Methods:
__init__(cfg, env)Initialize the randomization term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the randomization term.
GPU visual appearance randomization terms.
Classes:
Sample numeric material channels on device and issue one batched runtime renderer write. |
|
Randomize visual channels per selected shape on backends that expose shape storage. |
- class isaaclab.envs.mdp.visual_events.randomize_visual_material[source]#
Sample numeric material channels on device and issue one batched runtime renderer write.
This term requires an initialized renderer and therefore does not support
prestartupmode.Methods:
__init__(cfg, env)Initialize the manager term.
- __init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#
Initialize the manager term.
Commands#
Various command terms that can be used in the environment.
Classes:
Configuration for the null command generator. |
|
Configuration for the uniform velocity command generator. |
|
Configuration for the normal velocity command generator. |
|
Configuration for uniform pose command generator. |
|
Configuration for the uniform 2D-pose command generator. |
|
Configuration for the terrain-based position command generator. |
- class isaaclab.envs.mdp.commands.commands_cfg.NullCommandCfg[source]#
Bases:
CommandTermCfgConfiguration for the null command generator.
Attributes:
Time before commands are changed [s].
Whether to visualize debug information.
Type hint for the command for deployment.
Element names for the command for deployment.
- class isaaclab.envs.mdp.commands.commands_cfg.UniformVelocityCommandCfg[source]#
Bases:
CommandTermCfgConfiguration for the uniform velocity command generator.
Attributes:
Name of the asset in the environment for which the commands are generated.
Whether to use heading command or angular velocity command.
Scale factor to convert the heading error to angular velocity command.
The sampled probability of environments that should be standing still.
The sampled probability of environments where the robots follow the heading-based angular velocity command (the others follow the sampled angular velocity command).
Distribution ranges for the velocity commands.
Threshold on the per-episode mean XY velocity error norm [m/s].
Threshold on the per-episode mean yaw velocity error [rad/s].
Offset [m] applied to the robot root position when placing velocity visualization markers.
The configuration for the goal velocity visualization marker.
The configuration for the current velocity visualization marker.
Time before commands are changed [s].
Whether to visualize debug information.
Type hint for the command for deployment.
Element names for the command for deployment.
Classes:
Uniform distribution ranges for the velocity commands.
- heading_command: bool#
Whether to use heading command or angular velocity command. Defaults to False.
If True, the angular velocity command is computed from the heading error, where the target heading is sampled uniformly from provided range. Otherwise, the angular velocity command is sampled uniformly from provided range.
- heading_control_stiffness: float#
Scale factor to convert the heading error to angular velocity command. Defaults to 1.0.
- rel_standing_envs: float#
The sampled probability of environments that should be standing still. Defaults to 0.0.
- rel_heading_envs: float#
The sampled probability of environments where the robots follow the heading-based angular velocity command (the others follow the sampled angular velocity command). Defaults to 1.0.
This parameter is only used if
heading_commandis True.
- class Ranges[source]#
Bases:
objectUniform distribution ranges for the velocity commands.
Attributes:
Range for the linear-x velocity command (in m/s).
Range for the linear-y velocity command (in m/s).
Range for the angular-z velocity command (in rad/s).
Range for the heading command (in rad).
- marker_pos_offset: tuple[float, float, float]#
Offset [m] applied to the robot root position when placing velocity visualization markers.
The default of
(0.0, 0.0, 0.5)works well for quadrupeds. For taller robots such as humanoids, increase the Z component (e.g.(0.0, 0.0, 1.8)) so the arrows appear above the robot’s head rather than clipping through the torso.
- goal_vel_visualizer_cfg: VisualizationMarkersCfg#
The configuration for the goal velocity visualization marker. Defaults to GREEN_ARROW_X_MARKER_CFG.
- current_vel_visualizer_cfg: VisualizationMarkersCfg#
The configuration for the current velocity visualization marker. Defaults to BLUE_ARROW_X_MARKER_CFG.
- class isaaclab.envs.mdp.commands.commands_cfg.NormalVelocityCommandCfg[source]#
Bases:
UniformVelocityCommandCfgConfiguration for the normal velocity command generator.
Attributes:
Whether to use heading command or angular velocity command.
Distribution ranges for the velocity commands.
Time before commands are changed [s].
Whether to visualize debug information.
Type hint for the command for deployment.
Element names for the command for deployment.
Name of the asset in the environment for which the commands are generated.
Scale factor to convert the heading error to angular velocity command.
The sampled probability of environments that should be standing still.
The sampled probability of environments where the robots follow the heading-based angular velocity command (the others follow the sampled angular velocity command).
Threshold on the per-episode mean XY velocity error norm [m/s].
Threshold on the per-episode mean yaw velocity error [rad/s].
Offset [m] applied to the robot root position when placing velocity visualization markers.
The configuration for the goal velocity visualization marker.
The configuration for the current velocity visualization marker.
Classes:
Normal distribution ranges for the velocity commands.
- heading_command: bool#
Whether to use heading command or angular velocity command. Defaults to False.
If True, the angular velocity command is computed from the heading error, where the target heading is sampled uniformly from provided range. Otherwise, the angular velocity command is sampled uniformly from provided range.
- class Ranges[source]#
Bases:
objectNormal distribution ranges for the velocity commands.
Attributes:
Mean velocity for the normal distribution (in m/s).
Standard deviation for the normal distribution (in m/s).
Probability of zero velocity for the normal distribution.
- mean_vel: tuple[float, float, float]#
Mean velocity for the normal distribution (in m/s).
The tuple contains the mean linear-x, linear-y, and angular-z velocity.
- heading_control_stiffness: float#
Scale factor to convert the heading error to angular velocity command. Defaults to 1.0.
- rel_standing_envs: float#
The sampled probability of environments that should be standing still. Defaults to 0.0.
- rel_heading_envs: float#
The sampled probability of environments where the robots follow the heading-based angular velocity command (the others follow the sampled angular velocity command). Defaults to 1.0.
This parameter is only used if
heading_commandis True.
- marker_pos_offset: tuple[float, float, float]#
Offset [m] applied to the robot root position when placing velocity visualization markers.
The default of
(0.0, 0.0, 0.5)works well for quadrupeds. For taller robots such as humanoids, increase the Z component (e.g.(0.0, 0.0, 1.8)) so the arrows appear above the robot’s head rather than clipping through the torso.
- goal_vel_visualizer_cfg: VisualizationMarkersCfg#
The configuration for the goal velocity visualization marker. Defaults to GREEN_ARROW_X_MARKER_CFG.
- current_vel_visualizer_cfg: VisualizationMarkersCfg#
The configuration for the current velocity visualization marker. Defaults to BLUE_ARROW_X_MARKER_CFG.
- class isaaclab.envs.mdp.commands.commands_cfg.UniformPoseCommandCfg[source]#
Bases:
CommandTermCfgConfiguration for uniform pose command generator.
Attributes:
Name of the asset in the environment for which the commands are generated.
Name of the body in the asset for which the commands are generated.
Whether to make the quaternion unique or not.
Time before commands are changed [s].
Whether to visualize debug information.
Type hint for the command for deployment.
Element names for the command for deployment.
Ranges for the commands.
If set, position-error norm [m] below this value (per step) is required for success.
If set, orientation-error norm [rad] below this value (per step) is required for success.
The configuration for the goal pose visualization marker.
The configuration for the current pose visualization marker.
Classes:
Uniform distribution ranges for the pose commands.
- make_quat_unique: bool#
Whether to make the quaternion unique or not. Defaults to False.
If True, the quaternion is made unique by ensuring the real part is positive.
- class Ranges[source]#
Bases:
objectUniform distribution ranges for the pose commands.
Attributes:
Range for the x position (in m).
Range for the y position (in m).
Range for the z position (in m).
Range for the roll angle (in rad).
Range for the pitch angle (in rad).
Range for the yaw angle (in rad).
- position_success_threshold: float | None#
If set, position-error norm [m] below this value (per step) is required for success.
When both position and orientation thresholds are set, both conditions must be satisfied. The episode-level binary “ever successful” is mean-reduced across environments and logged under
Metrics/success_rate. Defaults toNone.
- orientation_success_threshold: float | None#
If set, orientation-error norm [rad] below this value (per step) is required for success.
When both position and orientation thresholds are set, both conditions must be satisfied. The episode-level binary “ever successful” is mean-reduced across environments and logged under
Metrics/success_rate. Defaults toNone.
- goal_pose_visualizer_cfg: VisualizationMarkersCfg#
The configuration for the goal pose visualization marker. Defaults to FRAME_MARKER_CFG.
- current_pose_visualizer_cfg: VisualizationMarkersCfg#
The configuration for the current pose visualization marker. Defaults to FRAME_MARKER_CFG.
- class isaaclab.envs.mdp.commands.commands_cfg.UniformPose2dCommandCfg[source]#
Bases:
CommandTermCfgConfiguration for the uniform 2D-pose command generator.
Attributes:
Time before commands are changed [s].
Whether to visualize debug information.
Type hint for the command for deployment.
Element names for the command for deployment.
Name of the asset in the environment for which the commands are generated.
Whether to use simple heading or not.
Distribution ranges for the position commands.
If set, XY position-error norm below this value (per step) flags the episode as successful.
The configuration for the goal pose visualization marker.
Classes:
Uniform distribution ranges for the position commands.
- simple_heading: bool#
Whether to use simple heading or not.
If True, the heading is in the direction of the target position.
- class Ranges[source]#
Bases:
objectUniform distribution ranges for the position commands.
Attributes:
Range for the x position (in m).
Range for the y position (in m).
Heading range for the position commands (in rad).
- position_success_threshold: float | None#
If set, XY position-error norm below this value (per step) flags the episode as successful.
The episode-level binary “ever within threshold” is mean-reduced across environments and logged under
Metrics/success_rate. Defaults toNone(success tracking disabled).
- goal_pose_visualizer_cfg: VisualizationMarkersCfg#
The configuration for the goal pose visualization marker. Defaults to GREEN_ARROW_X_MARKER_CFG.
- class isaaclab.envs.mdp.commands.commands_cfg.TerrainBasedPose2dCommandCfg[source]#
Bases:
UniformPose2dCommandCfgConfiguration for the terrain-based position command generator.
Attributes:
Time before commands are changed [s].
Whether to visualize debug information.
Type hint for the command for deployment.
Element names for the command for deployment.
Name of the asset in the environment for which the commands are generated.
Whether to use simple heading or not.
If set, XY position-error norm below this value (per step) flags the episode as successful.
The configuration for the goal pose visualization marker.
Distribution ranges for the sampled commands.
Classes:
Uniform distribution ranges for the position commands.
- simple_heading: bool#
Whether to use simple heading or not.
If True, the heading is in the direction of the target position.
- position_success_threshold: float | None#
If set, XY position-error norm below this value (per step) flags the episode as successful.
The episode-level binary “ever within threshold” is mean-reduced across environments and logged under
Metrics/success_rate. Defaults toNone(success tracking disabled).
- goal_pose_visualizer_cfg: VisualizationMarkersCfg#
The configuration for the goal pose visualization marker. Defaults to GREEN_ARROW_X_MARKER_CFG.
Rewards#
Common functions that can be used to enable reward functions.
The functions can be passed to the isaaclab.managers.RewardTermCfg object to include
the reward introduced by the function.
Functions:
|
Reward for being alive. |
|
Penalize terminated episodes that don't correspond to episodic timeouts. |
|
Penalize z-axis base linear velocity using L2 squared kernel. |
|
Penalize xy-axis base angular velocity using L2 squared kernel. |
|
Penalize non-flat base orientation using L2 squared kernel. |
|
Penalize asset height from its target using L2 squared kernel. |
|
Penalize the linear acceleration of bodies using L2-kernel. |
|
Penalize joint torques applied on the articulation using L2 squared kernel. |
|
Penalize joint velocities on the articulation using an L1-kernel. |
|
Penalize joint velocities on the articulation using L2 squared kernel. |
|
Penalize joint accelerations on the articulation using L2 squared kernel. |
|
Penalize joint positions that deviate from the default one. |
|
Penalize joint positions if they cross the soft limits. |
|
Penalize joint velocities if they cross the soft limits. |
|
Penalize applied torques if they cross the limits. |
|
Penalize the rate of change of the actions using L2 squared kernel. |
|
Penalize the actions using L2 squared kernel. |
|
Penalize undesired contacts as the number of violations that are above a threshold. |
|
Penalize if none of the desired contacts are present. |
|
Penalize contact forces as the amount of violations of the net contact force. |
|
Reward tracking of linear velocity commands (xy axes) using exponential kernel. |
|
Reward tracking of angular velocity commands (yaw) using exponential kernel. |
|
Penalize tracking of the position error using the L2 norm. |
|
Reward tracking of the position error using the tanh kernel. |
|
Penalize tracking of the orientation error using the shortest-path quaternion distance. |
Classes:
Penalize termination for specific terms that don't correspond to episodic timeouts. |
- isaaclab.envs.mdp.rewards.is_alive(env: ManagerBasedRLEnv) torch.Tensor[source]#
Reward for being alive.
- isaaclab.envs.mdp.rewards.is_terminated(env: ManagerBasedRLEnv) torch.Tensor[source]#
Penalize terminated episodes that don’t correspond to episodic timeouts.
- class isaaclab.envs.mdp.rewards.is_terminated_term[source]#
Penalize termination for specific terms that don’t correspond to episodic timeouts.
The parameters are as follows:
attr:term_keys: The termination terms to penalize. This can be a string, a list of strings or regular expressions. Default is “.*” which penalizes all terminations.
The reward is computed as the sum of the termination terms that are not episodic timeouts. This means that the reward is 0 if the episode is terminated due to an episodic timeout. Otherwise, if two termination terms are active, the reward is 2.
Methods:
__init__(cfg, env)Initialize the manager term.
- __init__(cfg: RewardTermCfg, env: ManagerBasedRLEnv)[source]#
Initialize the manager term.
- isaaclab.envs.mdp.rewards.lin_vel_z_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize z-axis base linear velocity using L2 squared kernel.
- isaaclab.envs.mdp.rewards.ang_vel_xy_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize xy-axis base angular velocity using L2 squared kernel.
- isaaclab.envs.mdp.rewards.flat_orientation_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize non-flat base orientation using L2 squared kernel.
This is computed by penalizing the xy-components of the projected gravity vector.
- isaaclab.envs.mdp.rewards.base_height_l2(env: ManagerBasedRLEnv, target_height: float, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False), sensor_cfg: SceneEntityCfg | None = None) torch.Tensor[source]#
Penalize asset height from its target using L2 squared kernel.
Note
For flat terrain, target height is in the world frame. For rough terrain, sensor readings can adjust the target height to account for the terrain.
- isaaclab.envs.mdp.rewards.body_lin_acc_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize the linear acceleration of bodies using L2-kernel.
- isaaclab.envs.mdp.rewards.joint_torques_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize joint torques applied on the articulation using L2 squared kernel.
Note
Only the joints configured in
asset_cfg.joint_idswill have their joint torques contribute to the term.
- isaaclab.envs.mdp.rewards.joint_vel_l1(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg) torch.Tensor[source]#
Penalize joint velocities on the articulation using an L1-kernel.
- isaaclab.envs.mdp.rewards.joint_vel_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize joint velocities on the articulation using L2 squared kernel.
Note
Only the joints configured in
asset_cfg.joint_idswill have their joint velocities contribute to the term.
- isaaclab.envs.mdp.rewards.joint_acc_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize joint accelerations on the articulation using L2 squared kernel.
Note
Only the joints configured in
asset_cfg.joint_idswill have their joint accelerations contribute to the term.
- isaaclab.envs.mdp.rewards.joint_deviation_l1(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize joint positions that deviate from the default one.
- isaaclab.envs.mdp.rewards.joint_pos_limits(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize joint positions if they cross the soft limits.
This is computed as a sum of the absolute value of the difference between the joint position and the soft limits.
- isaaclab.envs.mdp.rewards.joint_vel_limits(env: ManagerBasedRLEnv, soft_ratio: float, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize joint velocities if they cross the soft limits.
This is computed as a sum of the absolute value of the difference between the joint velocity and the soft limits.
- Parameters:
soft_ratio¶ – The ratio of the soft limits to be used.
- isaaclab.envs.mdp.rewards.applied_torque_limits(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Penalize applied torques if they cross the limits.
This is computed as a sum of the absolute value of the difference between the applied torques and the limits.
Caution
Currently, this only works for explicit actuators since we manually compute the applied torques. For implicit actuators, we currently cannot retrieve the applied torques from the physics engine.
- isaaclab.envs.mdp.rewards.action_rate_l2(env: ManagerBasedRLEnv) torch.Tensor[source]#
Penalize the rate of change of the actions using L2 squared kernel.
- isaaclab.envs.mdp.rewards.action_l2(env: ManagerBasedRLEnv) torch.Tensor[source]#
Penalize the actions using L2 squared kernel.
- isaaclab.envs.mdp.rewards.undesired_contacts(env: ManagerBasedRLEnv, threshold: float, sensor_cfg: SceneEntityCfg) torch.Tensor[source]#
Penalize undesired contacts as the number of violations that are above a threshold.
- isaaclab.envs.mdp.rewards.desired_contacts(env, sensor_cfg: SceneEntityCfg, threshold: float = 1.0) torch.Tensor[source]#
Penalize if none of the desired contacts are present.
- isaaclab.envs.mdp.rewards.contact_forces(env: ManagerBasedRLEnv, threshold: float, sensor_cfg: SceneEntityCfg) torch.Tensor[source]#
Penalize contact forces as the amount of violations of the net contact force.
- isaaclab.envs.mdp.rewards.track_lin_vel_xy_exp(env: ManagerBasedRLEnv, std: float, command_name: str, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Reward tracking of linear velocity commands (xy axes) using exponential kernel.
- isaaclab.envs.mdp.rewards.track_ang_vel_z_exp(env: ManagerBasedRLEnv, std: float, command_name: str, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Reward tracking of angular velocity commands (yaw) using exponential kernel.
- isaaclab.envs.mdp.rewards.position_command_error(env: ManagerBasedRLEnv, command_name: str, asset_cfg: SceneEntityCfg) torch.Tensor[source]#
Penalize tracking of the position error using the L2 norm.
The error [m] is the L2 norm between the commanded position (resolved into the world frame from the asset’s root pose) and the current position of the asset’s body in the world frame. The command is expected to be a pose command whose first three entries are the desired position in the root frame.
- isaaclab.envs.mdp.rewards.position_command_error_tanh(env: ManagerBasedRLEnv, std: float, command_name: str, asset_cfg: SceneEntityCfg) torch.Tensor[source]#
Reward tracking of the position error using the tanh kernel.
The position error [m] is computed as in
position_command_error()and mapped through a tanh kernel with standard deviationstd[m], yielding a bounded reward in[0, 1).
- isaaclab.envs.mdp.rewards.orientation_command_error(env: ManagerBasedRLEnv, command_name: str, asset_cfg: SceneEntityCfg) torch.Tensor[source]#
Penalize tracking of the orientation error using the shortest-path quaternion distance.
The error [rad] is the shortest-path angle between the commanded orientation (resolved into the world frame from the asset’s root pose) and the current orientation of the asset’s body in the world frame. The command is expected to be a pose command whose entries
[3:7]are the desired orientation quaternion in the root frame.
Terminations#
Common functions that can be used to activate certain terminations.
The functions can be passed to the isaaclab.managers.TerminationTermCfg object to enable
the termination introduced by the function.
Functions:
|
Terminate the episode when the episode length exceeds the maximum episode length. |
|
Terminate the episode based on the total number of times commands have been re-sampled. |
|
Terminate environments whose pose command satisfies all configured success thresholds. |
|
Terminate when the asset's orientation is too far from the desired orientation limits. |
|
Terminate when the asset's root height is below the minimum height. |
|
Terminate when the asset's joint positions are outside of the soft joint limits. |
|
Terminate when the asset's joint positions are outside of the configured bounds. |
|
Terminate when the asset's joint velocities are outside the provided limits. |
|
Terminate when effort applied on the asset's joints are outside of the soft joint limits. |
|
Terminate when the contact force on the sensor exceeds the force threshold. |
Classes:
Terminate when the asset's joint velocities are outside of the soft joint limits. |
- isaaclab.envs.mdp.terminations.time_out(env: ManagerBasedRLEnv) torch.Tensor[source]#
Terminate the episode when the episode length exceeds the maximum episode length.
- isaaclab.envs.mdp.terminations.command_resample(env: ManagerBasedRLEnv, command_name: str, num_resamples: int = 1) torch.Tensor[source]#
Terminate the episode based on the total number of times commands have been re-sampled.
This makes the maximum episode length fluid in nature as it depends on how the commands are sampled. It is useful in situations where delayed rewards are used [RHBH22].
- isaaclab.envs.mdp.terminations.pose_command_success(env: ManagerBasedRLEnv, command_name: str) torch.Tensor[source]#
Terminate environments whose pose command satisfies all configured success thresholds.
- isaaclab.envs.mdp.terminations.bad_orientation(env: ManagerBasedRLEnv, limit_angle: float, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Terminate when the asset’s orientation is too far from the desired orientation limits.
This is computed by checking the angle between the projected gravity vector and the z-axis.
- isaaclab.envs.mdp.terminations.root_height_below_minimum(env: ManagerBasedRLEnv, minimum_height: float, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Terminate when the asset’s root height is below the minimum height.
Note
This is currently only supported for flat terrains, i.e. the minimum height is in the world frame.
- isaaclab.envs.mdp.terminations.joint_pos_out_of_limit(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Terminate when the asset’s joint positions are outside of the soft joint limits.
- isaaclab.envs.mdp.terminations.joint_pos_out_of_manual_limit(env: ManagerBasedRLEnv, bounds: tuple[float, float], asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Terminate when the asset’s joint positions are outside of the configured bounds.
Note
This function is similar to
joint_pos_out_of_limit()but allows the user to specify the bounds manually.
- class isaaclab.envs.mdp.terminations.joint_vel_out_of_limit[source]#
Terminate when the asset’s joint velocities are outside of the soft joint limits.
The joint indices are materialized as a device tensor once at construction.
Methods:
__init__(cfg, env)Initialize the manager term.
- __init__(cfg: TerminationTermCfg, env: ManagerBasedRLEnv)[source]#
Initialize the manager term.
- isaaclab.envs.mdp.terminations.joint_vel_out_of_manual_limit(env: ManagerBasedRLEnv, max_velocity: float, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Terminate when the asset’s joint velocities are outside the provided limits.
- isaaclab.envs.mdp.terminations.joint_effort_out_of_limit(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), fixed_tendon_names=None, fixed_tendon_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), object_collection_names=None, object_collection_ids=slice(None, None, None), preserve_order=False)) torch.Tensor[source]#
Terminate when effort applied on the asset’s joints are outside of the soft joint limits.
In the actuators, the applied torque are the efforts applied on the joints. These are computed by clipping the computed torques to the joint limits. Hence, we check if the computed torques are equal to the applied torques. If they are not, it means that clipping has occurred.
- isaaclab.envs.mdp.terminations.illegal_contact(env: ManagerBasedRLEnv, threshold: float, sensor_cfg: SceneEntityCfg) torch.Tensor[source]#
Terminate when the contact force on the sensor exceeds the force threshold.
Curriculum#
Common functions that can be used to create curriculum for the learning environment.
The functions can be passed to the isaaclab.managers.CurriculumTermCfg object to enable
the curriculum introduced by the function.
Classes:
Curriculum that modifies the reward weight based on a step-wise schedule. |
|
Curriculum term for modifying an environment parameter at runtime. |
|
Curriculum for modifying a manager term configuration at runtime. |
- class isaaclab.envs.mdp.curriculums.modify_reward_weight[source]#
Curriculum that modifies the reward weight based on a step-wise schedule.
Methods:
__init__(cfg, env)Initialize the manager term.
- __init__(cfg: CurriculumTermCfg, env: ManagerBasedRLEnv)[source]#
Initialize the manager term.
- class isaaclab.envs.mdp.curriculums.modify_env_param[source]#
Curriculum term for modifying an environment parameter at runtime.
This term helps modify an environment parameter (or attribute) at runtime. This parameter can be any attribute of the environment, such as the physics material properties, observation ranges, or any other configurable parameter that can be accessed via a dotted path.
The term uses the
addressparameter to specify the target attribute as a dotted path string. For instance, “event_manager.cfg.object_physics_material.func.material_buckets” would refer to the attributematerial_bucketsin the event manager’s event term “object_physics_material”, which is a tensor of sampled physics material properties.The term uses the
modify_fnparameter to specify the function that modifies the value of the target attribute. The function should have the signature:def modify_fn(env, env_ids, old_value, **modify_params) -> new_value | modify_env_param.NO_CHANGE: # modify the value based on the old value and the modify parameters new_value = old_value + modify_params["value"] return new_value
where
envis the learning environment,env_idsare the sub-environment indices,old_valueis the current value of the target attribute, andmodify_paramsare additional parameters that can be passed to the function. The function should return the new value to be set for the target attribute, or the special tokenmodify_env_param.NO_CHANGEto indicate that the value should not be changed.At the first call to the term after initialization, it compiles getter and setter functions for the target attribute specified by the
addressparameter. The getter retrieves the current value, and the setter writes a new value back to the attribute.This term processes getter/setter accessors for a target attribute in an(specified by as an “address” in the term configuration
cfg.params["address"]) the first time it is called, then on each invocation reads the current value, applies a user-providedmodify_fn, and writes back the result. SinceNonein this case can sometime be desirable value to write, we use token,NO_CHANGE, as non-modification signal to this class, see usage below.- Usage:
def resample_bucket_range( env, env_id, data, static_friction_range, dynamic_friction_range, restitution_range, num_steps ): if env.common_step_counter > num_steps: range_list = [static_friction_range, dynamic_friction_range, restitution_range] ranges = torch.tensor(range_list, device="cpu") new_buckets = math_utils.sample_uniform(ranges[:, 0], ranges[:, 1], (len(data), 3), device="cpu") return new_buckets # if the step counter is not reached, return NO_CHANGE to indicate no modification. # we do this instead of returning None, since None is a valid value to set. # additionally, returning the input data would not change the value but still lead # to the setter being called, which may add overhead. return mdp.modify_env_param.NO_CHANGE object_physics_material_curriculum = CurrTerm( func=mdp.modify_env_param, params={ "address": "event_manager.cfg.object_physics_material.func.material_buckets", "modify_fn": resample_bucket_range, "modify_params": { "static_friction_range": [0.5, 1.0], "dynamic_friction_range": [0.3, 1.0], "restitution_range": [0.0, 0.5], "num_step": 120000, }, }, )
Attributes:
Special token to indicate no change in the value to be set.
Methods:
__init__(cfg, env)Initialize the manager term.
- NO_CHANGE: ClassVar = <object object>#
Special token to indicate no change in the value to be set.
This token is used to signal that the modify_fn did not produce a new value. It can be returned by the modify_fn to indicate that the current value should remain unchanged.
- __init__(cfg: CurriculumTermCfg, env: ManagerBasedRLEnv)[source]#
Initialize the manager term.
- class isaaclab.envs.mdp.curriculums.modify_term_cfg[source]#
Curriculum for modifying a manager term configuration at runtime.
This class inherits from
modify_env_paramand is specifically designed to modify the configuration of a manager term in the environment. It mainly adds the convenience of using a simplified address style that uses “s.” as a prefix to refer to the manager’s configuration.For instance, instead of writing “event_manager.cfg.object_physics_material.func.material_buckets”, you can write “events.object_physics_material.func.material_buckets” to refer to the same term configuration. The same applies to other managers, such as “observations”, “commands”, “rewards”, and “terminations”.
Internally, it replaces the first occurrence of “s.” in the address with “_manager.cfg.”, thus transforming the simplified address into a full manager path.
- Usage:
def override_value(env, env_ids, data, value, num_steps): if env.common_step_counter > num_steps: return value return mdp.modify_term_cfg.NO_CHANGE command_object_pose_xrange_adr = CurrTerm( func=mdp.modify_term_cfg, params={ "address": "commands.object_pose.ranges.pos_x", # note: `_manager.cfg` is omitted "modify_fn": override_value, "modify_params": {"value": (-0.75, -0.25), "num_steps": 12000}, }, )
Methods:
__init__(cfg, env)Initialize the manager term.
Additional Public Classes#
The following classes are part of the public isaaclab.envs.mdp API.
Absolute Binary joint action that sets the binary action into joint position targets. |
|
Recorder configurations for recording actions and states. |
|
Base class for binary joint actions. |
|
Binary joint action that sets the binary action into joint position targets. |
|
Binary joint action that sets the binary action into joint velocity targets. |
|
Joint action term that applies exponential moving average (EMA) over the processed actions as the articulation's joints position commands. |
|
Recorder term that records the initial state of the environment after reset. |
|
Configuration for the initial state recorder term. |
|
Base class for joint actions. |
|
Joint action term that applies the processed actions to the articulation's joints as effort commands. |
|
Joint action term that applies the processed actions to the articulation's joints as position commands. |
|
Joint position action term that scales the input actions to the joint limits and applies them to the articulation's joints. |
|
Joint action term that applies the processed actions to the articulation's joints as velocity commands. |
|
Non-holonomic action that maps a two dimensional action to the velocity of the robot in the x, y and yaw directions. |
|
Command generator that generates a velocity command in SE(2) from a normal distribution. |
|
Command generator that does nothing. |
|
Recorder term that records processed actions at the end of each step. |
|
Configuration for the post step processed actions recorder term. |
|
Recorder term that records the state of the environment at the end of each step. |
|
Configuration for the step state recorder term. |
|
Recorder term that records the actions in the beginning of each step. |
|
Configuration for the step action recorder term. |
|
Recorder term that records the policy group observations in each step. |
|
Configuration for the step policy observation recorder term. |
|
Joint action term that applies the processed actions to the articulation's joints as relative position commands. |
|
Surface gripper binary action. |
|
Command generator that generates pose commands based on the terrain. |
|
Command generator that generates pose commands containing a 3-D position and heading. |
|
Command generator for generating pose commands uniformly. |
|
Command generator that generates a velocity command in SE(2) from uniform distribution. |
- class isaaclab.envs.mdp.AbsBinaryJointPositionAction[source]#
Bases:
BinaryJointActionAbsolute Binary joint action that sets the binary action into joint position targets.
This class extends
BinaryJointActionto accept absolute joint-position actions [m or rad, depending on joint type] for gripper control. It compares each continuous action with the configured threshold and selects the open or closed joint-position target.Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: actions_cfg.BinaryJointActionCfg, env: ManagerBasedEnv) None#
Initialize the action term.
- class isaaclab.envs.mdp.ActionStateRecorderManagerCfg[source]#
Bases:
RecorderManagerBaseCfgRecorder configurations for recording actions and states.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(dataset_file_handler_class_type: type = <class 'isaaclab.utils.datasets.hdf5_dataset_file_handler.HDF5DatasetFileHandler'>, dataset_export_dir_path: str = <factory>, dataset_filename: str = <factory>, dataset_export_mode: DatasetExportMode = <factory>, export_in_record_pre_reset: bool = <factory>, export_in_close: bool = <factory>, dataset_compression: bool = <factory>, record_initial_state: ~isaaclab.envs.mdp.recorders.recorders_cfg.InitialStateRecorderCfg = <factory>, record_post_step_states: ~isaaclab.envs.mdp.recorders.recorders_cfg.PostStepStatesRecorderCfg = <factory>, record_pre_step_actions: ~isaaclab.envs.mdp.recorders.recorders_cfg.PreStepActionsRecorderCfg = <factory>, record_pre_step_flat_policy_observations: ~isaaclab.envs.mdp.recorders.recorders_cfg.PreStepFlatPolicyObservationsRecorderCfg = <factory>, record_post_step_processed_actions: ~isaaclab.envs.mdp.recorders.recorders_cfg.PostStepProcessedActionsRecorderCfg = <factory>) None#
- class isaaclab.envs.mdp.BinaryJointAction[source]#
Bases:
ActionTermBase class for binary joint actions.
This action term maps a binary action to the open or close joint configurations. These configurations are specified through the
BinaryJointActionCfgobject. If the input action is a float vector, the action is considered binary based on the sign of the action values.Based on above, we follow the following convention for the binary action:
Open action: 1 (bool) or positive values (float).
Close action: 0 (bool) or negative values (float).
The action term can mostly be used for gripper actions, where the gripper is either open or closed. This helps in devising a mimicking mechanism for the gripper, since in simulation it is often not possible to add such constraints to the gripper.
Methods:
- __init__(cfg: actions_cfg.BinaryJointActionCfg, env: ManagerBasedEnv) None[source]#
Initialize the action term.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.BinaryJointPositionAction[source]#
Bases:
BinaryJointActionBinary joint action that sets the binary action into joint position targets.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: actions_cfg.BinaryJointActionCfg, env: ManagerBasedEnv) None#
Initialize the action term.
- class isaaclab.envs.mdp.BinaryJointVelocityAction[source]#
Bases:
BinaryJointActionBinary joint action that sets the binary action into joint velocity targets.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: actions_cfg.BinaryJointActionCfg, env: ManagerBasedEnv) None#
Initialize the action term.
- class isaaclab.envs.mdp.EMAJointPositionToLimitsAction[source]#
Bases:
JointPositionToLimitsActionJoint action term that applies exponential moving average (EMA) over the processed actions as the articulation’s joints position commands.
Exponential moving average (EMA) is a type of moving average that gives more weight to the most recent data points. This action term applies the processed actions as moving average position action commands. The moving average is computed as:
\[\text{applied action} = \alpha \times \text{processed actions} + (1 - \alpha) \times \text{previous applied action}\]where \(\alpha\) is the weight for the moving average, \(\text{processed actions}\) are the processed actions, and \(\text{previous action}\) is the previous action that was applied to the articulation’s joints.
In the trivial case where the weight is 1.0, the action term behaves exactly like the
JointPositionToLimitsActionclass.On reset, the previous action is initialized to the current joint positions of the articulation’s joints.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: actions_cfg.EMAJointPositionToLimitsActionCfg, env: ManagerBasedEnv)[source]#
Initialize the action term.
- class isaaclab.envs.mdp.InitialStateRecorder[source]#
Bases:
RecorderTermRecorder term that records the initial state of the environment after reset.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: RecorderTermCfg, env: ManagerBasedEnv)#
Initialize the recorder term.
- class isaaclab.envs.mdp.InitialStateRecorderCfg[source]#
Bases:
RecorderTermCfgConfiguration for the initial state recorder term.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.JointAction[source]#
Bases:
ActionTermBase class for joint actions.
This action term performs pre-processing of the raw actions using affine transformations (scale and offset). These transformations can be configured to be applied to a subset of the articulation’s joints.
Mathematically, the action term is defined as:
\[\text{action} = \text{offset} + \text{scaling} \times \text{input action}\]where \(\text{action}\) is the action that is sent to the articulation’s actuated joints, \(\text{offset}\) is the offset applied to the input action, \(\text{scaling}\) is the scaling applied to the input action, and \(\text{input action}\) is the input action from the user.
Based on above, this kind of action transformation ensures that the input and output actions are in the same units and dimensions. The child classes of this action term can then map the output action to a specific desired command of the articulation’s joints (e.g. position, velocity, etc.).
Methods:
- __init__(cfg: actions_cfg.JointActionCfg, env: ManagerBasedEnv) None[source]#
Initialize the action term.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.JointEffortAction[source]#
Bases:
JointActionJoint action term that applies the processed actions to the articulation’s joints as effort commands.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: actions_cfg.JointEffortActionCfg, env: ManagerBasedEnv)[source]#
Initialize the action term.
- class isaaclab.envs.mdp.JointPositionAction[source]#
Bases:
JointActionJoint action term that applies the processed actions to the articulation’s joints as position commands.
Methods:
- __init__(cfg: actions_cfg.JointPositionActionCfg, env: ManagerBasedEnv)[source]#
Initialize the action term.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.JointPositionToLimitsAction[source]#
Bases:
ActionTermJoint position action term that scales the input actions to the joint limits and applies them to the articulation’s joints.
This class is similar to the
JointPositionActionclass. However, it performs additional re-scaling of input actions to the actuator joint position limits.While processing the actions, it performs the following operations:
Apply scaling to the raw actions based on
actions_cfg.JointPositionToLimitsActionCfg.scale.Clip the scaled actions to the range [-1, 1] and re-scale them to the joint limits if
actions_cfg.JointPositionToLimitsActionCfg.rescale_to_limitsis set to True.
The processed actions are then sent as position commands to the articulation’s joints.
Methods:
- __init__(cfg: actions_cfg.JointPositionToLimitsActionCfg, env: ManagerBasedEnv)[source]#
Initialize the action term.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.JointVelocityAction[source]#
Bases:
JointActionJoint action term that applies the processed actions to the articulation’s joints as velocity commands.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: actions_cfg.JointVelocityActionCfg, env: ManagerBasedEnv)[source]#
Initialize the action term.
- class isaaclab.envs.mdp.NonHolonomicAction[source]#
Bases:
ActionTermNon-holonomic action that maps a two dimensional action to the velocity of the robot in the x, y and yaw directions.
This action term helps model a skid-steer robot base. The action is a 2D vector which comprises of the forward velocity \(v_{B,x}\) and the turning rate :omega_{B,z}: in the base frame. Using the current base orientation, the commands are transformed into dummy joint velocity targets as:
\[\begin{split}\dot{q}_{0, des} &= v_{B,x} \cos(\theta) \\ \dot{q}_{1, des} &= v_{B,x} \sin(\theta) \\ \dot{q}_{2, des} &= \omega_{B,z}\end{split}\]where \(\theta\) is the yaw of the 2-D base. Since the base is simulated as a dummy joint, the yaw is directly the value of the revolute joint along z, i.e., \(q_2 = \theta\).
Note
The current implementation assumes that the base is simulated with three dummy joints (prismatic joints along x and y, and revolute joint along z). This is because it is easier to consider the mobile base as a floating link controlled by three dummy joints, in comparison to simulating wheels which is at times is tricky because of friction settings.
However, the action term can be extended to support other base configurations as well.
Tip
For velocity control of the base with dummy mechanism, we recommend setting high damping gains to the joints. This ensures that the base remains unperturbed from external disturbances, such as an arm mounted on the base.
Methods:
- __init__(cfg: actions_cfg.NonHolonomicActionCfg, env: ManagerBasedEnv)[source]#
Initialize the action term.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.NormalVelocityCommand[source]#
Bases:
UniformVelocityCommandCommand generator that generates a velocity command in SE(2) from a normal distribution.
The command comprises of a linear velocity in x and y direction and an angular velocity around the z-axis. It is given in the robot’s base frame.
The command is sampled from a normal distribution with mean and standard deviation specified in the configuration. With equal probability, the sign of the individual components is flipped.
Methods:
- __init__(cfg: NormalVelocityCommandCfg, env: ManagerBasedEnv)[source]#
Initializes the command generator.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.NullCommand[source]#
Bases:
CommandTermCommand generator that does nothing.
This command generator does not generate any commands. It is used for environments that do not require any commands.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: CommandTermCfg, env: ManagerBasedRLEnv)#
Initialize the command generator class.
- class isaaclab.envs.mdp.PostStepProcessedActionsRecorder[source]#
Bases:
RecorderTermRecorder term that records processed actions at the end of each step.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: RecorderTermCfg, env: ManagerBasedEnv)#
Initialize the recorder term.
- class isaaclab.envs.mdp.PostStepProcessedActionsRecorderCfg[source]#
Bases:
RecorderTermCfgConfiguration for the post step processed actions recorder term.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.PostStepStatesRecorder[source]#
Bases:
RecorderTermRecorder term that records the state of the environment at the end of each step.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: RecorderTermCfg, env: ManagerBasedEnv)#
Initialize the recorder term.
- class isaaclab.envs.mdp.PostStepStatesRecorderCfg[source]#
Bases:
RecorderTermCfgConfiguration for the step state recorder term.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.PreStepActionsRecorder[source]#
Bases:
RecorderTermRecorder term that records the actions in the beginning of each step.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: RecorderTermCfg, env: ManagerBasedEnv)#
Initialize the recorder term.
- class isaaclab.envs.mdp.PreStepActionsRecorderCfg[source]#
Bases:
RecorderTermCfgConfiguration for the step action recorder term.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.PreStepFlatPolicyObservationsRecorder[source]#
Bases:
RecorderTermRecorder term that records the policy group observations in each step.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: RecorderTermCfg, env: ManagerBasedEnv)#
Initialize the recorder term.
- class isaaclab.envs.mdp.PreStepFlatPolicyObservationsRecorderCfg[source]#
Bases:
RecorderTermCfgConfiguration for the step policy observation recorder term.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.RelativeJointPositionAction[source]#
Bases:
JointActionJoint action term that applies the processed actions to the articulation’s joints as relative position commands.
Unlike
JointPositionAction, this action term applies the processed actions as relative position commands. This means that the processed actions are added to the current joint positions of the articulation’s joints before being sent as position commands.This means that the action applied at every step is:
\[\text{applied action} = \text{current joint positions} + \text{processed actions}\]where \(\text{current joint positions}\) are the current joint positions of the articulation’s joints.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(cfg: actions_cfg.RelativeJointPositionActionCfg, env: ManagerBasedEnv)[source]#
Initialize the action term.
- class isaaclab.envs.mdp.SurfaceGripperBinaryAction[source]#
Bases:
ActionTermSurface gripper binary action.
This action term maps a binary action to the open or close surface gripper configurations. The surface gripper behavior is as follows: - [-1, -0.3] –> Gripper is Opening - [-0.3, 0.3] –> Gripper is Idle (do nothing) - [0.3, 1] –> Gripper is Closing
Based on above, we follow the following convention for the binary action:
Open action: 1 (bool) or positive values (float).
Close action: 0 (bool) or negative values (float).
The action term is specifically designed for surface grippers, which use a different interface than joint-based grippers.
Methods:
- __init__(cfg: actions_cfg.SurfaceGripperBinaryActionCfg, env: ManagerBasedEnv) None[source]#
Initialize the action term.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.TerrainBasedPose2dCommand[source]#
Bases:
UniformPose2dCommandCommand generator that generates pose commands based on the terrain.
This command generator samples the position commands from the valid patches of the terrain. The heading commands are either set to point towards the target or are sampled uniformly.
It expects the terrain to have a valid flat patches under the key ‘target’.
Methods:
- __init__(cfg: TerrainBasedPose2dCommandCfg, env: ManagerBasedEnv)[source]#
Initialize the command generator class.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.UniformPose2dCommand[source]#
Bases:
CommandTermCommand generator that generates pose commands containing a 3-D position and heading.
The command generator samples uniform 2D positions around the environment origin. It sets the height of the position command to the default root height of the robot. The heading command is either set to point towards the target or is sampled uniformly. This can be configured through the
Pose2dCommandCfg.simple_headingparameter in the configuration.Methods:
- __init__(cfg: UniformPose2dCommandCfg, env: ManagerBasedEnv)[source]#
Initialize the command generator class.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.UniformPoseCommand[source]#
Bases:
CommandTermCommand generator for generating pose commands uniformly.
The command generator generates poses by sampling positions uniformly within specified regions in cartesian space. For orientation, it samples uniformly the euler angles (roll-pitch-yaw) and converts them into quaternion representation (x, y, z, w).
The position and orientation commands are generated in the base frame of the robot, and not the simulation world frame. This means that users need to handle the transformation from the base frame to the simulation world frame themselves.
Caution
Sampling orientations uniformly is not strictly the same as sampling euler angles uniformly. This is because rotations are defined by 3D non-Euclidean space, and the mapping from euler angles to rotations is not one-to-one.
Methods:
- __init__(cfg: UniformPoseCommandCfg, env: ManagerBasedEnv)[source]#
Initialize the command generator class.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.envs.mdp.UniformVelocityCommand[source]#
Bases:
CommandTermCommand generator that generates a velocity command in SE(2) from uniform distribution.
The command comprises of a linear velocity in x and y direction and an angular velocity around the z-axis. It is given in the robot’s base frame.
If the
cfg.heading_commandflag is set to True, the angular velocity is computed from the heading error similar to doing a proportional control on the heading error. The target heading is sampled uniformly from the provided range. Otherwise, the angular velocity is sampled uniformly from the provided range.Mathematically, the angular velocity is computed as follows from the heading command:
\[\omega_z = \frac{1}{2} \text{wrap_to_pi}(\theta_{\text{target}} - \theta_{\text{current}})\]Methods:
- __init__(cfg: UniformVelocityCommandCfg, env: ManagerBasedEnv)[source]#
Initialize the command generator.
- Parameters:
- Raises:
ValueError – If the heading command is active but the heading range is not provided.
- classmethod __new__(*args, **kwargs)#