Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Added
^^^^^

* Added behavioral-success metrics and threshold-independent episode-error
diagnostics to the dexterous reorientation environments.

Fixed
^^^^^

* Fixed dexterous hand resets that could initialize joints below their lower
position limits. Reset joint positions now sample uniformly across the full
joint range; previously the distribution was biased toward the lower half of
the range.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
from isaaclab.markers import VisualizationMarkersCfg
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.sim import SimulationCfg
from isaaclab.sim.spawners.materials.physics_materials_cfg import RigidBodyMaterialCfg
from isaaclab.sim.spawners.materials import RigidBodyMaterialBaseCfg
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
from isaaclab.utils.configclass import configclass

from isaaclab_tasks.core.reorient.reorient_task_base import (
ALLEGRO_ACTUATED_JOINT_NAMES,
ALLEGRO_FINGERTIP_BODY_NAMES,
)
from isaaclab_tasks.utils import PresetCfg

from isaaclab_assets.robots.allegro import ALLEGRO_HAND_CFG
Expand Down Expand Up @@ -103,8 +107,38 @@ class PhysicsCfg(PresetCfg):
default = physx


# Scene pieces shared verbatim by the manager-based variant.
ROBOT_CFG = ALLEGRO_HAND_CFG.replace(prim_path="/World/envs/env_.*/Robot")
OBJECT_CFG = ObjectCfg()
GOAL_OBJECT_CFG = VisualizationMarkersCfg(
prim_path="/Visuals/goal_marker",
markers={
"goal": sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/DexCube/dex_cube_instanceable.usd",
scale=(1.2, 1.2, 1.2),
)
},
)


# Simulation settings shared by the Direct and manager variants (configclass
# deep-copies these defaults per cfg instance). The solver-common base material
# is sufficient: only friction values are set, so no PhysX-specific
# ``physxMaterial`` attributes are authored.
@configclass
class AllegroHandEnvCfg(DirectRLEnvCfg):
class AllegroHandTaskCfgBase:
"""Shared Allegro task settings inherited by both the Direct and the manager configurations."""

sim: SimulationCfg = SimulationCfg(
dt=1 / 120,
render_interval=4,
physics_material=RigidBodyMaterialBaseCfg(static_friction=1.0, dynamic_friction=1.0),
physics=PhysicsCfg(),
)


@configclass
class AllegroHandEnvCfg(AllegroHandTaskCfgBase, DirectRLEnvCfg):
# env
decimation = 4
episode_length_s = 10.0
Expand All @@ -113,59 +147,22 @@ class AllegroHandEnvCfg(DirectRLEnvCfg):
state_space = 0
asymmetric_obs = False
obs_type = "full"
# simulation
sim: SimulationCfg = SimulationCfg(
dt=1 / 120,
render_interval=decimation,
physics_material=RigidBodyMaterialCfg(
static_friction=1.0,
dynamic_friction=1.0,
),
physics=PhysicsCfg(),
)
# robot
robot_cfg: ArticulationCfg = ALLEGRO_HAND_CFG.replace(prim_path="/World/envs/env_.*/Robot")

actuated_joint_names = [
"index_joint_0",
"middle_joint_0",
"ring_joint_0",
"thumb_joint_0",
"index_joint_1",
"index_joint_2",
"index_joint_3",
"middle_joint_1",
"middle_joint_2",
"middle_joint_3",
"ring_joint_1",
"ring_joint_2",
"ring_joint_3",
"thumb_joint_1",
"thumb_joint_2",
"thumb_joint_3",
]
fingertip_body_names = [
"index_link_3",
"middle_link_3",
"ring_link_3",
"thumb_link_3",
]
robot_cfg: ArticulationCfg = ROBOT_CFG

actuated_joint_names = ALLEGRO_ACTUATED_JOINT_NAMES
fingertip_body_names = ALLEGRO_FINGERTIP_BODY_NAMES

# in-hand object
object_cfg: ObjectCfg = ObjectCfg()
object_cfg: ObjectCfg = OBJECT_CFG
# goal object
goal_object_cfg: VisualizationMarkersCfg = VisualizationMarkersCfg(
prim_path="/Visuals/goal_marker",
markers={
"goal": sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/DexCube/dex_cube_instanceable.usd",
scale=(1.2, 1.2, 1.2),
)
},
)
goal_object_cfg: VisualizationMarkersCfg = GOAL_OBJECT_CFG
# scene
scene: InteractiveSceneCfg = InteractiveSceneCfg(
num_envs=8192, env_spacing=0.75, replicate_physics=True, clone_in_fabric=True
num_envs=8192,
env_spacing=0.75,
replicate_physics=True,
clone_in_fabric=True,
)
# reset
reset_position_noise = 0.01 # range of position at reset
Expand All @@ -176,8 +173,8 @@ class AllegroHandEnvCfg(DirectRLEnvCfg):
rot_reward_scale = 1.0
rot_eps = 0.1
action_penalty_scale = -0.0002
reach_goal_bonus = 250
fall_penalty = 0
reach_goal_bonus = 250.0
fall_penalty = 0.0
fall_dist = 0.24
vel_obs_scale = 0.2
success_tolerance = 0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
kwargs={
"env_cfg_entry_point": f"{__name__}.shadow_hand_env_cfg:ShadowHandOpenAIEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_lstm_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:ShadowHandAsymLSTMPPORunnerCfg",
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from isaaclab.utils.configclass import configclass

from isaaclab_rl.rsl_rl import RslRlMLPModelCfg, RslRlOnPolicyRunnerCfg, RslRlPpoAlgorithmCfg
from isaaclab_rl.rsl_rl import RslRlMLPModelCfg, RslRlOnPolicyRunnerCfg, RslRlPpoAlgorithmCfg, RslRlRNNModelCfg


@configclass
Expand Down Expand Up @@ -47,6 +47,7 @@ class ShadowHandAsymFFPPORunnerCfg(RslRlOnPolicyRunnerCfg):
max_iterations = 10000
save_interval = 250
experiment_name = "shadow_hand_openai_ff"
obs_groups = {"actor": ["policy"], "critic": ["critic"]}
actor = RslRlMLPModelCfg(
hidden_dims=[400, 400, 200, 100],
activation="elu",
Expand Down Expand Up @@ -74,6 +75,30 @@ class ShadowHandAsymFFPPORunnerCfg(RslRlOnPolicyRunnerCfg):
)


@configclass
class ShadowHandAsymLSTMPPORunnerCfg(ShadowHandAsymFFPPORunnerCfg):
"""RSL-RL recurrent policy configuration for the asymmetric OpenAI observations."""

experiment_name = "shadow_hand_openai_lstm"
actor = RslRlRNNModelCfg(
hidden_dims=[400, 400, 200, 100],
activation="elu",
obs_normalization=True,
distribution_cfg=RslRlMLPModelCfg.GaussianDistributionCfg(init_std=1.0),
rnn_type="lstm",
rnn_hidden_dim=256,
rnn_num_layers=1,
)
critic = RslRlRNNModelCfg(
hidden_dims=[512, 512, 256, 128],
activation="elu",
obs_normalization=True,
rnn_type="lstm",
rnn_hidden_dim=256,
rnn_num_layers=1,
)


@configclass
class ShadowHandCameraFFPPORunnerCfg(RslRlOnPolicyRunnerCfg):
num_steps_per_env = 64
Expand Down
Loading
Loading