Implementation:Isaac sim IsaacGymEnvs AllegroKukaReorientation
| Knowledge Sources | |
|---|---|
| Domains | Robotic_Manipulation, Object_Reorientation |
| Last Updated | 2026-02-15 11:00 GMT |
Overview
AllegroKukaReorientation is an object reorientation task environment where a Kuka arm with an Allegro hand must rotate an object to match a randomly sampled target orientation and position.
Description
The AllegroKukaReorientation class extends AllegroKukaBase to implement an in-hand object reorientation task. Unlike the regrasping task that only cares about object position, this task requires the agent to achieve both a target position and a target rotation for the manipulated object. It uses four object keypoints at the corners of the object (offsets at [1,1,1], [1,1,-1], [-1,-1,1], [-1,-1,-1]) to track orientation accuracy.
The class loads goal assets corresponding to each object type in the training set, creating a translucent goal object that visually indicates the desired target pose. During resets, both the target position (sampled within a configurable volume) and the target orientation (sampled as a random quaternion) are randomized. An additional reset rule checks if the fingertips have drifted too far from the object (greater than 1.5 units), triggering an environment reset to prevent wasted training on unrecoverable states.
Curriculum learning is applied through tolerance_curriculum to progressively tighten the success tolerance as the policy improves. The _true_objective method uses the tolerance_successes_objective function to generate a PBT-compatible objective that prioritizes achieving tighter tolerances before maximizing raw success counts.
Usage
Use this class when training a reinforcement learning policy for single-arm in-hand object reorientation tasks. It is appropriate when the agent must learn to rotate objects to arbitrary target orientations using dexterous finger manipulation. Configure it through the IsaacGymEnvs Hydra configuration system and register it in the task registry.
Code Reference
Source Location
- Repository: IsaacGymEnvs
- File: isaacgymenvs/tasks/allegro_kuka/allegro_kuka_reorientation.py
- Lines: 42-149
Signature
class AllegroKukaReorientation(AllegroKukaBase):
def __init__(self, cfg, rl_device, sim_device, graphics_device_id, headless, virtual_screen_capture, force_render):
...
def _object_keypoint_offsets(self):
...
def _load_additional_assets(self, object_asset_root, arm_pose):
...
def _create_additional_objects(self, env_ptr, env_idx, object_asset_idx):
...
def _after_envs_created(self):
...
def _extra_reset_rules(self, resets):
...
def _reset_target(self, env_ids: Tensor) -> None:
...
def _extra_object_indices(self, env_ids: Tensor) -> List[Tensor]:
...
def _extra_curriculum(self):
...
def _true_objective(self) -> Tensor:
...
Import
from isaacgymenvs.tasks.allegro_kuka.allegro_kuka_reorientation import AllegroKukaReorientation
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| cfg | dict | Yes | Hydra configuration dictionary containing environment parameters, object types, target volume, and curriculum settings |
| rl_device | str | Yes | Device string for the RL algorithm (e.g., "cuda:0") |
| sim_device | str | Yes | Device string for the simulation (e.g., "cuda:0") |
| graphics_device_id | int | Yes | GPU device ID for rendering |
| headless | bool | Yes | Whether to run without a display |
| virtual_screen_capture | bool | Yes | Whether to capture virtual screen output |
| force_render | bool | Yes | Whether to force rendering even in headless mode |
Outputs
| Name | Type | Description |
|---|---|---|
| rew_buf | Tensor | Per-environment reward buffer incorporating position and orientation error |
| is_success | Tensor | Boolean tensor indicating which environments achieved the target pose |
| true_objective | Tensor | PBT objective combining tolerance progress and success count |
Usage Examples
# Register and instantiate the AllegroKukaReorientation task via IsaacGymEnvs
from isaacgymenvs.tasks.allegro_kuka.allegro_kuka_reorientation import AllegroKukaReorientation
# Typically created through the task registry with Hydra config
env = AllegroKukaReorientation(
cfg=task_cfg,
rl_device="cuda:0",
sim_device="cuda:0",
graphics_device_id=0,
headless=True,
virtual_screen_capture=False,
force_render=False,
)
# Run a step in the environment
obs = env.reset()
actions = policy(obs)
obs, rewards, dones, info = env.step(actions)