Implementation:Isaac sim IsaacGymEnvs AllegroKukaUtils
| Knowledge Sources | |
|---|---|
| Domains | Robotic_Control, Curriculum_Learning |
| Last Updated | 2026-02-15 11:00 GMT |
Overview
AllegroKukaUtils provides a DofParameters dataclass and utility functions for configuring joint properties and managing curriculum-based tolerance schedules in Allegro-Kuka manipulation tasks.
Description
This module contains the DofParameters dataclass and several utility functions that are shared across all Allegro-Kuka task variants (regrasping, reorientation, throwing, and their two-arm counterparts). The DofParameters dataclass encapsulates the stiffness, damping, effort, friction, and armature parameters for both the Kuka arm DOFs and the Allegro hand DOFs, with a factory method from_cfg that extracts these values from a Hydra configuration dictionary.
The populate_dof_properties function applies DofParameters values to the IsaacGym DOF property arrays, setting separate stiffness, effort, damping, friction, and armature values for the arm and hand joints. This ensures consistent joint configuration across all environments and task variants.
The tolerance_curriculum function implements a curriculum learning strategy that progressively decreases the success tolerance threshold. It checks whether enough training frames have passed since the last update and whether the policy's mean successes per episode exceed a threshold (3.0) before tightening the tolerance by a configurable increment. The tolerance_successes_objective function computes a PBT-compatible objective that interpolates between 0 (initial tolerance) and 1 (target tolerance) and adds weighted success counts, ensuring that tolerance improvements always outweigh raw success gains at earlier curriculum stages.
Usage
Use DofParameters and populate_dof_properties when setting up joint configurations for Allegro-Kuka environments. Use tolerance_curriculum and tolerance_successes_objective to implement curriculum learning and PBT objectives in custom task subclasses. These utilities are called by all task variants in the allegro_kuka package.
Code Reference
Source Location
- Repository: IsaacGymEnvs
- File: isaacgymenvs/tasks/allegro_kuka/allegro_kuka_utils.py
- Lines: 38-158
Signature
@dataclass
class DofParameters:
allegro_stiffness: float
kuka_stiffness: float
allegro_effort: float
kuka_effort: List[float]
allegro_damping: float
kuka_damping: float
dof_friction: float
allegro_armature: float
kuka_armature: float
@staticmethod
def from_cfg(cfg: Dict) -> DofParameters:
...
def populate_dof_properties(hand_arm_dof_props, params: DofParameters, arm_dofs: int, hand_dofs: int) -> None:
...
def tolerance_curriculum(
last_curriculum_update: int,
frames_since_restart: int,
curriculum_interval: int,
prev_episode_successes: Tensor,
success_tolerance: float,
initial_tolerance: float,
target_tolerance: float,
tolerance_curriculum_increment: float,
) -> Tuple[float, int]:
...
def tolerance_successes_objective(
success_tolerance: float, initial_tolerance: float, target_tolerance: float, successes: Tensor
) -> Tensor:
...
Import
from isaacgymenvs.tasks.allegro_kuka.allegro_kuka_utils import DofParameters, tolerance_curriculum
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| cfg | Dict | Yes | Hydra configuration dictionary (for DofParameters.from_cfg) containing keys like allegroStiffness, kukaStiffness, etc. |
| hand_arm_dof_props | numpy.ndarray | Yes | Structured array of DOF properties from IsaacGym (for populate_dof_properties) |
| params | DofParameters | Yes | Joint parameter dataclass instance (for populate_dof_properties) |
| arm_dofs | int | Yes | Number of arm degrees of freedom (for populate_dof_properties) |
| hand_dofs | int | Yes | Number of hand degrees of freedom (for populate_dof_properties) |
| last_curriculum_update | int | Yes | Frame number of the last curriculum update (for tolerance_curriculum) |
| frames_since_restart | int | Yes | Total frames since training restart (for tolerance_curriculum) |
| curriculum_interval | int | Yes | Minimum frames between curriculum updates (for tolerance_curriculum) |
| prev_episode_successes | Tensor | Yes | Per-environment success counts from the previous episode (for tolerance_curriculum) |
| success_tolerance | float | Yes | Current success tolerance threshold (for tolerance_curriculum and tolerance_successes_objective) |
| initial_tolerance | float | Yes | Starting tolerance value (for tolerance_curriculum and tolerance_successes_objective) |
| target_tolerance | float | Yes | Final target tolerance value (for tolerance_curriculum and tolerance_successes_objective) |
| tolerance_curriculum_increment | float | Yes | Multiplicative factor applied to tolerance on each curriculum step (for tolerance_curriculum) |
| successes | Tensor | Yes | Per-environment success count tensor (for tolerance_successes_objective) |
Outputs
| Name | Type | Description |
|---|---|---|
| DofParameters | DofParameters | Dataclass instance containing arm and hand joint parameters |
| (success_tolerance, last_curriculum_update) | Tuple[float, int] | Updated tolerance and frame counter from tolerance_curriculum |
| true_objective | Tensor | PBT objective tensor from tolerance_successes_objective |
Usage Examples
from isaacgymenvs.tasks.allegro_kuka.allegro_kuka_utils import (
DofParameters, populate_dof_properties, tolerance_curriculum, tolerance_successes_objective
)
# Create DOF parameters from config
dof_params = DofParameters.from_cfg(cfg)
# Apply to IsaacGym DOF properties
populate_dof_properties(hand_arm_dof_props, dof_params, arm_dofs=7, hand_dofs=16)
# Run curriculum update
new_tolerance, new_last_update = tolerance_curriculum(
last_curriculum_update=0,
frames_since_restart=10000,
curriculum_interval=5000,
prev_episode_successes=successes_tensor,
success_tolerance=0.1,
initial_tolerance=0.5,
target_tolerance=0.01,
tolerance_curriculum_increment=0.9,
)
# Compute PBT objective
objective = tolerance_successes_objective(
success_tolerance=new_tolerance,
initial_tolerance=0.5,
target_tolerance=0.01,
successes=successes_tensor,
)