Implementation:Isaac sim IsaacGymEnvs AllegroHandDextreme Observations
| Knowledge Sources | |
|---|---|
| Domains | |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
The AllegroHandDextreme task class implements asymmetric actor-critic observations for dexterous in-hand manipulation with domain randomization. It defines a dictionary-based observation space with separate channels for actor-available and critic-only (privileged) information, and implements the observation computation, reward calculation, and action application pipelines.
Description
AllegroHandDextreme extends ADRVecTask and uses dictionary observations (use_dict_obs=True) where each observation channel is a separate tensor in the obs_dict. The get_num_obs_dict() method defines all channels and their dimensions. The compute_observations() method populates these channels from simulation state each step.
Key features:
- Asymmetric observations via
asymmetric_observations: True-- the training framework selects which channels to pass to actor vs. critic. - Random Network Adversary (RNA) -- adds adversarial action perturbations to increase policy robustness.
- Observation delays and noise -- simulates camera latency and sensor noise for realistic sim-to-real transfer.
- Wrist-relative coordinates -- object and goal poses are computed relative to the wrist frame for invariance.
Usage
# Task is instantiated via IsaacGymEnvs task registry
from isaacgymenvs.tasks.dextreme.allegro_hand_dextreme import AllegroHandDextreme
# Instantiated via config:
# python train.py task=AllegroHandDextremeADR
Code Reference
Source Location
- File:
isaacgymenvs/tasks/dextreme/allegro_hand_dextreme.py(lines 55--1345)
Signatures
class AllegroHandDextreme(ADRVecTask):
dict_obs_cls = True
def __init__(self, cfg, rl_device, sim_device, graphics_device_id,
headless, virtual_screen_capture, force_render):
"""Initialize task: read config, create sim, setup buffers."""
def get_num_obs_dict(self, num_dofs):
"""Define observation channel names and dimensions.
Returns:
dict mapping channel name -> int dimension
"""
def compute_observations(self):
"""Compute all observation channels from simulation state.
Populates self.obs_dict with current values for all channels.
Called from post_physics_step().
"""
def compute_reward(self, actions):
"""Compute per-environment rewards and update reset buffers.
Reward = rotation_reward + distance_reward + action_penalty
+ reach_goal_bonus + fall_penalty
"""
def pre_physics_step(self, actions):
"""Apply actions, handle resets, trigger domain randomization.
Called before physics simulation each step.
"""
def get_random_network_adversary_action(self, canonical_action):
"""Apply Random Network Adversary perturbation to actions.
Uses a randomly-weighted network to generate adversarial
action targets, blended with the policy action via rna_alpha.
"""
Import
from isaacgymenvs.tasks.dextreme.allegro_hand_dextreme import AllegroHandDextreme
Observation Dictionary
The get_num_obs_dict() method defines the complete observation space:
| Channel | Dims | Actor | Critic | Description |
|---|---|---|---|---|
dof_pos |
16 | Yes | Yes | Joint positions (unscaled to [-1, 1]) |
dof_pos_randomized |
16 | Yes | Yes | Joint positions with additive noise |
dof_vel |
16 | No | Yes | Joint velocities |
dof_force |
16 | No | Yes | Generalized joint forces |
object_vels |
6 | No | Yes | Object linear and angular velocity |
last_actions |
16 | Yes | Yes | Previous step actions |
cube_random_params |
3 | No | Yes | Randomized cube parameters (mass, friction, scale) |
hand_random_params |
1 | No | Yes | Randomized hand parameters |
gravity_vec |
3 | No | Yes | Current gravity vector (may be randomized) |
ft_states |
52 | No | Yes | Fingertip states (pos, quat, vel) x 4 fingertips |
ft_force_torques |
24 | No | Yes | Fingertip force/torque wrenches x 4 fingertips |
rb_forces |
3 | No | Yes | Random forces applied to the object |
rot_dist |
2 | No | Yes | Current and best rotation distance to goal |
stochastic_delay_params |
4 | No | Yes | Cube obs delay prob, action delay prob, latency, refresh rate |
affine_params |
86 | No | Yes | Affine noise coefficients for obs/action transforms |
object_pose |
7 | Yes | Yes | Object pose relative to wrist (pos + quat) |
goal_pose |
7 | Yes | Yes | Goal pose relative to wrist |
goal_relative_rot |
4 | Yes | Yes | Relative rotation from object to goal (quaternion) |
object_pose_cam_randomized |
7 | Yes | No | Noisy/delayed object pose (simulating camera) |
goal_relative_rot_cam_randomized |
4 | Yes | No | Noisy relative rotation (from randomized camera pose) |
I/O Contract
Inputs
| Name | Type | Description |
|---|---|---|
self.dof_pos |
torch.Tensor (num_envs, 16) | Current DOF positions from Isaac Gym state tensor. |
self.root_state_tensor |
torch.Tensor | Root states for all actors (hand, object, goal) with pos, quat, vel. |
self.rigid_body_states |
torch.Tensor | Per-body states including fingertip poses and velocities. |
self.vec_sensor_tensor |
torch.Tensor | Force/torque sensor readings from fingertip sensors. |
self.dof_force_tensor |
torch.Tensor | Generalized joint forces. |
Outputs
| Name | Type | Description |
|---|---|---|
self.obs_dict |
dict[str, torch.Tensor] | Dictionary mapping observation channel names to tensors, each of shape (num_envs, channel_dim).
|
self.rew_buf |
torch.Tensor (num_envs,) | Per-environment reward for the current step. |
self.reset_buf |
torch.Tensor (num_envs,) | Per-environment reset flag (1 = environment should reset). |
self.extras |
dict | Extra information for logging (consecutive successes, reward components, ADR metrics). |
Reward Function
The reward is computed by the JIT-compiled compute_hand_reward() function:
reward = (dist_reward_scale * dist_to_object # Penalize distance to object
+ rot_reward_scale * rot_reward # Reward rotation alignment
+ action_penalty_scale * action_norm # Penalize large actions
+ action_delta_penalty_scale * action_delta # Penalize action changes
+ reach_goal_bonus * success_flag # Bonus for reaching goal
+ fall_penalty * fall_flag) # Penalty for dropping object
Where rot_reward = 1.0 / (abs(rot_dist) + rot_eps) and success is defined as rot_dist < success_tolerance.